**** Merged from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2
3         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4
5 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6
7         * attribute.cs (Attribute.Resolve): Add error 653 report.
8
9         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10         report.
11         (Method.ApplyAttributeBuilder): Add error 685 report.
12         (Operator.Define): Add error 564 report.
13
14         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15
16         * expression.cs (Invocation.DoResolve): Add error
17         245 and 250 report.
18
19         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
20         error 674 report.
21
22 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
23
24         * class.cs (ConstructorInitializer.Resolve):
25         Wrong error number (515->516).
26
27 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
28
29         * class.cs (Indexer.Define): Add error 631 report.
30
31 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
32
33         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
34
35 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
36
37         * expression.cs (Probe.DoResolve): Add error CS0241 report.
38
39 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
40
41         * cs-parser.jay: Added error CS0241 report.
42
43 2004-09-10  Raja R Harinath  <rharinath@novell.com>
44
45         * cs-parser.jay (fixed_statement): Introduce a scope for the
46         declaration in the 'fixed' statement.
47
48 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
49
50         * cs-parser.jay: Added CS0230 error report.
51
52 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
53
54         * cs-parser.jay: Added errors CS0231 and CS0257 report.
55
56 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
57
58         * expression.cs (Argument.Resolve): Added error CS0192 and
59         CS0199 report.
60
61 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
62
63         C# 2.0 #pragma warning feature
64
65         * cs-tokenizer.cs (PreProcessPragma): New method; 
66         Handles #pragma directive.
67
68         * report.cs (WarningRegions): New class; Support
69         class for #pragma warning directive. It tests whether
70         warning is enabled for a given line.
71
72 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
73
74         * const.cs: Add more descriptive error report, tahnks to
75         Sebastien. 
76
77 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
78
79         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
80
81 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
82
83         * expression.cs: Apply patch from Ben: Remove dead code from
84         ArrayCreation, and remove the TurnintoConstant call in const.cs,
85         as that code just threw an exception anwyays.
86
87         * const.cs: Remove the call to the turnintoconstant, for details
88         see bug: #63144
89         
90         * literal.cs: The type of the null-literal is the null type;  So
91         we use a placeholder type (literal.cs:System.Null, defined here)
92         for it.
93
94         * expression.cs (Conditional.DoResolve): Remove some old code that
95         is no longer needed, conversions have been fixed.
96
97         (ArrayCreationExpression.DoResolve): Return false if we fail to
98         resolve the inner expression.
99
100 2004-09-07  Raja R Harinath  <rharinath@novell.com>
101
102         Fix test-290.cs.
103         * cs-parser.jay (delegate_declaration): Record a delegate
104         declaration as a type declaration.
105         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
106
107 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
108
109         * parameter.cs: Do not crash if the type can not be resolved. 
110
111         * expression.cs: Report errors with unsafe pointers, fixes #64896
112
113 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
114
115         * expression.cs: Pointer arith always needs to do a conv.i
116         if the operand is a long. fix 65320
117
118 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
119
120         Fixed cs0619-37.cs, cs0619-38.cs
121
122         * enum.cs (GetObsoleteAttribute): Removed.
123
124         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
125         on Enum member is double staged. The first is tested member
126         and then enum.
127
128 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
129
130         Fixed #56986, #63631, #65231
131
132         * class.cs: (TypeContainer.AddToMemberContainer): New method,
133         adds member to name container.
134         (TypeContainer.AddToTypeContainer): New method, adds type to
135         name container.
136         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
137         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
138         AddOperator): Simplified by reusing AddToMemberContainer.
139         (TypeContainer.UserDefinedStaticConstructor): Changed to property
140         instead of field.
141         (Method.CheckForDuplications): Fixed implementation to test all
142         possibilities.
143         (MemberBase): Detection whether member is explicit interface
144         implementation is now in constructor.
145         (MemberBase.UpdateMemberName): Handles IndexerName.
146         (Accessor): Changed to keep also location information.
147         (AbstractPropertyEventMethod): Is derived from MemberCore.
148         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
149         will be emited or not.
150         (PropertyBase.AreAccessorsDuplicateImplementation):
151         Tests whether accessors are not in collision with some method.
152         (Operator): Is derived from MethodCore to simplify common
153         operations.
154
155         * decl.cs (Flags.TestMethodDuplication): Test for duplication
156         must be performed.
157         (DeclSpace.AddToContainer): Adds the member to defined_names
158         table. It tests for duplications and enclosing name conflicts.
159
160         * enum.cs (EnumMember): Clean up to reuse the base structures
161
162 2004-09-03  Martin Baulig  <martin@ximian.com>
163
164         Merged latest changes into gmcs.  Please keep this comment in
165         here, it makes it easier for me to see what changed in MCS since
166         the last time I merged.
167
168 2004-09-03  Martin Baulig  <martin@ximian.com>
169
170         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
171         into TypeContainer, to make partial classes work again.
172
173 2004-09-03  Martin Baulig  <martin@ximian.com>
174
175         * rootcontext.cs (RootContext.V2): Removed.
176
177 2004-03-23  Martin Baulig  <martin@ximian.com>
178
179         * expression.cs (Invocation.OverloadResolve): Added `bool
180         may_fail' argument and use it instead of the Location.IsNull() hack.
181
182 2004-09-09  Martin Baulig  <martin@ximian.com>
183
184         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
185
186 2004-09-09  Martin Baulig  <martin@ximian.com>
187
188         * generic.cs (TypeParameter.DefineType): Added support for
189         explicit interface methods.
190
191 2004-09-09  Martin Baulig  <martin@ximian.com>
192
193         * README.Changes: New document.  Started to list important changes
194         between MCS and GMCS here.
195
196 2004-09-08  Martin Baulig  <martin@ximian.com>
197
198         * class.cs
199         (TypeContainer.CheckRecursiveDefinition): New protected method.
200         (TypeContainer.DefineType): Move the CS0146 check into
201         CheckRecursiveDefinition().     
202
203 2004-09-06  Martin Baulig  <martin@ximian.com>
204
205         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
206         types for the constructor constraint.
207
208 2004-09-03  Martin Baulig  <martin@ximian.com>
209
210         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
211         into TypeContainer, to make partial classes work again.
212
213 2004-09-03  Martin Baulig  <martin@ximian.com>
214
215         * rootcontext.cs (RootContext.V2): Removed.
216
217 2004-03-23  Martin Baulig  <martin@ximian.com>
218
219         * expression.cs (Invocation.OverloadResolve): Added `bool
220         may_fail' argument and use it instead of the Location.IsNull() hack.
221
222 2004-09-03  Martin Baulig  <martin@ximian.com>
223
224         Merged latest changes into gmcs.  Please keep this comment in
225         here, it makes it easier for me to see what changed in MCS since
226         the last time I merged.
227
228 2004-09-03  Raja R Harinath  <rharinath@novell.com>
229
230         Fix #61128.
231         * expression.cs (BetterConversion): Don't allow either conversion 
232         to be null.  Remove redundant implicit conversion test when 'q ==
233         null' -- when this function is invoked, we already know that the
234         implicit conversion exists.
235         (BetterFunction): Assume that 'best' is non-null.  Remove
236         redundant reimplementation of IsApplicable when 'best' is null.
237         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
238         number of arguments.
239         (IsAncestralType): Extract from OverloadResolve.
240         (OverloadResolve): Make robust to the MethodGroupExpr being
241         unsorted.  Implement all the logic of Section 14.5.5.1, and
242         support overloading of methods from multiple applicable types.
243         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
244
245         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
246         (RealError, Warning): Append type of report to related symbol.
247
248 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
249
250         * enum.cs: Fixed CLS-Compliance checks for enum members.
251         Error tests cs3008-8.cs, cs3014-8.cs
252
253 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
254
255         Fixed bug #62342, #63102
256         * class.cs: ImplementIndexer uses member.IsExplicitImpl
257         like ImplementMethod.
258
259 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
260
261         * attribute.cs (Attribute.GetAttributeArgumentExpression):
262         Fixed bug #65170.
263
264 2004-09-02  Martin Baulig  <martin@ximian.com>
265
266         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
267         TypeManager.GetArgumentTypes() rather than calling GetParameters()
268         on the MethodBase.
269
270 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
271
272         C# 2.0 Static classes implemented
273
274         * class.cs (TypeContainer): instance_constructors,
275         initialized_fields, initialized_static_fields,
276         default_constructor, base_inteface_types are protected to be
277         accessible from StaticClass.
278         (TypeContainer.DefineDefaultConstructor): New virtual method
279         for custom default constructor generating
280         (StaticClass): New class to handle "Static classes" feature.
281
282         * cs-parser.jay: Handle static keyword on class like instance
283         of StaticClass.
284
285         * driver.cs: Added "/langversion" command line switch with two
286         options (iso-1, default).
287
288 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
289
290         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
291
292 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
293
294         * delegate.cs: Style.
295
296 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
297
298         * delegate.cs: Add seperate instance expr field for miguel.
299
300 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
301
302         * PointerArithmetic (Resolve): make sure we are not doing
303         pointer arith on void*. Also, make sure we are resolved
304         by not setting eclass until resolve.
305
306         All callers: Make sure that PointerArithmetic gets resolved.
307
308 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
309
310         * ArrayCreation (LookupType): If the type does not resolve 
311         to an array, give an error.
312
313 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
314
315         * statement.cs (Try.Resolve): Fixed bug #64222
316
317 2004-08-27  Martin Baulig  <martin@ximian.com>
318
319         * class.cs
320         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
321         crash here.     
322
323 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
324
325         * ecore.cs (Constantify): Get underlying type via
326         System.Enum.GetUnderlyingType to avoid StackOverflow on the
327         Windows in special cases.
328
329 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
330
331         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
332         for obtaining also private methods.
333         (GetRemoveMethod): Used GetRemoveMethod (true)
334         for obtaining also private methods.
335
336 2004-09-02  Martin Baulig  <martin@ximian.com>
337
338         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
339         TypeManager.GetArgumentTypes() rather than calling GetParameters()
340         on the MethodBase.
341
342 2004-08-27  Martin Baulig  <martin@ximian.com>
343
344         * class.cs
345         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
346         crash here.     
347
348 2004-08-25  Martin Baulig  <martin@ximian.com>
349
350         * support.cs (ReflectionParameters..ctor): If this is a generic
351         method, retrieve and store its type parameters.
352         (InternalParameters..ctor): Added `TypeParameter[]' argument.
353         (ReflectionParameters.GenericConstraints): The argument specifies
354         the type parameter, not the method parameter.
355         (InternalParameters.GenericConstraints): Likewise.
356
357         * generic.cs (TypeParameter.DefineType): Correctly handle
358         constraints wrt. generic methods in interfaces and their
359         implementations.        
360
361 2004-08-24  Martin Baulig  <martin@ximian.com>
362
363         * generic.cs (TypeParameter.IsSubclassOf): New public method.
364         (Constraints.IsSubclassOf): New internal method.
365
366         * typemanager.cs (TypeManager.FindMembers): Added special support
367         for GenericTypeParameterBuilder's.      
368         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
369         type parameters.
370
371 2004-08-24  Martin Baulig  <martin@ximian.com>
372
373         * typemanager.cs
374         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
375         this for accessibility checks.
376         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
377         IsNestedFamilyAccessible.
378         (TypeManager.IsSubclassOf): New method, do what the name actually
379         says.   
380
381 2004-08-24  Martin Baulig  <martin@ximian.com>
382
383         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
384         as a SimpleName, include the generic arity.
385
386 2004-08-24  Martin Baulig  <martin@ximian.com>
387
388         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
389         MethodAttributes.HideBySig for operators.
390
391 2004-08-23  Martin Baulig  <martin@ximian.com>
392
393         Back to the old error reporting system :-)
394
395         * report.cs (Message): Removed.
396         (Report.MessageData, ErrorData, WarningData): Removed.
397         (Report.Error, Warning): Back to the old system.
398
399 2004-08-23  Martin Baulig  <martin@ximian.com>
400
401         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
402
403         * class.cs (TypeContainer.ParentContainer): New public virtual
404         method; replaces the explicit interface implementation.
405         (ClassPart.ParentContainer): Override.
406
407 2004-08-23  Martin Baulig  <martin@ximian.com>
408
409         * statement.cs (Switch): Added support for constant switches; see
410         #59428 or test-285.cs.
411
412 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
413
414         Fixed bug #62740.
415         * statement.cs (GetEnumeratorFilter): Removed useless
416         logic because C# specs is strict. GetEnumerator must be
417         public.
418
419 2004-08-22  Martin Baulig  <martin@ximian.com>
420
421         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
422         a switch and may break, reset the barrier.  Fixes #59867.
423
424 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
425
426         CLS-Compliance speed up (~5% for corlib)
427
428         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
429         New method. Tests container for CLS-Compliant names
430
431         * class.cs (TypeContainer.VerifyClsName): New method.
432         Checks whether container name is CLS Compliant.
433         (Constructor): Implements IMethodData.
434
435         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
436         low-case table for CLS Compliance test.
437         (MemberCache.VerifyClsParameterConflict): New method.
438         Checks method parameters for CS3006 error.
439
440         * enum.cs (EnumMember): Is derived from MemberCore.
441         (Enum.VerifyClsName): Optimized for better performance.
442
443 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
444
445         * report.cs: Renamed Error_T to Error and changed all
446         references.
447
448 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
449
450         * class.cs (TypeContainer.IndexerArrayList): New inner class
451         container for indexers.
452         (TypeContainer.DefaultIndexerName): New constant for default
453         indexer name. Replaced all "Item" with this constant.
454         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
455
456         * typemanager.cs (TypeManager.default_member_ctor): Cache here
457         DefaultMemberAttribute constructor.
458
459 2004-08-05  Martin Baulig  <martin@ximian.com>
460
461         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
462         Fix bug #59429.
463
464 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
465
466         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
467         multi platforms problem.
468
469         * compiler.csproj: Included shared files.
470
471 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
472
473         Fix bug 60333, 55971 in the more general way
474         * attribute.cs (Attribute.GetAttributeArgumentExpression):
475         Added arg_type argument for constant conversion.
476         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
477
478 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
479
480         Fix bug #59760
481         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
482         OperatorArrayList, MethodCoreArrayList for typecontainer
483         containers. Changed class member types to these new types.
484         (MethodArrayList.DefineMembers): Added test for CS0659.
485
486 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
487
488         * cfold.cs: Synchronize the folding with the code in expression.cs
489         Binary.DoNumericPromotions for uint operands.
490
491         * attribute.cs: Revert patch from Raja, it introduced a regression
492         while building Blam-1.2.1 (hard to isolate a test case).
493
494 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
495
496         Fix for #55382
497         * class.cs:
498         (TypeContainer.Define): Renamed to DefineContainerMembers because of
499         name collision.
500         (MethodCore.parent_method): New member. The method we're overriding
501         if this is an override method.
502         (MethodCore.CheckBase): Moved from Method class and made common.
503         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
504         private.
505         (MethodCore.CheckForDuplications): New abstract method. For custom
506         member duplication search in a container
507         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
508         method and its return type.
509         (Event.conflict_symbol): New member. Symbol with same name in the
510         parent class.
511
512         * decl.cs:
513         (MemberCache.FindMemberWithSameName): New method. The method
514         is looking for conflict with inherited symbols.
515
516 2004-08-04  Martin Baulig  <martin@ximian.com>
517
518         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
519
520         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
521
522 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
523
524         * report.cs (Message): New enum for better error, warning reference in
525         the code.
526         (MessageData): New inner abstract class. It generally handles printing of
527         error and warning messages.
528         Removed unused Error, Warning, Message methods.
529
530 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
531
532         Fix for cs0592-8.cs test
533         * attribute.cs
534         (Attributable.ValidAttributeTargets): Made public.
535         (Attribute.ExplicitTarget): New member for explicit target value.
536         (Attribute.CheckTargets): Now we translate explicit attribute
537         target to Target here.
538
539 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
540
541         * ecore.cs (MethodGroupExpr): new IsBase property.
542
543         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
544
545         * delegate.cs (DelegateCreation): store a MethodGroupExpr
546         rather than an instance expr.
547
548         (DelegateCreation.Emit): Use the method group rather than
549         the instance expression. Also, if you have base.Foo as the
550         method for a delegate, make sure to emit ldftn, not ldftnvirt.
551
552         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
553
554         (NewDelegate.DoResolve): Only check for the existance of Invoke
555         if the method is going to be needed. Use MethodGroupExpr.
556
557         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
558
559         * expression.cs: For pointer arith., make sure to use
560         the size of the type, not the size of the pointer to
561         the type.
562
563 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
564
565         Fix for #60722
566         * class.cs (Class): Added error CS0502 test.
567
568 2004-08-03  John Luke  <jluke@cfl.rr.com>
569             Raja R Harinath  <rharinath@novell.com>
570
571         Fix for #60997.
572         * attribute.cs (Attribute.complained_before): New flag.
573         (Attribute.ResolveType, Attribute.Resolve),
574         (Attribute.DefinePInvokeMethod): Set it.
575         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
576         
577 2004-08-03  Martin Baulig  <martin@ximian.com>
578
579         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
580         use a user-defined operator; we still need to do numeric
581         promotions in case one argument is a builtin type and the other
582         one has an implicit conversion to that type.  Fixes #62322.
583
584 2004-08-18  Martin Baulig  <martin@ximian.com>
585
586         * class.cs (Method.Define): Use the correct method name when
587         creating the MethodBuilder for a generic method.
588
589 2004-08-17  Martin Baulig  <martin@ximian.com>
590
591         * generic.cs (Constraints): Support type parameter constraints.
592
593 2004-08-16  Martin Baulig  <martin@ximian.com>
594
595         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
596         (Token.GENERIC_DIMENSION): New token; this is returned if we
597         encounter an unbound generic type in a typeof() expression.
598
599         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
600         this token is only generated while parsing a typeof() expression.
601         (typeof_expression): Removed the old unbound_type hack.
602
603         * generic.cs (TypeArguments.IsUnbound): New public property.
604
605         * decl.cs (MemberName): Added support for unbound types.
606
607 2004-08-14  Martin Baulig  <martin@ximian.com>
608
609         * typemanager.cs
610         (TypeManager.IsEqualGenericInstance): New static method.
611         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
612         just used to check accessibility, so follow the rules of 26.1.6.        
613
614         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
615         ConstructedType instead of a TypeExpression if we have type arguments.
616
617         * cs-parser.jay (typeof_expression): Support unbound generic types.
618
619         * ecore.cs (UnboundTypeExpression): New public class.
620
621 2004-08-12  Martin Baulig  <martin@ximian.com>
622
623         * typemanager.cs (TypeManager.IsNestedChildOf): Use
624         TypeManager.IsEqual() rather than `=='.
625
626         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
627         generic instances as well.
628
629 2004-08-12  Martin Baulig  <martin@ximian.com>
630
631         * expression.cs (Invocation.InferType): We can only infer method
632         type parameters.  Fixes #62647.
633
634 2004-08-11  Martin Baulig  <martin@ximian.com>
635
636         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
637         before resolving the base classes.
638
639 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
640
641         * Makefile: install .mdb file too.
642
643 2004-08-05  Martin Baulig  <martin@ximian.com>
644
645         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
646         initializer, the current type is just the TypeBuilder, not the
647         instantiated generic type.
648         (FieldExpr.IsFieldInitializer): New public property.
649
650 2004-08-04  Martin Baulig  <martin@ximian.com>
651
652         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
653
654         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
655
656 2004-08-03  Martin Baulig  <martin@ximian.com>
657
658         * class.cs (MethodData.Define): If we're an explicit
659         implementation, remove the generic arity from the type name.
660
661 2004-08-03  Martin Baulig  <martin@ximian.com>
662
663         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
664         use a user-defined operator; we still need to do numeric
665         promotions in case one argument is a builtin type and the other
666         one has an implicit conversion to that type.  Fixes #62322.
667
668 2004-08-02  Martin Baulig  <martin@ximian.com>
669
670         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
671         `TypeExpr[]' array.
672         (TypeContainer.GetClassBases): Return the unexpanded list of
673         interfaces; we expand them later.
674         (TypeContainer.DefineType): After creating the TypeBuilder, call
675         TypeManager.ExpandInterfaces() to get an expanded and resolved
676         list of interfaces.
677
678         * ecore.cs (TypeExpr.GetInterfaces): Removed
679
680         * generics.cs (Constraints.InterfaceConstraints): Remove.
681         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
682         register the interface constraints.
683
684         * typemanager.cs
685         (TypeManager.AddUserType): Removed the `ifaces' argument.
686         (TypeManager.AddTypeParameter): Likewise.
687         (TypeManager.AddUserInterface): Removed, was unused.
688         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
689         `TypeExpr[]' array for the interfaces.
690         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
691         has been defined, returns a list of the resolved interfaces types.
692         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
693         (TypeManager.GetExplicitInterfaces): Likewise.  
694
695 2004-08-02  Martin Baulig  <martin@ximian.com>
696
697         * expression.cs (Invocation.EmitCall): If we're invoking a method
698         on a type parameter, use the new `Constrained' prefix opcode.
699
700 2004-08-02  Martin Baulig  <martin@ximian.com>
701
702         * statement.cs (LocalInfo.Flags): Added `IsThis'.
703         (LocalInfo.IsThis): New public property.
704         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
705
706 2004-08-01  Martin Baulig  <martin@ximian.com>
707
708         * class.cs (TypeContainer.GetClassBases): Don't set the default
709         here since we may get called from GetPartialBases().
710         (TypeContainer.DefineType): If GetClassBases() didn't return a
711         parent, use the default one.
712
713 2004-07-30  Martin Baulig  <martin@ximian.com>
714
715         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
716
717         * class.cs (SourceMethod): New public class, derive from the
718         symbol writer's ISourceMethod.
719         (Method): Use the new symbol writer API.
720
721         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
722         as argument and use the new symbol writer.
723
724         * location.cs
725         (SourceFile): Implement the symbol writer's ISourceFile.
726         (Location.SymbolDocument): Removed.
727         (Location.SourceFile): New public property.
728
729         * symbolwriter.cs: Use the new symbol writer API.
730
731 2004-07-30  Raja R Harinath  <rharinath@novell.com>
732
733         * Makefile (install-local): Remove.  Functionality moved to
734         executable.make.
735
736 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
737
738         * Makefile: Install mcs.exe.config file together with mcs.exe.
739         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
740         correct runtime version.
741         
742 2004-07-25  Martin Baulig  <martin@ximian.com>
743
744         * class.cs
745         (TypeContainer.RegisterOrder): Removed, this was unused.
746         (TypeContainer, interface_order): Removed.
747         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
748         TypeContainer as argument since we can also be called with a
749         `PartialContainer' for a partial class/struct/interface.
750         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
751         of checking whether we're an `Interface' - we could be a
752         `PartialContainer'.
753         (PartialContainer.Register): Override; call
754         AddClass()/AddStruct()/AddInterface() on our parent.
755
756         * cs-parser.jay (interface_member_declaration): Add things to the
757         `current_container', not the `current_class'.
758
759         * rootcontext.cs (RegisterOrder): The overloaded version which
760         takes an `Interface' was unused, removed.
761
762         * typemanager.cs (TypeManager.LookupInterface): Return a
763         `TypeContainer', not an `Interface'.
764         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
765         contain a `PartialContainer' for an interface, so check it's
766         `Kind' to figure out what it is.
767
768 2004-07-25  Martin Baulig  <martin@ximian.com>
769
770         * class.cs (Class.DefaultTypeAttributes): New public constant.
771         (Struct.DefaultTypeAttributes): Likewise.
772         (Interface.DefaultTypeAttributes): Likewise.
773         (PartialContainer.TypeAttr): Override this and add the
774         DefaultTypeAttributes.
775
776 2004-07-25  Martin Baulig  <martin@ximian.com>
777
778         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
779         we can just use the `Parent' field instead.
780
781 2004-07-25  Martin Baulig  <martin@ximian.com>
782
783         * class.cs (TypeContainer.Emit): Renamed to EmitType().
784
785 2004-07-25  Martin Baulig  <martin@ximian.com>
786
787         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
788         our parts before defining any methods.
789         (TypeContainer.VerifyImplements): Make this virtual.
790         (ClassPart.VerifyImplements): Override and call VerifyImplements()
791         on our PartialContainer.
792
793 2004-07-25  Martin Baulig  <martin@ximian.com>
794
795         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
796
797         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
798         argument, we can just use the `Parent' field instead.
799
800         * class.cs
801         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
802         (MemberBase.DoDefine): Likewise.
803
804 2004-07-24  Martin Baulig  <martin@ximian.com>
805
806         * decl.cs (MemberCore.Parent): New public field.
807         (DeclSpace.Parent): Moved to MemberCore.
808
809         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
810         (MemberBase.ctor): Added TypeContainer argument, pass it to our
811         parent's .ctor.
812         (FieldBase, Field, Operator): Likewise.
813         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
814         (EventField, Event): Likewise.
815
816 2004-07-23  Martin Baulig  <martin@ximian.com>
817
818         * class.cs (PartialContainer): New public class.
819         (ClassPart): New public class.
820         (TypeContainer): Added support for partial classes.
821         (TypeContainer.GetClassBases): Splitted some of the functionality
822         out into GetNormalBases() and GetPartialBases().
823
824         * cs-tokenizer.cs (Token.PARTIAL): New token.
825         (Tokenizer.consume_identifier): Added some hacks to recognize
826         `partial', but only if it's immediately followed by `class',
827         `struct' or `interface'.
828
829         * cs-parser.jay: Added support for partial clases.
830
831 2004-07-23  Martin Baulig  <martin@ximian.com>
832
833         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
834         a `DeclSpace' and also made it readonly.
835         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
836         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
837         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
838
839         * cs-parser.jay: Pass the `current_class', not the
840         `current_container' (at the moment, this is still the same thing)
841         to a new Method, Property, Event, Indexer or Constructor.
842
843 2004-07-23  Martin Baulig  <martin@ximian.com>
844
845         * cs-parser.jay (CSharpParser): Added a new `current_class' field
846         and removed the `current_interface' one.
847         (struct_declaration, class_declaration, interface_declaration):
848         Set `current_class' to the newly created class/struct/interface;
849         set their `Bases' and call Register() before parsing their body.
850
851 2004-07-23  Martin Baulig  <martin@ximian.com>
852
853         * class.cs (Kind): New public enum.
854         (TypeContainer): Made this class abstract.
855         (TypeContainer.Kind): New public readonly field.
856         (TypeContainer.CheckDef): New public method; moved here from
857         cs-parser.jay.
858         (TypeContainer.Register): New public abstract method.
859         (TypeContainer.GetPendingImplementations): New public abstract
860         method.
861         (TypeContainer.GetClassBases): Removed the `is_class' and
862         `is_iface' parameters.
863         (TypeContainer.DefineNestedTypes): Formerly known as
864         DoDefineType().
865         (ClassOrStruct): Made this class abstract.
866
867         * tree.cs (RootTypes): New public type. 
868
869 2004-07-20  Martin Baulig  <martin@ximian.com>
870
871         * tree.cs (Tree.RecordNamespace): Removed.
872         (Tree.Namespaces): Removed.
873
874         * rootcontext.cs (RootContext.IsNamespace): Removed.
875
876         * cs-parser.jay (namespace_declaration): Just create a new
877         NamespaceEntry here.
878
879 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
880
881         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
882         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
883         entry to make sure it runs in the correct runtime version.
884         
885 2004-07-18  Martin Baulig  <martin@ximian.com>
886
887         * generic.cs (ConstructedType.CheckConstraints): Improved
888         constraints checking.
889
890 2004-07-18  Martin Baulig  <martin@ximian.com>
891
892         * expression.cs (Invocation.BetterMethod): Call
893         TypeManager.TypeToCoreType() on all types and removed my previous
894         hack; we're already doig the right thing here.
895
896 2004-07-17  Martin Baulig  <martin@ximian.com>
897
898         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
899
900 2004-07-16  Martin Baulig  <martin@ximian.com>
901
902         * iterators.cs: Added generics support.
903
904 2004-07-16  Martin Baulig  <martin@ximian.com>
905
906         * iterators.cs: Rewrote this.  We're now using one single Proxy
907         class for both the IEnumerable and the IEnumerator interface and
908         `Iterator' derives from Class so we can use the high-level API.
909
910         * class.cs (TypeContainer.AddIterator): New method.
911         (TypeContainer.DoDefineType): New protected virtual method, which
912         is called from DefineType().
913         (TypeContainer.DoDefineMembers): Call DefineType() and
914         DefineMembers() on all our iterators.
915         (TypeContainer.Emit): Call Emit() on all our iterators.
916         (TypeContainer.CloseType): Call CloseType() on all our iterators.
917
918         * codegen.cs (EmitContext.CurrentIterator): New public field.
919
920 2004-07-15  Martin Baulig  <martin@ximian.com>
921
922         * typemanager.cs
923         (TypeManager.not_supported_exception_type): New type.   
924
925 2004-07-14  Martin Baulig  <martin@ximian.com>
926
927         * typemanager.cs
928         (TypeManager.generic_ienumerable_type): New type.
929         (TypeManager.generic_ienumerator_type): New type.
930
931         * rootcontext.cs
932         (RootContext.interfaces_first_stage): Added
933         "System.Collections.Generic.IEnumerator`1" and
934         "System.Collections.Generic.IEnumerable`1".     
935
936 2004-07-14  Martin Baulig  <martin@ximian.com>
937
938         * iterators.cs: Use real error numbers.
939
940 2004-07-14  Martin Baulig  <martin@ximian.com>
941
942         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
943         requires this to be a System.Collection.IEnumerable and not a
944         class implementing that interface.
945         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
946
947 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
948
949         * class.cs: Fixed previous fix, it broke some error tests.
950
951 2004-07-12  Martin Baulig  <martin@ximian.com>
952
953         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
954         Fixes #61293.
955
956 2004-07-14  Martin Baulig  <martin@ximian.com>
957
958         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
959         an exclamation mark (!) for the generic arity to reflect the
960         latest spec changes; ie. use "System.Collections.Generic.IList`1".
961
962 2004-07-13  Martin Baulig  <martin@ximian.com>
963
964         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
965         specifiers being part of a type argument.
966
967 2004-07-13  Martin Baulig  <martin@ximian.com>
968
969         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
970         name for generic types.
971
972 2004-07-13  Martin Baulig  <martin@ximian.com>
973
974         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
975         bit to fix #60119.
976
977 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
978
979         * assign.cs (LocalTemporary): Add new argument: is_address,If
980         `is_address' is true, then the value that we store is the address
981         to the real value, and not the value itself.
982         
983         * ecore.cs (PropertyExpr): use the new local temporary
984         stuff to allow us to handle X.Y += z (where X is a struct)
985
986 2004-07-08  Martin Baulig  <martin@ximian.com>
987
988         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
989         not always return, just like we're doing in Using.Resolve().
990
991 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
992
993         * cs-parser.jay (fixed_statement): flag this as Pinned.
994
995 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
996
997         * typemanager.cs (TypeManager): Removed MakePinned method, this
998         mechanism is replaced with the .NET 2.x compatible mechanism of
999         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
1000
1001         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
1002         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
1003         `IsFixed' property which has a different meaning.
1004
1005 2004-07-02  Raja R Harinath  <rharinath@novell.com>
1006
1007         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
1008         visible from inside a nested class, not just the names of the
1009         immediately enclosing class.
1010         Fix for bug #60730.
1011
1012 2004-06-24  Raja R Harinath  <rharinath@novell.com>
1013
1014         * expression.cs (BetterConversion): Remove buggy special-case
1015         handling of "implicit constant expression conversions".  At this
1016         point, we already know that the conversion is possible -- we're
1017         only checking to see which is better.
1018
1019 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1020
1021         * cs-parser.jay: Added error CS0210 test.
1022
1023 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1024
1025         * cs-parser.jay: Added error CS0134 test.
1026
1027 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1028
1029         Fix bug #52507
1030         * cs-parser.jay: Added error CS0145 test.
1031
1032 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1033
1034         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
1035
1036 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
1037         
1038         * expression.cs (StackAlloc.Resolve): The argument may not
1039         be a constant; deal with this case.
1040         
1041 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
1042
1043         * attribute.cs (IndexerName_GetIndexerName): Renamed to
1044         GetIndexerAttributeValue.
1045         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
1046
1047         * class.cs (Indexer.Define): Added error tests for CS0415,
1048         CS0609.
1049
1050 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
1051
1052         * attribute.cs (Attribute.Resolve): Keep field code in sync with
1053         property code.
1054
1055 2004-06-23  Martin Baulig  <martin@ximian.com>
1056
1057         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
1058         neither return nor throw, reset the barrier as well.  Fixes #60457.
1059
1060 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
1061
1062         * class.cs : EventAttributes is now set to None by default.
1063           This fixes bug #60459.
1064
1065 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1066
1067         Fix bug #60219
1068         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1069         Don't throw exception but return null (it's sufficient now).
1070
1071 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1072
1073         * typemanager.cs (GetArgumentTypes): Faster implementation.
1074
1075 2004-06-18  Martin Baulig  <martin@ximian.com>
1076
1077         * attribute.cs (Attribute.Resolve): Check whether we're an
1078         EmptyCast which a Constant child.  Fixes #60333.
1079
1080 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
1081
1082         * statement.cs (EmitCollectionForeach): Account for the fact that
1083         not all valuetypes are in areas which we can take the address of.
1084         For these variables, we store to a temporary variable. Also, make
1085         sure that we dont emit a `callvirt' on a valuetype method.
1086
1087 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1088
1089         * expression.cs (StackAlloc.DoReSolve): Added test for
1090         negative parameter (CS0247).
1091
1092 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1093
1094         Fix bug #59792
1095         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
1096
1097 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1098
1099         Fix bug #59781
1100         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
1101         ulong.
1102
1103 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1104
1105         Fix bug #58254 & cs1555.cs, cs1556.cs
1106         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
1107
1108 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1109
1110         * cs-parser.jay: Added error CS1669 test for indexers.
1111
1112 2004-06-18  Martin Baulig  <martin@ximian.com>
1113
1114         * generics.cs (GenericMethod.ctor): Don't take an Attributes
1115         argument.  Fixes #60441.
1116
1117 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
1118         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
1119         The name needs to have the actual name of the method in order
1120         for other tests (such as the one in OverloadResolve for Invoke
1121         on a delegate) to work. As well, it does not really help
1122         error reporting because the method group had multiple methods.
1123         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
1124         Make profiling work.
1125         
1126 2004-06-13  Martin Baulig  <martin@ximian.com>
1127
1128         * cs-parser.jay: Don't allow generic attributes.
1129
1130 2004-06-13  Martin Baulig  <martin@ximian.com>
1131
1132         * class.cs (MemberBase.DoDefineBase): New protected method.
1133         (MemberBase.DoDefine): Compute the `flags' in the new
1134         DoDefineBase() which must be called first.
1135         (Method.Define): Call DoDefineBase() first so we have the flags
1136         when defining the generic method.
1137
1138         * cs-parser.jay (interface_method_declaration): Support generic methods.
1139
1140 2004-06-13  Martin Baulig  <martin@ximian.com>
1141
1142         * decl.cs (TypeName): Removed.
1143         (MemberName): Removed TypeName and MemberNow; now we just have
1144         MemberName.
1145
1146         * cs-parser.jay: Don't distinguish between type arguments and type
1147         parameters in the grammar and simplified the rules a bit.  The
1148         reduce/reduce conflicts are now gone (except the one we inherited
1149         from mcs).
1150
1151 2004-06-11  Martin Baulig  <martin@ximian.com>
1152
1153         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
1154         call this twice: for params and varargs methods.
1155
1156 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1157
1158         * class.cs:
1159         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
1160
1161 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1162
1163         * attribute.cs (Attribute.GetValidTargets): Made public.
1164
1165         * class.cs: 
1166         (AbstractPropertyEventMethod): New class for better code sharing.
1167         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
1168         CS1667 report.
1169         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
1170
1171 2004-06-09  Martin Baulig  <martin@ximian.com>
1172
1173         * cs-parser.jay: Removed a reduce/reduce conflict.
1174
1175 2004-06-03  Martin Baulig  <martin@ximian.com>
1176
1177         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
1178         GetSimpleName() and return a SimpleName.
1179
1180         * ecore.cs (SimpleName.Arguments): New public field.
1181         (SimpleName): Added overloaded ctor which takes an additional
1182         TypeArguments argument.
1183         (SimpleName.SimpleNameResolve): Added support for generic methods.
1184         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
1185         formerly in MemberAccess.DoResolve(), but we also need it in
1186         SimpleNameResolve().
1187
1188         * expression.cs (MemberAccess.DoResolve): Use the new
1189         MethodGroupExpr.ResolveGeneric().       
1190
1191 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1192
1193         * decl.cs: If possible, use lookuptypedirect here. We can only do
1194         this if there is no `.' after the namespace. Avoids using
1195         LookupType, which does lots of slow processing.
1196         (FindNestedType) New method, does what it says :-).
1197         * namespace.cs: use LookupTypeDirect.
1198         * rootcontext.cs: use membercache, if possible.
1199         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
1200
1201 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1202
1203         * expression.cs:
1204         According to the spec, 
1205
1206         In a member access of the form E.I, if E is a single identifier,
1207         and if the meaning of E as a simple-name (§7.5.2) is a constant,
1208         field, property, localvariable, or parameter with the same type as
1209         the meaning of E as a type-name (§3.8), then both possible
1210         meanings of E are permitted.
1211
1212         We did not check that E as a simple-name had the same type as E as
1213         a type name.
1214
1215         This trivial check gives us 5-7% on bootstrap time.
1216
1217 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1218
1219         * expression.cs (Invocation.OverloadResolve): Avoid the
1220         use of hashtables and boxing here by allocating on demand.
1221
1222 2004-05-30  Martin Baulig  <martin@ximian.com>
1223
1224         * rootcontext.cs (RootContext.LookupType): Don't cache things if
1225         we're doing a silent lookup.  Don't try to lookup nested types in
1226         TypeManager.object_type (thanks to Ben Maurer).
1227
1228 2004-05-30  Martin Baulig  <martin@ximian.com>
1229
1230         Committing a patch from Ben Maurer.
1231
1232         * rootcontext.cs (RootContext.LookupType): Cache negative results.
1233
1234 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1235
1236         * convert.cs: add a trivial cache for overload operator resolution.
1237
1238 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
1239
1240         * attribute.cs
1241         (AttributeTester.GetObsoleteAttribute): Returns instance of
1242         ObsoleteAttribute when type is obsolete.
1243
1244         * class.cs
1245         (TypeContainer.VerifyObsoleteAttribute): Override.
1246         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
1247         (MethodCode.VerifyObsoleteAttribute): Override.
1248         (MemberBase.VerifyObsoleteAttribute): Override.
1249
1250         * decl.cs
1251         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
1252         and report proper error.
1253
1254         *delegate.cs
1255         (Delegate.VerifyObsoleteAttribute): Override.
1256
1257         * ecore.cs
1258         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
1259         and report proper error.
1260         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
1261
1262         * enum.cs
1263         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
1264         and enum member.
1265
1266         * expression.cs
1267         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
1268         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
1269         Added test for ObsoleteAttribute.
1270
1271         * statement.cs
1272         (Catch): Derived from Statement.
1273
1274 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1275
1276         * decl.cs: If possible, use lookuptypedirect here. We can only do
1277         this if there is no `.' after the namespace. Avoids using
1278         LookupType, which does lots of slow processing.
1279         (FindNestedType) New method, does what it says :-).
1280         * namespace.cs: use LookupTypeDirect.
1281         * rootcontext.cs: use membercache, if possible.
1282         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
1283
1284 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1285
1286         * expression.cs:
1287         According to the spec, 
1288
1289         In a member access of the form E.I, if E is a single identifier,
1290         and if the meaning of E as a simple-name (§7.5.2) is a constant,
1291         field, property, localvariable, or parameter with the same type as
1292         the meaning of E as a type-name (§3.8), then both possible
1293         meanings of E are permitted.
1294
1295         We did not check that E as a simple-name had the same type as E as
1296         a type name.
1297
1298         This trivial check gives us 5-7% on bootstrap time.
1299
1300 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
1301
1302         Fixed bug #59071 & cs0160.cs
1303         * statement.cs (Try.Resolve): Check here whether order of catch
1304         clauses matches their dependencies.
1305
1306 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
1307
1308         Fixed bug #58624
1309         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
1310         unsafe type.
1311
1312 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1313
1314         * expression.cs (Invocation.OverloadResolve): Avoid the
1315         use of hashtables and boxing here by allocating on demand.
1316
1317 2004-05-30  Martin Baulig  <martin@ximian.com>
1318
1319         * rootcontext.cs (RootContext.LookupType): Don't cache things if
1320         we're doing a silent lookup.  Don't try to lookup nested types in
1321         TypeManager.object_type (thanks to Ben Maurer).
1322
1323 2004-05-30  Martin Baulig  <martin@ximian.com>
1324
1325         Committing a patch from Ben Maurer.
1326
1327         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
1328
1329 2004-05-29  Martin Baulig  <martin@ximian.com>
1330
1331         * class.cs (IMethodData.ShouldIgnore): New method.
1332
1333         * typemanager.cs (TypeManager.MethodFlags): Don't take a
1334         `Location' argument, we don't need it anywhere.  Use
1335         `IMethodData.ShouldIgnore ()' instead of
1336         `MethodData.GetMethodFlags ()'.
1337         (TypeManager.AddMethod): Removed.
1338         (TypeManager.AddMethod2): Renamed to AddMethod.
1339
1340 2004-05-29  Martin Baulig  <martin@ximian.com>
1341
1342         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
1343
1344         * convert.cs (Convert.ImplicitReferenceConversion): If we're
1345         converting from a class type S to an interface type and we already
1346         have an object on the stack, don't box it again.  Fixes #52578.
1347
1348 2004-05-29  Martin Baulig  <martin@ximian.com>
1349
1350         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1351         Added support for `params' parameters.  Fixes #59267.
1352
1353 2004-05-29  Martin Baulig  <martin@ximian.com>
1354
1355         * literal.cs (NullPointer): Provide a private .ctor which sets
1356         `type' to TypeManager.object_type.  Fixes #59048.
1357
1358 2004-05-29  Martin Baulig  <martin@ximian.com>
1359
1360         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
1361         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
1362
1363         * ecore.cs (EventExpr.instance_expr): Make the field private.
1364
1365 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
1366
1367         Fixed bug #50080 & cs0214-2.cs
1368         * expression.cs (Cast.DoResolve): Check unsafe context here.
1369         
1370         * statement.cs (Resolve.DoResolve): Likewise.
1371
1372 2004-05-26  Martin Baulig  <martin@ximian.com>
1373
1374         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
1375
1376         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
1377         (RootContext.LookupType): Pass down the `silent' flag.
1378
1379 2004-05-25  Martin Baulig  <martin@ximian.com>
1380
1381         * expression.cs
1382         (MethodGroupExpr.IdenticalTypeName): New public property.
1383         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
1384         expression actually refers to a type.
1385
1386 2004-05-25  Martin Baulig  <martin@ximian.com>
1387
1388         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
1389         for #56176 and made it actually work.
1390
1391 2004-05-25  Martin Baulig  <martin@ximian.com>
1392
1393         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
1394         (FieldExpr, PropertyExpr): Override and implement
1395         CacheTemporaries.  Fixes #52279.
1396
1397 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
1398
1399         * location.cs: In the new compiler listing a file twice is a
1400         warning, not an error.
1401
1402 2004-05-24  Martin Baulig  <martin@ximian.com>
1403
1404         * enum.cs (Enum.DefineType): For the `BaseType' to be a
1405         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
1406
1407 2004-05-24  Martin Baulig  <martin@ximian.com>
1408
1409         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
1410         walking the `using' list.  Fixes #53921.
1411
1412 2004-05-24  Martin Baulig  <martin@ximian.com>
1413
1414         * const.cs (Const.LookupConstantValue): Added support for
1415         EmptyCast's; fixes #55251.
1416
1417 2004-05-24  Martin Baulig  <martin@ximian.com>
1418
1419         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
1420         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
1421         which does the CS0135 check.  The reason is that we first need to
1422         check whether the variable actually exists.
1423
1424 2004-05-24  Martin Baulig  <martin@ximian.com>
1425
1426         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
1427         than RootContext.LookupType() to find the explicit interface
1428         type.  Fixes #58584.
1429
1430 2004-05-24  Raja R Harinath  <rharinath@novell.com>
1431
1432         * Makefile: Simplify.  Use executable.make.
1433         * mcs.exe.sources: New file.  List of sources of mcs.exe.
1434
1435 2004-05-24  Anders Carlsson  <andersca@gnome.org>
1436
1437         * decl.cs:
1438         * enum.cs:
1439         Use the invariant culture when doing String.Compare for CLS case
1440         sensitivity.
1441         
1442 2004-05-23  Martin Baulig  <martin@ximian.com>
1443
1444         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
1445         don't have any dots.  Fixes #52622, added cs0246-8.cs.
1446
1447         * namespace.cs (NamespaceEntry.Lookup): Likewise.
1448
1449 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
1450
1451         * class.cs (MemberBase.Define): Reuse MemberType member for 
1452         resolved type. Other methods can use it too.
1453
1454 2004-05-23  Martin Baulig  <martin@ximian.com>
1455
1456         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
1457         the variable also exists in the current block (otherwise, we need
1458         to report a CS0103).  Fixes #58670.
1459
1460 2004-05-23  Martin Baulig  <martin@ximian.com>
1461
1462         * flowanalysis.cs (Reachability.Reachable): Compute this
1463         on-the-fly rather than storing it as a field.
1464
1465 2004-05-23  Martin Baulig  <martin@ximian.com>
1466
1467         * flowanalysis.cs (Reachability.And): Manually compute the
1468         resulting `barrier' from the reachability.      
1469        
1470 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
1471
1472         Fix bug #57835
1473         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
1474         instance of ObsoleteAttribute when symbol is obsolete.
1475
1476         * class.cs
1477         (IMethodData): Extended interface for ObsoleteAttribute support.
1478
1479 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
1480
1481         * attribute.cs: Fix bug #55970
1482
1483 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
1484
1485         Fix bug #52705
1486         * attribute.cs
1487         (GetObsoleteAttribute): New method. Creates the instance of
1488         ObsoleteAttribute.
1489         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
1490         ObsoleteAttribute when member is obsolete.
1491         (AttributeTester.Report_ObsoleteMessage): Common method for
1492         Obsolete error/warning reporting.
1493
1494         * class.cs
1495         (TypeContainer.base_classs_type): New member for storing parent type.
1496
1497         * decl.cs
1498         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
1499         for this MemberCore.
1500
1501 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1502
1503         * attribute.cs, const.cs: Fix bug #58590
1504
1505 2004-05-21  Martin Baulig  <martin@ximian.com>
1506
1507         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
1508         out parameters if the end of the method is unreachable.  Fixes
1509         #58098. 
1510
1511 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1512
1513         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
1514         Hari was right, why extra method.
1515
1516 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1517
1518         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
1519
1520 2004-05-20  Martin Baulig  <martin@ximian.com>
1521
1522         * delegate.cs: Convert this file to Unix mode - like the original
1523         version in mcs is.
1524
1525 2004-05-20  Martin Baulig  <martin@ximian.com>
1526
1527         * attribute.cs: Convert this file to Unix mode - like the original
1528         version in mcs is.
1529
1530 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
1531
1532        Fix bug #58688 (MCS does not report error when the same attribute
1533        is assigned twice)
1534
1535        * attribute.cs (Attribute.Emit): Distinction between null and default.
1536
1537 2004-05-19  Raja R Harinath  <rharinath@novell.com>
1538
1539        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
1540        of a top-level attribute without an attribute target.
1541        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
1542        Make non-static.
1543        (Attribute.Conditional_GetConditionName), 
1544        (Attribute.Obsolete_GetObsoleteMessage): Update.
1545        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
1546        part of ScanForIndexerName.
1547        (Attribute.CanIgnoreInvalidAttribute): New function.
1548        (Attribute.ScanForIndexerName): Move to ...
1549        (Attributes.ScanForIndexerName): ... here.
1550        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
1551        (Attributes.Search): New internal variant that can choose not to
1552        complain if types aren't resolved.  The original signature now
1553        complains.
1554        (Attributes.GetClsCompliantAttribute): Use internal variant, with
1555        complaints suppressed.
1556        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
1557        only if it not useful.
1558        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
1559        top-level for attributes that are shared between the assembly
1560        and a top-level class.
1561        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
1562        * class.cs: Update to reflect changes.
1563        (DefineIndexers): Fuse loops.
1564        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
1565        a couple more variants of attribute names.
1566
1567 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
1568
1569         Fix bug #52585 (Implemented explicit attribute declaration)
1570
1571         * attribute.cs:
1572         (Attributable.ValidAttributeTargets): New abstract method. It gets
1573         list of valid attribute targets for explicit target declaration.
1574         (Attribute.Target): It holds target itself.
1575         (AttributeSection): Removed.
1576         (Attribute.CheckTargets): New method. It checks whether attribute
1577         target is valid for the current element.
1578
1579         * class.cs:
1580         (EventProperty): New class. For events that are declared like
1581         property (with add and remove accessors).
1582         (EventField): New class. For events that are declared like field.
1583         class.cs
1584
1585         * cs-parser.jay: Implemented explicit attribute target declaration.
1586
1587         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
1588         Override ValidAttributeTargets.
1589
1590         * parameter.cs:
1591         (ReturnParameter): Class for applying custom attributes on 
1592         the return type.
1593         (ParameterAtribute): New class. Class for applying custom
1594         attributes on the parameter type.
1595
1596 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
1597
1598         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
1599         definitions. 
1600
1601         (Method): Allow UNSAFE here.
1602
1603         * modifiers.cs: Support unsafe reporting.
1604
1605 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
1606
1607         * decl.cs: Fix bug #58478.
1608
1609 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1610
1611         * statement.cs: When checking for unreachable code on an EmptyStatement,
1612         set the location. Fixes bug #58488.
1613
1614 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
1615
1616         * driver.cs: Add -pkg handling.
1617
1618         From Gonzalo: UseShelLExecute=false
1619
1620 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
1621
1622         * attribute.cs:
1623         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
1624         for attribute.
1625         (Attribute.IsClsCompliaceRequired): Moved to base for better
1626         accesibility.
1627         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
1628         when attribute is AttributeUsageAttribute.
1629         (Attribute.GetValidTargets): Simplified.
1630         (Attribute.GetAttributeUsage): New method returns AttributeUsage
1631         attribute for this type.
1632         (Attribute.ApplyAttributes): Method renamed to Emit and make
1633         non-static.
1634         (GlobalAttributeSection): New class for special handling of global
1635         attributes (assembly, module).
1636         (AttributeSection.Emit): New method.
1637
1638         * class.cs: Implemented Attributable abstract methods.
1639         (MethodCore.LabelParameters): Moved to Parameter class.
1640         (Accessor): Is back simple class.
1641         (PropertyMethod): Implemented Attributable abstract class.
1642         (DelegateMethod): Implemented Attributable abstract class.
1643         (Event): New constructor for disctintion between normal Event
1644         and Event with accessors.
1645
1646         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
1647
1648         * codegen.cs, const.cs, decl.cs, delegate.cs:
1649         (CommonAssemblyModulClass): Implemented Attributable abstract class
1650         and simplified.
1651
1652         * enum.cs: Implement IAttributeSupport interface.
1653         (EnumMember): New class for emum members. Implemented Attributable
1654         abstract class
1655
1656         * parameter.cs:
1657         (ParameterBase): Is abstract.
1658         (ReturnParameter): New class for easier [return:] attribute handling.
1659
1660         * typemanager.cs: Removed builder_to_attr.
1661
1662 2004-05-11  Raja R Harinath  <rharinath@novell.com>
1663
1664         Fix bug #57151.
1665         * attribute.cs (Attribute.GetPositionalValue): New function.
1666         * class.cs (TypeContainer.VerifyMembers): New function.
1667         (TypeContainer.Emit): Use it.
1668         (ClassOrStruct): New base class for Class and Struct.
1669         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
1670         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
1671         class.
1672         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
1673         then each non-static field should have a FieldOffset attribute.
1674         Otherwise, none of the fields should have a FieldOffset attribute.
1675         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
1676         and FieldOffset attributes.
1677         * typemanager.cs (TypeManager.struct_layout_attribute_type)
1678         (TypeManager.field_offset_attribute_type): New core types.
1679         (TypeManager.InitCoreTypes): Initialize them.
1680
1681 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
1682
1683         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
1684         Return correct type.
1685         From bug #58270.
1686
1687 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
1688
1689         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
1690         be implicitly converted to ulong.
1691         
1692         * expression.cs: The logic for allowing operator &, | and ^ worked
1693         was wrong, it worked before because we did not report an error in
1694         an else branch.  Fixes 57895.
1695
1696         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
1697         allow volatile fields to be reference types.
1698
1699 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
1700
1701         * driver.cs: Add support for /debug-
1702
1703 2004-05-07  Raja R Harinath  <rharinath@novell.com>
1704
1705         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
1706         Add a 'complain' parameter to silence errors.
1707         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
1708         silently overlooked type-resolutions.
1709         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
1710         to reflect changes.
1711         (Attributes.Search): New function.
1712         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
1713         (Attributes.GetAttributeFullName): Remove hack.
1714         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
1715         Update to reflect changes.
1716         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1717         Use Attributes.Search instead of nested loops.
1718
1719 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
1720
1721         * decl.cs:
1722         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
1723         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
1724         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
1725
1726         * report.cs: (Report.Warning): Renamed to Warning_T because of
1727         parameter collision.
1728
1729 2004-05-05  Raja R Harinath  <rharinath@novell.com>
1730
1731         * expression.cs (MemberAccess.ResolveMemberAccess):
1732         Exit with non-zero status after Report.Error.
1733         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
1734         Likewise.
1735         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
1736
1737 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
1738
1739         * support.cs: Don't hang when the file is empty.
1740
1741 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
1742
1743         * support.cs: In SeekableStreamReader, compute the preamble size of the
1744           underlying stream. Position changes should take into account that initial
1745           count of bytes.
1746
1747 2004-05-03  Todd Berman  <tberman@sevenl.net>
1748
1749         * driver.cs: remove unused GetSysVersion function.
1750
1751 2004-05-03  Todd Berman  <tberman@sevenl.net>
1752
1753         * driver.cs: Remove the hack from saturday, as well as the hack
1754         from jackson (LoadAssemblyFromGac), also adds the CWD to the
1755         link_paths to get that bit proper.
1756
1757 2004-05-01  Todd Berman  <tberman@sevenl.net>
1758
1759         * driver.cs: Try a LoadFrom before a Load, this checks the current
1760         path. This is currently a bug in mono that is be fixed, however, this
1761         provides a workaround for now. This will be removed when the bug
1762         is fixed.
1763
1764 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
1765
1766         * CryptoConvert.cs: Updated to latest version. Fix issue with 
1767         incomplete key pairs (#57941).
1768
1769 2004-05-01  Todd Berman  <tberman@sevenl.net>
1770
1771         * driver.cs: Remove '.' from path_chars, now System.* loads properly
1772         from the GAC
1773
1774 2004-04-30  Jackson Harper  <jackson@ximian.com>
1775
1776         * codegen.cs: Open keys readonly.
1777         
1778 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1779
1780         * typemanager.cs: don't report cyclic struct layout when a struct
1781         contains 2 or more fields of the same type. Failed for Pango.AttrShape
1782         which has 2 Pango.Rectangle fields.
1783
1784 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1785
1786         * expression.cs: Handle IntPtr comparisons with IL code
1787         rather than a method call.
1788
1789 2004-04-29  Martin Baulig  <martin@ximian.com>
1790
1791         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
1792         the list of PropertyInfo's in class hierarchy and find the
1793         accessor.  Fixes #56013.
1794
1795 2004-04-29  Martin Baulig  <martin@ximian.com>
1796
1797         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
1798
1799 2004-04-29  Martin Baulig  <martin@ximian.com>
1800
1801         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
1802
1803         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
1804
1805 2004-04-29  Martin Baulig  <martin@ximian.com>
1806
1807         * class.cs (ConstructorInitializer.Resolve): Check whether the
1808         parent .ctor is accessible.  Fixes #52146.
1809
1810 2004-04-29  Martin Baulig  <martin@ximian.com>
1811
1812         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
1813
1814         * statement.cs (Using.EmitLocalVariableDecls): Use
1815         TypeManager.idisposable_type, not typeof (IDisposable).
1816         (Foreach.EmitCollectionForeach): Added support for valuetypes.
1817
1818 2004-04-29  Martin Baulig  <martin@ximian.com>
1819
1820         * class.cs (Event.Define): Don't emit the field and don't set
1821         RTSpecialName and SpecialName for events on interfaces.  Fixes
1822         #57703. 
1823
1824 2004-04-29  Raja R Harinath  <rharinath@novell.com>
1825
1826         Refactor Attribute.ApplyAttributes.
1827         * attribute.cs (Attributable): New base class for objects that can
1828         have Attributes applied on them.
1829         (Attribute): Make AttributeUsage fields public.
1830         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
1831         (Attribute.IsInternalCall): New property.
1832         (Attribute.UsageAttr): Convert to a public read-only property.
1833         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
1834         (Attribute.ResolveType, Attribute.Resolve)
1835         (Attribute.ScanForIndexerName): Update to reflect changes.
1836         (Attribute.CheckAttributeTarget): Re-format.
1837         (Attribute.ApplyAttributes): Refactor, to various
1838         Attributable.ApplyAttributeBuilder methods.
1839         * decl.cs (MemberCore): Make Attributable.
1840         * class.cs (Accessor): Make Attributable.
1841         (MethodData.ApplyAttributes): Use proper attribute types, not
1842         attribute names.
1843         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
1844         (TypeContainer.ApplyAttributeBuilder)
1845         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
1846         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
1847         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
1848         (Operator.ApplyAttributeBuilder): New factored-out methods.
1849         * const.cs (Const.ApplyAttributeBuilder): Likewise.
1850         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
1851         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
1852         * parameter.cs (ParameterBase): New Attributable base class
1853         that can also represent Return types.
1854         (Parameter): Update to the changes.
1855
1856 2004-04-29  Jackson Harper  <jackson@ximian.com>
1857
1858         * driver.cs: Prefer the corlib system version when looking for
1859         assemblies in the GAC. This is still a hack, but its a better hack
1860         now.
1861         
1862 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
1863
1864         * decl.cs, enum.cs: Improved error 3005 reporting.
1865   
1866         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
1867         (related_symbols): New private member for list of symbols
1868         related to reported error/warning.
1869         
1870         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
1871
1872 2004-04-29  Martin Baulig  <martin@ximian.com>
1873
1874         * ecore.cs (Expression.Constantify): If we're an enum and
1875         TypeManager.TypeToCoreType() doesn't give us another type, use
1876         t.UnderlyingSystemType.  Fixes #56178.  
1877
1878 2004-04-29  Martin Baulig  <martin@ximian.com>
1879
1880         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
1881         interfaces and for each interface, only add members directly
1882         declared in that interface.  Fixes #53255.
1883
1884 2004-04-28  Martin Baulig  <martin@ximian.com>
1885
1886         * expression.cs (ConditionalLogicalOperator): Use a temporary
1887         variable for `left' to avoid that we evaluate it more than once;
1888         bug #52588.
1889
1890 2004-04-28  Martin Baulig  <martin@ximian.com>
1891
1892         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
1893         `void[]' (CS1547).
1894
1895 2004-04-28  Martin Baulig  <martin@ximian.com>
1896
1897         * statement.cs (LocalInfo.Resolve): Check whether the type is not
1898         void (CS1547).
1899
1900         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
1901         whether the type is not void (CS1547).
1902
1903 2004-04-28  Martin Baulig  <martin@ximian.com>
1904
1905         * expression.cs (Unary.DoResolveLValue): Override this and report
1906         CS0131 for anything but Operator.Indirection.
1907
1908 2004-04-28  Martin Baulig  <martin@ximian.com>
1909
1910         Committing a patch from Ben Maurer; see bug #50820.
1911
1912         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
1913         check for classes.
1914
1915         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
1916         classes.        
1917
1918 2004-04-28  Martin Baulig  <martin@ximian.com>
1919
1920         Committing a patch from Ben Maurer; see bug #50820.
1921
1922         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
1923         check for classes.
1924
1925         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
1926         classes.        
1927
1928 2004-04-28  Martin Baulig  <martin@ximian.com>
1929
1930         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
1931         (Block.AddLabel): Call DoLookupLabel() to only search in the
1932         current block.
1933
1934 2004-04-28  Martin Baulig  <martin@ximian.com>
1935
1936         * cfold.cs (ConstantFold.BinaryFold): Added special support for
1937         comparing StringConstants and NullLiterals in Equality and Inequality.
1938
1939 2004-04-28  Jackson Harper  <jackson@ximian.com>
1940
1941         * driver.cs: Attempt to load referenced assemblies from the
1942         GAC. This is the quick and dirty version of this method that
1943         doesnt take into account versions and just takes the first
1944         canidate found. Will be good enough for now as we will not have more
1945         then one version installed into the GAC until I update this method.
1946
1947 2004-04-28  Martin Baulig  <martin@ximian.com>
1948
1949         * typemanager.cs (TypeManager.CheckStructCycles): New public
1950         static method to check for cycles in the struct layout.
1951
1952         * rootcontext.cs (RootContext.PopulateTypes): Call
1953         TypeManager.CheckStructCycles() for each TypeContainer.
1954         [Note: We only need to visit each type once.]
1955
1956 2004-04-28  Martin Baulig  <martin@ximian.com>
1957
1958         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
1959
1960         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
1961         success and added `out object value'.  Use a `bool resolved' field
1962         to check whether we've already been called rather than
1963         `ConstantValue != null' since this breaks for NullLiterals.
1964
1965 2004-04-28  Raja R Harinath  <rharinath@novell.com>
1966
1967         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
1968         setting of this flag, since the 'set' method may be non-public.
1969
1970 2004-04-28  Raja R Harinath  <rharinath@novell.com>
1971
1972         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
1973         check on current_vector.Block.
1974
1975 2004-04-27  Martin Baulig  <martin@ximian.com>
1976
1977         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
1978         a field initializer.  Fixes #56459.
1979
1980 2004-04-27  Martin Baulig  <martin@ximian.com>
1981
1982         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
1983         we're not attempting to use an indexer.  Fixes #52154.
1984
1985 2004-04-27  Martin Baulig  <martin@ximian.com>
1986
1987         * statement.cs (Return): Don't create a return label if we don't
1988         need it; reverts my change from January 20th.  Thanks to Ben
1989         Maurer for this.
1990
1991 2004-04-27  Martin Baulig  <martin@ximian.com>
1992
1993         According to the spec, `goto' can only leave a nested scope, but
1994         never enter it.
1995
1996         * statement.cs (Block.LookupLabel): Only lookup in the current
1997         block, don't recurse into parent or child blocks.
1998         (Block.AddLabel): Check in parent and child blocks, report
1999         CS0140/CS0158 if we find a duplicate.
2000         (Block): Removed this indexer for label lookups.
2001         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
2002         this already does the error reporting for us.
2003
2004         * flowanalysis.cs
2005         (FlowBranching.UsageVector.Block): New public variable; may be null.
2006         (FlowBranching.CreateSibling): Added `Block' argument.
2007         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
2008         label for the target of a `goto' and check whether we're not
2009         leaving a `finally'.
2010
2011 2004-04-27  Martin Baulig  <martin@ximian.com>
2012
2013         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2014         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
2015         just for returns).
2016
2017 2004-04-27  Martin Baulig  <martin@ximian.com>
2018
2019         * statement.cs (Block.AddLabel): Also check for implicit blocks
2020         and added a CS0158 check.
2021
2022 2004-04-27  Martin Baulig  <martin@ximian.com>
2023
2024         * flowanalysis.cs (FlowBranchingLoop): New class.
2025         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
2026         UsageVector's instead of an ArrayList.
2027         (FlowBranching.Label): Likewise.
2028         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
2029         (FlowBranching.AddBreakVector): New method.
2030
2031 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
2032
2033         * attribute.cs: Small regression fix: only convert the type if we
2034         the type is different, fixes System.Drawing build.
2035
2036 2004-04-27  Martin Baulig  <martin@ximian.com>
2037
2038         * attribute.cs (Attribute.Resolve): If we have a constant value
2039         for a named field or property, implicity convert it to the correct
2040         type.
2041
2042 2004-04-27  Raja R Harinath  <rharinath@novell.com>
2043
2044         * statement.cs (Block.Block): Implicit blocks share
2045         'child_variable_names' fields with parent blocks.
2046         (Block.AddChildVariableNames): Remove.
2047         (Block.AddVariable): Mark variable as "used by a child block" in
2048         every surrounding block.
2049         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
2050         been used in a child block, complain about violation of "Invariant
2051         meaning in blocks" rule.
2052         * cs-parser.jay (declare_local_variables): Don't use
2053         AddChildVariableNames.
2054         (foreach_statement): Don't create an implicit block: 'foreach'
2055         introduces a scope.
2056
2057 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
2058
2059         * convert.cs (ImplicitNumericConversion): 0 is also positive when
2060         converting from 0L to ulong.  Fixes 57522.
2061
2062 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2063
2064         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
2065         derived class hides via 'new' keyword field from base class (test-242.cs).
2066         TODO: Handle this in the more general way.
2067         
2068         * class.cs (CheckBase): Ditto.
2069
2070 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2071
2072         * decl.cs (caching_flags): New member for storing cached values
2073         as bit flags.
2074         (MemberCore.Flags): New enum where bit flags for caching_flags
2075         are defined.
2076         (MemberCore.cls_compliance): Moved to caching_flags.
2077         (DeclSpace.Created): Moved to caching_flags.
2078
2079         * class.cs: Use caching_flags instead of DeclSpace.Created
2080         
2081 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
2082
2083         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
2084         if we are only a derived class, not a nested class.
2085
2086         * typemanager.cs: Same as above, but do this at the MemberLookup
2087         level (used by field and methods, properties are handled in
2088         PropertyExpr).   Allow for the qualified access if we are a nested
2089         method. 
2090
2091 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
2092
2093         * class.cs: Refactoring.
2094         (IMethodData): New inteface; Holds links to parent members
2095         to avoid member duplication (reduced memory allocation).
2096         (Method): Implemented IMethodData interface.
2097         (PropertyBase): New inner classes for get/set methods.
2098         (PropertyBase.PropertyMethod): Implemented IMethodData interface
2099         (Event): New inner classes for add/remove methods.
2100         (Event.DelegateMethod): Implemented IMethodData interface.
2101
2102         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
2103         EmitContext (related to class.cs refactoring).
2104
2105 2004-04-21  Raja R Harinath  <rharinath@novell.com>
2106
2107         * delegate.cs (Delegate.VerifyApplicability): If the number of
2108         arguments are the same as the number of parameters, first try to
2109         verify applicability ignoring  any 'params' modifier on the last
2110         parameter.
2111         Fixes #56442.
2112
2113 2004-04-08  Martin Baulig  <martin@ximian.com>
2114
2115         Merged latest changes into gmcs.  Please keep this comment in
2116         here, it makes it easier for me to see what changed in MCS since
2117         the last time I merged.
2118
2119 2004-04-16  Raja R Harinath  <rharinath@novell.com>
2120
2121         * class.cs (TypeContainer.AddIndexer): Use
2122         'ExplicitInterfaceName' to determine if interface name was
2123         explicitly specified.  'InterfaceType' is not initialized at this time.
2124         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
2125         Indexers array is already in the required order.  Initialize
2126         'IndexerName' only if there are normal indexers.
2127         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
2128         (TypeContainer.Emit): Emit DefaultMember attribute only if
2129         IndexerName is initialized.
2130         Fixes #56300.
2131
2132 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
2133
2134         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
2135         Fixes #57007
2136
2137 2004-04-15  Raja R Harinath  <rharinath@novell.com>
2138
2139         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
2140         attributes.
2141         Fix for #56456.
2142
2143         * attribute.cs (Attribute.Resolve): Check for duplicate named
2144         attributes.
2145         Fix for #56463.
2146
2147 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
2148
2149         * iterators.cs (MarkYield): track whether we are in an exception,
2150         and generate code accordingly.  Use a temporary value to store the
2151         result for our state.
2152
2153         I had ignored a bit the interaction of try/catch with iterators
2154         since their behavior was not entirely obvious, but now it is
2155         possible to verify that our behavior is the same as MS .NET 2.0
2156
2157         Fixes 54814
2158
2159 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
2160
2161         * iterators.cs: Avoid creating temporaries if there is no work to
2162         do. 
2163
2164         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
2165         Enumerations, use TypeManager.EnumToUnderlying and call
2166         recursively. 
2167
2168         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
2169         bug #57013
2170
2171         (This.Emit): Use EmitContext.EmitThis to emit our
2172         instance variable.
2173
2174         (This.EmitAssign): Ditto.
2175
2176         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
2177         codepaths, we will move all the functionality into
2178         Mono.CSharp.This 
2179
2180         (FieldExpr.EmitAssign): Ditto.
2181
2182         This fixes several hidden bugs that I uncovered while doing a code
2183         review of this today.
2184
2185         * codegen.cs (EmitThis): reworked so the semantics are more clear
2186         and also support value types "this" instances.
2187
2188         * iterators.cs: Changed so that for iterators in value types, we
2189         do not pass the value type as a parameter.  
2190
2191         Initialization of the enumerator helpers is now done in the caller
2192         instead of passing the parameters to the constructors and having
2193         the constructor set the fields.
2194
2195         The fields have now `assembly' visibility instead of private.
2196
2197 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
2198
2199         * expression.cs (Argument.Resolve): Check if fields passed as ref
2200         or out are contained in a MarshalByRefObject.
2201
2202         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
2203         another compiler type.
2204
2205 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2206
2207         * class.cs (Indexer.Define): use the new name checking method.
2208         Also, return false on an error.
2209         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
2210         (is_identifier_[start/part]_character): make static.
2211
2212 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
2213
2214         * expression.cs (Binary.ResolveOperator): Do no append strings
2215         twice: since we can be invoked more than once (array evaluation)
2216         on the same concatenation, take care of this here.  Based on a fix
2217         from Ben (bug #56454)
2218
2219 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
2220
2221         * codegen.cs: Fix another case where CS1548 must be reported (when 
2222         delay-sign isn't specified and no private is available #56564). Fix
2223         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
2224         error when MCS is used on the MS runtime and we need to delay-sign 
2225         (which seems unsupported by AssemblyBuilder - see #56621).
2226
2227 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
2228
2229         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
2230         (TypeManager.ComputeNamespaces): Faster implementation for
2231         Microsoft runtime.
2232
2233         * compiler.csproj: Updated AssemblyName to mcs.
2234
2235 2004-05-11  Jackson Harper  <jackson@ximian.com>
2236
2237         * Makefile: Preserve MONO_PATH
2238         
2239 2004-05-11  Jackson Harper  <jackson@ximian.com>
2240
2241         * Makefile: Use mono and mcs to build gmcs
2242         
2243 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
2244
2245         * codegen.cs: Add patch from Robert Shade
2246         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
2247         sync with mcs.
2248
2249 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
2250
2251         * CryptoConvert.cs: Updated to latest version. Fix issue with 
2252         incomplete key pairs (#57941).
2253
2254 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
2255
2256         * codegen.cs: Fix another case where CS1548 must be reported (when 
2257         delay-sign isn't specified and no private is available #56564). Fix
2258         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
2259         error when MCS is used on the MS runtime and we need to delay-sign 
2260         (which seems unsupported by AssemblyBuilder - see #56621).
2261
2262 2004-04-29  Jackson Harper  <jackson@ximian.com>
2263
2264         * Makefile: Set MONO_PATH to use the bootstrap corlib
2265         * driver.cs: Check the GAC for referenced assemblies.
2266                 
2267 2004-04-29  Martin Baulig  <martin@ximian.com>
2268
2269         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
2270
2271 2004-04-07  Martin Baulig  <martin@ximian.com>
2272
2273         * expression.cs (Binary.ResolveOperator): Added special case for
2274         Equality/Inequality between a type parameter and a null literal.
2275
2276 2004-04-07  Martin Baulig  <martin@ximian.com>
2277
2278         * convert.cs: Check null literal -> type parameter conversions.
2279
2280 2004-04-07  Martin Baulig  <martin@ximian.com>
2281
2282         * generic.cs (ConstructedType.CheckConstraints): Enforce the
2283         `class' and `struct' constraints.
2284
2285 2004-04-07  Martin Baulig  <martin@ximian.com>
2286
2287         * generic.cs (SpecialConstraint): New public enum.
2288         (Constraints.Resolve): Added support for the `class' and `struct'
2289         constraints.
2290
2291         * cs-parser.jay (type_parameter_constraint): Added support for the
2292         `class' and `struct' constraints.
2293
2294 2004-04-07  Martin Baulig  <martin@ximian.com>
2295
2296         * support.cs (GenericConstraints): Replaced `Types' by
2297         `ClassConstraint' and `InterfaceConstraints'; added
2298         `HasClassConstraint'.   
2299
2300 2004-04-07  Martin Baulig  <martin@ximian.com>
2301
2302         * generic.cs
2303         (Constraints.InterfaceConstraints): New public property.
2304         (Constraints.Types): Make this property public
2305         (TypeParameter): Implement IMemberContainer.
2306         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
2307         instead of a TypeBuilder/MethodBuilder; pass the interface
2308         constraints to TypeManager.AddTypeParameter().
2309         (TypeParameter.DefineType): Just take an EmitContext and no
2310         TypeBuilder/MethodBuilder.  Use the new public API.
2311
2312         * typemanager.cs (TypeManager.AddTypeParameter): Added
2313         `TypeExpr[]' argument; add the interfaces to the
2314         `builder_to_ifaces' hash.
2315         (TypeManager.LookupMemberContainer): For
2316         GenericTypeParameterBuilders, get the TypeParameter from the
2317         `builder_to_type_param'.
2318         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
2319         the TypeParameter and call FindMembers on it.
2320
2321 2004-04-07  Martin Baulig  <martin@ximian.com>
2322
2323         * class.cs
2324         (MethodCore.GenericMethod): Moved this field here from Method.
2325         (MethodCore.IsDuplicateImplementation): Take the number of type
2326         parameters into account if we're a generic method.
2327
2328         * expression.cs (Invocation.InferTypeArguments): Don't return true
2329         if `arguments' is null; we still need to check whether we actually
2330         don't need to infer anything in this case.
2331         (MemberAccess): Merged the functionality from GenericMemberAccess
2332         into this class.
2333
2334         * generic.cs (GenericMemberAccess): Removed.
2335
2336 2004-04-05  Martin Baulig  <martin@ximian.com>
2337
2338         * decl.cs (MemberCore): For generic classes, interfaces and
2339         structs, `Name' now includes the number of type parameters
2340         ("Stack!1.Node!1").
2341         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
2342         encode the number of type arguments in the type name.
2343
2344         * expression.cs (Expression.MemberLookup): Removed the
2345         `num_type_args' argument; we now encode the number of type
2346         arguments in the type name.
2347
2348         * ecore.cs (SimpleName): Encode the number of type arguments in
2349         the type name itself.
2350
2351         * generic.cs (ConstructedType): Likewise.
2352
2353         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
2354         `MemberName'; we now include the number of type parameters in the
2355         type name.
2356
2357         * typemanager.cs (TypeManager.CheckGeneric): Removed.
2358         (TypeManager.MemberLookup): Removed the
2359         `num_type_args' argument; we now encode the number of type
2360         arguments in the type name.     
2361
2362 2004-04-03  Martin Baulig  <martin@ximian.com>
2363
2364         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
2365         (MemberCore.MemberName): Moved here from MemberBase.
2366         (DeclSpace.SetParameterInfo): Just take the constraints as an
2367         ArrayList; we already have the type parameters in our
2368         `MemberName'; also do the CS0080 reporting here.
2369
2370         * cs-parser.jay (struct_declaration): Use `member_name' instead of
2371         `IDENTIFIER opt_type_parameter_list'; when constructing our
2372         `MemberName', it'll already include our type parameters.
2373         (class_declaration, interface_declaration): Likewise.
2374         (delegate_declaration): Likewise.
2375         (MakeName): Take a MemberName and return a MemberName.
2376         The following two changes are required to avoid shift/reduce conflicts:
2377         (member_name): Don't include a TypeName anymore; ie. this is now
2378         just 'IDENTIFIER opt_type_parameter_list'.
2379         (property_declaration, event_declaration): Use a
2380         `namespace_or_type_name' instead of a `member_name'.            
2381
2382 2004-04-03  Martin Baulig  <martin@ximian.com>
2383
2384         * decl.cs (MemberName): Renamed to `TypeName' and created a new
2385         `MemberName' class.
2386         (TypeName): Formerly known as MemberName.
2387
2388         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
2389         instead of a `MemberName'.
2390
2391         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
2392         (member_name): New rule; create a MemberName.
2393
2394 2004-04-02  Martin Baulig  <martin@ximian.com>
2395
2396         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
2397         (CS0305 and CS0308).
2398
2399 2004-04-02  Martin Baulig  <martin@ximian.com>
2400
2401         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
2402         support for nested types.
2403
2404 2004-04-02  Martin Baulig  <martin@ximian.com>
2405
2406         * ecore.cs (IAlias): New public interface.
2407         (TypeExpr, TypeExpression): Implement IAlias.
2408         (TypeAliasExpression): New public class.
2409
2410         * namespace.cs (Namespace): Implement IAlias.
2411         (Namespace.Lookup): Return an IAlias instead on an object.
2412         (Namespace.DefineName): Take an IAlias instead of an object.
2413         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
2414         an object.
2415         (NamespaceEntry.UsingAlias): Take a Membername instead of an
2416         Expression.
2417         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
2418         object.
2419         (NamespaceEntry.Lookup): Likewise.
2420
2421         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
2422         instead of a Type.      
2423
2424         * decl.cs (DeclSpace): Implement IAlias.
2425         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
2426
2427         * generic.cs (ConstructedType): Improved error checking.
2428
2429 2004-04-02  Martin Baulig  <martin@ximian.com>
2430
2431         * convert.cs: Added type parameter conversions.
2432
2433         * ecore.cs
2434         (UnboxCast.Emit): Emit an `unbox.any' for type params.
2435         (ClassCast.Emit): If the source type is a type parameter, box it.
2436         If the target type is a type parameter, emit an `unbox.any'
2437         instead of a `classcast'.1      
2438
2439 2004-04-01  Martin Baulig  <martin@ximian.com>
2440
2441         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
2442
2443 2004-04-01  Martin Baulig  <martin@ximian.com>
2444
2445         * generic.cs (ConstructedType.CheckConstraints): Use
2446         Convert.ImplicitStandardConversionExists(); user-defined implicit
2447         conversions are not allowed according to the spec.
2448
2449 2004-03-30  Martin Baulig  <martin@ximian.com>
2450
2451         * expression.cs (New): Added support for type parameters.
2452
2453         * typemanager.cs
2454         (TypeManager.activator_type): New public static field.
2455         (TypeManager.activator_create_instance): Likewise.
2456
2457 2004-03-30  Martin Baulig  <martin@ximian.com>
2458
2459         * typemanager.cs (TypeManager.HasConstructorConstraint): New
2460         public method.
2461
2462 2004-03-30  Martin Baulig  <martin@ximian.com>
2463
2464         * generic.cs (ConstructedType.CheckConstraints): Actually follow
2465         the spec here: the argument type must be convertible to the
2466         constraints.
2467
2468 2004-03-30  Martin Baulig  <martin@ximian.com>
2469
2470         * generic.cs
2471         (TypeParameter.Define, TypeParameter.DefineMethod): Call
2472         TypeManager.AddTypeParameter().
2473         (ConstructedType.CheckConstraints): Re-enable this and actually
2474         check whether we have a constructor constraint.
2475
2476         * typemanager.cs
2477         (TypeManager.builder_to_type_param): New static field.
2478         (TypeManager.AddTypeParameter): New static method.
2479         (TypeManager.LookupTypeParameter): New public method.
2480
2481 2004-03-30  Martin Baulig  <martin@ximian.com>
2482
2483         * generic.cs (TypeParameter.DefineType): Return a boolean and use
2484         the new API to actually define the constructor constraint.
2485
2486         * typemanager.cs
2487         (TypeManager.new_constraint_attr_type): New static field.
2488         (TypeManager.InitCoreTypes): Initialize it.
2489
2490 2004-03-30  Martin Baulig  <martin@ximian.com>
2491
2492         * generic.cs (Constraints): Completed error checking, use correct
2493         error numbers.
2494
2495 2004-03-29  Martin Baulig  <martin@ximian.com>
2496
2497         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
2498
2499         * expression.cs (Invocation.InferTypeArguments): Added overloaded
2500         public version which takes a `ParameterData pd' instead of an
2501         `ArrayList args'.
2502
2503 2004-03-29  Martin Baulig  <martin@ximian.com>
2504
2505         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
2506         not a MethodInfo.       
2507
2508 2004-03-29  Martin Baulig  <martin@ximian.com>
2509
2510         * expression.cs (Argument.ResolveMethodGroup): If we're a
2511         ConstructedType, call GetMemberAccess() on it.  
2512
2513 2004-03-29  Martin Baulig  <martin@ximian.com>
2514
2515         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
2516         (MethodCore.CheckGenericOverride): When overriding a generic
2517         method, check whether the constraints match.
2518
2519         * support.cs (GenericConstraints): New public interface.
2520         (ParameterData.GenericConstraints): New public method.
2521
2522         * parameter.cs (Parameter.Resolve): Check whether we're a generic
2523         method parameter and compute our constraints if appropriate.
2524         (Parameter.GenericConstraints): New public property.
2525
2526         * generic.cs (Constraints): Implement GenericConstraints.
2527
2528 2004-03-29  Martin Baulig  <martin@ximian.com>
2529
2530         * decl.cs (MemberCache.FindMemberToOverride): Use
2531         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
2532
2533 2004-03-29  Martin Baulig  <martin@ximian.com>
2534
2535         * generic.cs (GenericMethod.Define): Resolve our type parameters.
2536
2537 2004-03-29  Martin Baulig  <martin@ximian.com>
2538
2539         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
2540         not allowed on non-generic declarations").
2541
2542 2004-03-29  Martin Baulig  <martin@ximian.com>
2543
2544         * expression.cs (Invocation.InferTypeArguments): Added overloaded
2545         public version of this method.
2546
2547         * class.cs (MethodCore.IsDuplicateImplementation): Use
2548         Invocation.InferTypeArguments() to check this.
2549
2550 2004-03-29  Martin Baulig  <martin@ximian.com>
2551
2552         * convert.cs: Use TypeManager.IsDelegateType() instead of
2553         comparing types correctly.
2554
2555 2004-03-29  Martin Baulig  <martin@ximian.com>
2556
2557         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
2558         types directly to make it work for generic instances.
2559
2560         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
2561
2562 2004-03-29  Martin Baulig  <martin@ximian.com>
2563
2564         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
2565         support for arrays.     
2566
2567 2004-03-24  Martin Baulig  <martin@ximian.com>
2568
2569         * decl.cs (DeclSpace.FindType): Also use
2570         TypeManager.CheckGeneric() for types from the using clauses.
2571
2572 2004-03-23  Martin Baulig  <martin@ximian.com>
2573
2574         * expression.cs (Invocation.OverloadResolve): Added `bool
2575         may_fail' argument and use it instead of the Location.IsNull() hack.
2576
2577 2004-03-23  Martin Baulig  <martin@ximian.com>
2578
2579         * expression.cs (Invocation.InferType): Use correct type inference
2580         rules here.     
2581
2582 2004-03-23  Martin Baulig  <martin@ximian.com>
2583
2584         * ecore.cs (MethodGroupExpr.Name): Use
2585         TypeManager.CSharpSignature() instead of just the name.
2586
2587         * expression.cs (Invocation.OverloadResolve): Provide better error
2588         reporting.
2589         (Invocation.DoResolve): OverloadResolve() never returns null
2590         without reporting an error, so removed the error -6 reporting here.
2591
2592 2004-03-23  Martin Baulig  <martin@ximian.com>
2593
2594         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
2595         generic methods.
2596
2597         * cs-parser.jay (delegate_declaration): Support generic delegates.
2598
2599         * delegate.cs: Support generic delegates.
2600
2601 2004-03-22  Martin Baulig  <martin@ximian.com>
2602
2603         * expression.cs (Invocation.InferParamsTypeArguments): New static
2604         method; does type inference for params arguments.
2605
2606 2004-03-21  Martin Baulig  <martin@ximian.com>
2607
2608         * typemanager.cs (TypeManager.IsGenericMethod): New public static
2609         method; checks whether a method is a generic method.    
2610
2611         * expression.cs (Invocation.InferTypeArguments): New static method;
2612         infer type arguments for generic method invocation.
2613
2614         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
2615         property; we set this to true if we're resolving a generic method
2616         invocation and the user specified type arguments, ie. we're not
2617         doing type inference.
2618
2619 2004-03-20  Martin Baulig  <martin@ximian.com>
2620
2621         * class.cs (MethodData.DeclaringType): New public property.
2622         (MethodData.Define): Set DeclaringType here.
2623         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
2624         instead of OperatorMethodBuilder.DeclaringType.
2625
2626 2004-03-20  Martin Baulig  <martin@ximian.com>
2627
2628         * cs-tokenizer.cs (xtoken): Return a special
2629         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
2630
2631         * cs-parser.jay (default_value_expression): Switch to the new
2632         syntax (14.5.13).
2633
2634 2004-03-19  Martin Baulig  <martin@ximian.com>
2635
2636         * decl.cs (MemberName): New class.  We use this to "construct"
2637         namespace_or_type_name's.
2638
2639         * generics.cs (TypeArguments.GetDeclarations): New public method;
2640         returns the type arguments as a string[] and reports a CS0081 if
2641         one of them is not an identifier.
2642
2643         * class.cs (MemberBase): The .ctor now takes the name as a
2644         MemberName instead of a string.
2645         (MemberBase.ExplicitInterfaceName): Changed type from string to
2646         Expression.
2647         (MemberBase.DoDefine): If we're an explicit implementation, the
2648         InterfaceType may be a generic instance.
2649
2650         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
2651         (namespace_name): Call MemberName.GetName () to transform the
2652         MemberName into a string and ensure we don't have any type
2653         arguments.
2654         (type_name): Call MemberName.GetTypeExpression() to transfrom the
2655         MemberName into an expression.
2656         (method_header): Use namespace_or_type_name instead of member_name.     
2657
2658 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
2659
2660         * rootcontext.cs: Add new types to the boot resolution.
2661
2662         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
2663         MulticastDelegate is not allowed.
2664
2665         * typemanager.cs: Add new types to lookup: System.TypedReference
2666         and ArgIterator.
2667
2668         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
2669         check for TypedReference or ArgIterator, they are not allowed. 
2670
2671         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
2672         makes us properly catch 1510 in some conditions (see bug 56016 for
2673         details). 
2674
2675 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
2676
2677         * CryptoConvert.cs: update from corlib version
2678         with endian fixes.
2679
2680 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
2681
2682         * class.cs (Indexer.Define): Check indexername declaration
2683
2684 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
2685
2686         * attribute.cs (IsClsCompliant): Fixed problem with handling
2687         all three states (compliant, not-compliant, undetected).
2688
2689 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
2690
2691         * attribute.cs (Attribute): Location is now public.
2692         (Resolve): Store resolved arguments (pos_values) in attribute class.
2693         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
2694         (GetClsCompliantAttributeValue): New method that gets
2695         CLSCompliantAttribute value.
2696         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
2697         if exists else null.
2698         (AttributeTester): New class for CLS-Compliant verification routines.
2699
2700         * class.cs (Emit): Add CLS-Compliant verification.
2701         (Method.GetSignatureForError): Implemented.
2702         (Constructor.GetSignatureForError): Implemented
2703         (Constructor.HasCompliantArgs): Returns if constructor has
2704         CLS-Compliant arguments.
2705         (Constructor.Emit): Override.
2706         (Construcor.IsIdentifierClsCompliant): New method; For constructors
2707         is needed to test only parameters.
2708         (FieldBase.GetSignatureForError): Implemented.
2709         (TypeContainer): New member for storing base interfaces.
2710         (TypeContainer.FindMembers): Search in base interfaces too.
2711
2712         * codegen.cs (GetClsComplianceAttribute): New method that gets
2713         assembly or module CLSCompliantAttribute value.
2714         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
2715         for assembly.
2716         (ModuleClass.Emit): Add error 3012 test.
2717
2718         * const.cs (Emit): Override and call base for CLS-Compliant tests.
2719
2720         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
2721         state for all decl types.
2722         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
2723         if CLS-Compliant tests are required.
2724         (IsClsCompliaceRequired): New method. Analyze whether code
2725         must be CLS-Compliant.
2726         (IsExposedFromAssembly): New method. Returns true when MemberCore
2727         is exposed from assembly.
2728         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
2729         value or gets cached value.
2730         (HasClsCompliantAttribute): New method. Returns true if MemberCore
2731         is explicitly marked with CLSCompliantAttribute.
2732         (IsIdentifierClsCompliant): New abstract method. This method is
2733         used to testing error 3005.
2734         (IsIdentifierAndParamClsCompliant): New method. Common helper method
2735         for identifier and parameters CLS-Compliant testing.
2736         (VerifyClsCompliance): New method. The main virtual method for
2737         CLS-Compliant verifications.
2738         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
2739         null. I don't know why is null (too many public members !).
2740         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
2741         and get value of first CLSCompliantAttribute that found.
2742
2743         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
2744         (VerifyClsCompliance): Override and add extra tests.
2745
2746         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
2747         clscheck- disable CLS-Compliant verification event if assembly is has
2748         CLSCompliantAttribute(true).
2749
2750         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
2751         ApllyAttribute is now called in emit section as in the other cases.
2752         Possible future Emit integration.
2753         (IsIdentifierClsCompliant): New override.
2754         (VerifyClsCompliance): New override.
2755         (GetEnumeratorName): Returns full enum name.
2756
2757         * parameter.cs (GetSignatureForError): Implemented.
2758
2759         * report.cs (WarningData): New struct for Warning message information.
2760         (LocationOfPreviousError): New method.
2761         (Warning): New method. Reports warning based on the warning table.
2762         (Error_T): New method. Reports error based on the error table.
2763
2764         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
2765         verifications are done here.
2766
2767         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
2768
2769         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
2770         CLSCompliantAttribute.
2771         (all_imported_types): New member holds all imported types from other
2772         assemblies.
2773         (LoadAllImportedTypes): New method fills static table with exported types
2774         from all referenced assemblies.
2775         (Modules): New property returns all assembly modules.
2776
2777 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
2778
2779         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
2780         throwing a parser error.
2781
2782         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
2783         which removes the hardcoded get_/set_ prefixes for properties, as
2784         IL allows for the properties to be named something else.  
2785
2786         Bug #56013
2787
2788         * expression.cs: Do not override operand before we know if it is
2789         non-null.  Fix 56207
2790
2791 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2792
2793         * typemanager.cs: support for pinned variables.
2794
2795 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2796
2797         * decl.cs, typemanager.cs: Avoid using an arraylist
2798         as a buffer if there is only one result set.
2799
2800 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2801
2802         * expression.cs: Make sure you cant call a static method
2803         with an instance expression, bug #56174.
2804
2805 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
2806
2807         * class.cs (IsDuplicateImplementation): Improve error reporting to
2808         flag 663 (method only differs in parameter modifier).
2809
2810         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
2811         in preprocessor directives.
2812
2813         * location.cs (LookupFile): Allow for the empty path.
2814
2815         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
2816         better approach for some of that patch, but its failing with the
2817         CharSet enumeration.  For now try/catch will do.
2818
2819         * typemanager.cs: Do not crash if a struct does not have fields.
2820         Fixes 56150.
2821
2822 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2823
2824         * expression.cs: cs0213, cant fix a fixed expression.
2825         fixes 50231.
2826
2827 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2828
2829         * cs-parser.jay: detect invalid embeded statements gracefully.
2830         bug #51113.
2831
2832 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2833
2834         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
2835         As a regex:
2836         s/
2837         the invocation type may not be a subclass of the tye of the item/
2838         The type of the item must be a subclass of the invocation item.
2839         /g
2840
2841         Fixes bug #50820.
2842
2843 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
2844
2845         * attribute.cs: Added methods to get a string and a bool from an
2846         attribute. Required to information from AssemblyKeyFileAttribute,
2847         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
2848         * codegen.cs: Modified AssemblyName creation to include support for
2849         strongnames. Catch additional exceptions to report them as CS1548.
2850         * compiler.csproj: Updated include CryptoConvert.cs.
2851         * compiler.csproj.user: Removed file - user specific configuration.
2852         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
2853         Mono.Security assembly. The original class is maintained and tested in
2854         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
2855         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
2856         like CSC 8.0 (C# v2) supports.
2857         * Makefile: Added CryptoConvert.cs to mcs sources.
2858         * rootcontext.cs: Added new options for strongnames.
2859
2860 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
2861
2862         * driver.cs: For --expect-error, report error code `2'
2863         if the program compiled with no errors, error code `1' if
2864         it compiled with an error other than the one expected.
2865
2866 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
2867
2868         * compiler.csproj: Updated for Visual Studio .NET 2003.
2869         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
2870         * compiler.sln: Updated for Visual Studio .NET 2003.
2871
2872 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
2873
2874         * expression.cs: Fix bug #47234. We basically need to apply the
2875         rule that we prefer the conversion of null to a reference type
2876         when faced with a conversion to 'object' (csc behaviour).
2877
2878 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2879
2880         * statement.cs: Shorter form for foreach, eliminates
2881         a local variable. r=Martin.
2882
2883 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2884
2885         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
2886         checks if we can use brtrue/brfalse to test for 0.
2887         * expression.cs: use the above in the test for using brtrue/brfalse.
2888         cleanup code a bit.
2889
2890 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2891
2892         * expression.cs: Rewrite string concat stuff. Benefits:
2893
2894         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
2895         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
2896         rather than a concat chain.
2897
2898         * typemanager.cs: Add lookups for more concat overloads.
2899
2900 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2901
2902         * expression.cs: Emit shorter il code for array init.
2903
2904         newarr
2905         dup
2906         // set 1
2907
2908         // set 2
2909
2910         newarr
2911         stloc.x
2912
2913         ldloc.x
2914         // set 1
2915
2916         ldloc.x
2917         // set 2
2918
2919 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
2920
2921         * statement.cs: Before, two switch blocks would be merged if the
2922         total size of the blocks (end_item - begin_item + 1) was less than
2923         two times the combined sizes of the blocks.
2924
2925         Now, it will only merge if after the merge at least half of the
2926         slots are filled.
2927
2928         fixes 55885.
2929
2930 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
2931
2932         * class.cs : csc build fix for GetMethods(). See bug #52503.
2933
2934 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
2935
2936         * expression.cs: Make sure fp comparisons work with NaN.
2937         This fixes bug #54303. Mig approved this patch a long
2938         time ago, but we were not able to test b/c the runtime
2939         had a related bug.
2940
2941 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
2942
2943         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
2944
2945 2004-03-19  Martin Baulig  <martin@ximian.com>
2946
2947         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
2948         two overloads may unify for some type parameter substitutions and
2949         report a CS0408 if appropriate.
2950
2951 2004-03-19  Martin Baulig  <martin@ximian.com>
2952
2953         * class.cs (MemberCore.IsDuplicateImplementation): Report the
2954         error here and not in our caller.
2955
2956 2004-03-19  Martin Baulig  <martin@ximian.com>
2957
2958         * interface.cs: Completely killed this file.
2959         (Interface): We're now a TypeContainer and live in class.cs.
2960
2961         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
2962         argument; we're now also called for interfaces.
2963         (TypeContainer.DefineMembers): Allow this method being called
2964         multiple times.
2965         (TypeContainer.GetMethods): New public method; formerly known as
2966         Interface.GetMethod().  This is used by PendingImplementation.
2967         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
2968         it's now private and non-static.
2969         (Interface): Moved this here; it's now implemented similar to
2970         Class and Struct.
2971         (Method, Property, Event, Indexer): Added `bool is_interface'
2972         argument to their .ctor's.
2973         (MemberBase.IsInterface): New public field.
2974
2975         * cs-parser.jay: Create normal Method, Property, Event, Indexer
2976         instances instead of InterfaceMethod, InterfaceProperty, etc.
2977         (opt_interface_base): Removed; we now use `opt_class_base' instead.
2978         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
2979
2980 2004-03-19  Martin Baulig  <martin@ximian.com>
2981
2982         * class.cs (MethodCore.IsDuplicateImplementation): New private
2983         method which does the CS0111 checking.
2984         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
2985         Use IsDuplicateImplementation().
2986
2987 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
2988
2989         * decl.cs (FindMemberToOverride): New method to find the correct
2990         method or property to override in the base class.
2991         * class.cs
2992             - Make Method/Property use the above method to find the
2993               version in the base class.
2994             - Remove the InheritableMemberSignatureCompare as it is now
2995               dead code.
2996
2997         This patch makes large code bases much faster to compile, as it is
2998         O(n) rather than O(n^2) to do this validation.
2999
3000         Also, it fixes bug 52458 which is that nested classes are not
3001         taken into account when finding the base class member.
3002
3003         Reviewed/Approved by Martin.
3004
3005 2004-03-17  Martin Baulig  <martin@ximian.com>
3006
3007         * expression.cs (MemberAccess.DoResolve): Take the parent's number
3008         of type arguments into account; use the `real_num_type_args'
3009         approach like in DoResolveAsTypeStep().
3010
3011         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
3012         nested types.
3013
3014 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
3015
3016         * interface.cs: In all interface classes removed redundant
3017         member initialization.
3018
3019 2004-03-16  Martin Baulig  <martin@ximian.com>
3020
3021         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
3022
3023 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
3024
3025         * decl.cs (DefineTypeAndParents): New helper method to define a
3026         type's containers before the type itself is defined;  This is a
3027         bug exposed by the recent changes to Windows.Forms when an
3028         implemented interface was defined inside a class that had not been
3029         built yet.   
3030
3031         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
3032
3033         (Check): Loop correctly to report errors modifiers
3034         (UNSAFE was not in the loop, since it was the same as TOP).
3035
3036         * interface.cs: Every interface member now takes a ModFlags,
3037         instead of a "is_new" bool, which we set on the base MemberCore. 
3038
3039         Every place where we called "UnsafeOk" in the interface, now we
3040         call the proper member (InterfaceMethod.UnsafeOK) instead to get
3041         the unsafe settings from the member declaration instead of the
3042         container interface. 
3043
3044         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
3045
3046         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
3047         `set_indexer_name' to the pending bits (one per type).
3048
3049         We fixed a bug today that was picking the wrong method to
3050         override, since for properties the existing InterfaceMethod code
3051         basically ignored the method name.  Now we make sure that the
3052         method name is one of the valid indexer names.
3053
3054 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
3055  
3056         * support.cs (SeekableStreamReader): Keep track of stream byte
3057         positions and don't mix them with character offsets to the buffer.
3058
3059         Patch from Gustavo Giráldez
3060
3061 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
3062
3063         * interface.cs (InterfaceSetGetBase): Removed double member
3064         initialization, base class does it as well.
3065
3066 2004-03-13  Martin Baulig  <martin@ximian.com>
3067
3068         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
3069         when compiling corlib.
3070
3071 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
3072
3073         * convert.cs (ExplicitConversion): We were reporting an error on
3074         certain conversions (object_type source to a value type, when the
3075         expression was `null') before we had a chance to pass it through
3076         the user defined conversions.
3077
3078         * driver.cs: Replace / and \ in resource specifications to dots.
3079         Fixes 50752
3080
3081         * class.cs: Add check for duplicate operators.  Fixes 52477
3082
3083 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
3084
3085         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
3086         that are in the middle of the statements, not only at the end.
3087         Fixes #54987
3088
3089         * class.cs (TypeContainer.AddField): No longer set the
3090         `HaveStaticConstructor' flag, now we call it
3091         `UserDefineStaticConstructor' to diferentiate the slightly
3092         semantic difference.
3093
3094         The situation is that we were not adding BeforeFieldInit (from
3095         Modifiers.TypeAttr) to classes that could have it.
3096         BeforeFieldInit should be set to classes that have no static
3097         constructor. 
3098
3099         See:
3100
3101         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
3102
3103         And most importantly Zoltan's comment:
3104
3105         http://bugzilla.ximian.com/show_bug.cgi?id=44229
3106
3107         "I think beforefieldinit means 'it's ok to initialize the type sometime 
3108          before its static fields are used', i.e. initialization does not need
3109          to be triggered by the first access to the type. Setting this flag
3110          helps the JIT to compile better code, since it can run the static
3111          constructor at JIT time, and does not need to generate code to call it
3112          (possibly lots of times) at runtime. Unfortunately, mcs does not set
3113          this flag for lots of classes like String. 
3114          
3115          csc sets this flag if the type does not have an explicit static 
3116          constructor. The reasoning seems to be that if there are only static
3117          initalizers for a type, and no static constructor, then the programmer
3118          does not care when this initialization happens, so beforefieldinit
3119          can be used.
3120          
3121          This bug prevents the AOT compiler from being usable, since it 
3122          generates so many calls to mono_runtime_class_init that the AOT code
3123          is much slower than the JITted code. The JITted code is faster, 
3124          because it does not generate these calls if the vtable is type is
3125          already initialized, which is true in the majority of cases. But the
3126          AOT compiler can't do this."
3127
3128 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
3129
3130         * class.cs (MethodData.Emit): Refactor the code so symbolic
3131         information is generated for destructors;  For some reasons we
3132         were taking a code path that did not generate symbolic information
3133         before. 
3134
3135 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3136
3137         * class.cs: Create a Constructor.CheckBase method that
3138         takes care of all validation type code. The method
3139         contains some code that was moved from Define.
3140
3141         It also includes new code that checks for duplicate ctors.
3142         This fixes bug #55148.
3143
3144 2004-03-09  Joshua Tauberer <tauberer@for.net>
3145
3146         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
3147         a { ... }-style array creation invokes EmitStaticInitializers
3148         which is not good for reference-type arrays.  String, decimal
3149         and now null constants (NullCast) are not counted toward
3150         static initializers.
3151
3152 2004-03-05  Martin Baulig  <martin@ximian.com>
3153
3154         * location.cs (SourceFile.HasLineDirective): New public field;
3155         specifies whether the file contains or is referenced by a "#line"
3156         directive.
3157         (Location.DefineSymbolDocuments): Ignore source files which
3158         either contain or are referenced by a "#line" directive.        
3159
3160 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
3161
3162         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
3163         direct access to our parent, so check the method inline there.
3164
3165 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3166
3167         * expression.cs (Invocation.EmitCall): Miguel's last commit
3168         caused a regression. If you had:
3169
3170             T t = null;
3171             t.Foo ();
3172
3173         In Foo the implict this would be null.
3174
3175 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
3176
3177         * expression.cs (Invocation.EmitCall): If the method is not
3178         virtual, do not emit a CallVirt to it, use Call.
3179
3180         * typemanager.cs (GetFullNameSignature): Improve the method to
3181         cope with ".ctor" and replace it with the type name.
3182
3183         * class.cs (ConstructorInitializer.Resolve): Now the method takes
3184         as an argument the ConstructorBuilder where it is being defined,
3185         to catch the recursive constructor invocations.
3186
3187 2004-03-16  Martin Baulig  <martin@ximian.com>
3188
3189         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
3190         ConstructedType, call ResolveType() on it to get the type rather
3191         than just using `expr.Type'.
3192
3193 2004-03-16  Martin Baulig  <martin@ximian.com>
3194
3195         * generics.cs (ConstructedType.GetMemberAccess): Take the
3196         EmitContext instead on the TypeExpr and use
3197         ec.TypeContainer.CurrentType/ec.ContainerType.
3198
3199 2004-03-16  Martin Baulig  <martin@ximian.com>
3200
3201         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
3202         parameters before aliases.
3203
3204 2004-03-16  Martin Baulig  <martin@ximian.com>
3205
3206         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
3207         New oublic function; checks whether two generic instances may become
3208         equal under some instantiations (26.3.1).
3209
3210         * class.cs (TypeContainer.Define): Call
3211         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
3212         error.
3213
3214 2004-03-16  Martin Baulig  <martin@ximian.com>
3215
3216         * class.cs (TypeContainer.GetClassBases): Moved
3217         Error_TypeParameterAsBase() here and also check whether the base
3218         class is not an attribute.
3219
3220 2004-03-16  Martin Baulig  <martin@ximian.com>
3221
3222         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
3223
3224 2004-03-16  Martin Baulig  <martin@ximian.com>
3225
3226         * class.cs (Error_TypeParameterAsBase): Use correct error number
3227         here (CS0689).  
3228
3229 2004-03-16  Martin Baulig  <martin@ximian.com>
3230
3231         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
3232         for generics.
3233
3234         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
3235         error reporting.
3236
3237 2004-03-15  Martin Baulig  <martin@ximian.com>
3238
3239         * typemanager.cs (TypeManager.GetFullName): New public method.
3240         (TypeManager.MemberLookup): Added `int_num_type_arguments'
3241         argument; only return members with the correct number of type
3242         arguments.
3243         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
3244         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
3245         whether the number of type arguments matches.
3246
3247         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
3248         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
3249
3250         * expression.cs (MemberAccess): Added public `NumTypeArguments'
3251         field; it's set by the protected .ctor when we're actually a
3252         GenericMemberAccess.
3253         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
3254         arguments and pass it to MemberLookupFinal ().
3255
3256         * ecore.cs (Expression.MemberLookup): Added `int
3257         num_type_arguments' argument; only return members with the correct
3258         number of type arguments.
3259         (Expression.MemberLookupFailed): Check whether the MemberLookup
3260         failed because we did not have the correct number of type
3261         arguments; report CS0305 in this case.
3262
3263         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
3264         `e.ResolveAsTypeTerminal()' already did so.
3265
3266 2004-03-15  Martin Baulig  <martin@ximian.com>
3267
3268         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
3269         we're a ConstructedType; in this case, the caller must report an
3270         error (for instance CS0131).
3271
3272         * generic.cs (TypeArguments): Added Location argument to the .ctor.
3273         (TypeArguments.Resolve): Actually report errors here.
3274
3275 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
3276
3277         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
3278         `set_indexer_name' to the pending bits (one per type).
3279
3280         We fixed a bug today that was picking the wrong method to
3281         override, since for properties the existing InterfaceMethod code
3282         basically ignored the method name.  Now we make sure that the
3283         method name is one of the valid indexer names.
3284
3285 2004-03-15  Martin Baulig  <martin@ximian.com>
3286
3287         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
3288         for generic instances.
3289
3290 2004-03-13  Martin Baulig  <martin@ximian.com>
3291
3292         * class.cs (TypeContainer.DefineType): Call
3293         TypeManager.AddUserType() immediately after creating the
3294         TypeBuilder; pass all type parameters when creating the
3295         CurrentType.
3296
3297         * decl.cs (DeclSpace.FindNestedType): New public method.
3298         (DeclSpace.FindType): Added `int num_type_args' argument; only
3299         return types with the correct number of type parameters.
3300         (DeclSpace.CountTypeParams): New public property.
3301
3302         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
3303         the number of type parameters; defaults to zero.
3304
3305         * generic.cs (TypeArguments.Count): New public property.
3306         (ConstructedType.DoResolveAsTypeStep): First call
3307         ds.FindNestedType() to find out whether we're nested in the
3308         current generic type; in this case, we inherit all type parameters
3309         from the current class.
3310
3311         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
3312         num_type_args' argument.
3313         (RootContext.LookupType): Added overloaded version which takes the
3314         number of type arguments; only return types with the correct
3315         number of type arguments.
3316
3317         * typemanager.cs (TypeManager.CheckGeneric): New public function;
3318         checks whether `Type t' has `int num_type_args'.
3319
3320 2004-03-13  Martin Baulig  <martin@ximian.com>
3321
3322         * generic.cs (GenericMethod.DefineType): New method; calls
3323         DefineType() on all the type parameters.
3324
3325         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
3326         (MethodData.Define): If we're a generic method, call
3327         GenericMethod.DefineType() to define the type parameters.       
3328
3329 2004-03-10  Martin Baulig  <martin@ximian.com>
3330
3331         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
3332         instead of IsAssignableFrom.    
3333
3334 2004-03-10  Martin Baulig  <martin@ximian.com>
3335
3336         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
3337
3338         * support.cs (ParameterData.HasArrayParameter): New property.
3339         (ReflectionParameters.ctor): Take a MethodBase instead of a
3340         ParameterInfo[].  If we have any type parameters, get the generic
3341         method definition and ask it whether we have variable arguments.
3342
3343 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
3344
3345         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
3346         routines to check if a type is an enumerable/enumerator allow
3347         classes that implement the IEnumerable or IEnumerator interfaces.
3348
3349         * class.cs (Property, Operator): Implement IIteratorContainer, and
3350         implement SetYields.
3351
3352         (Property.Define): Do the block swapping for get_methods in the
3353         context of iterators.   We need to check if Properties also
3354         include indexers or not.
3355
3356         (Operator): Assign the Block before invoking the
3357         OperatorMethod.Define, so we can trigger the Iterator code
3358         replacement. 
3359
3360         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
3361         Property and Operator classes are not created when we parse the
3362         declarator but until we have the block completed, so we use a
3363         singleton SimpleIteratorContainer.Simple to flag whether the
3364         SetYields has been invoked.
3365
3366         We propagate this setting then to the Property or the Operator to
3367         allow the `yield' to function.
3368
3369 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
3370
3371         * codegen.cs: Implemented attribute support for modules.
3372         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
3373         Assembly/Module functionality.
3374
3375         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
3376         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
3377         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
3378
3379 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
3380
3381         * interface.cs (FindMembers): The operation is performed on all base
3382         interfaces and not only on the first. It is required for future CLS Compliance patch.
3383
3384 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3385
3386         * statement.cs, codegen.cs:
3387         This patch deals with patterns such as:
3388
3389         public class List : IEnumerable {
3390
3391                 public MyEnumerator GetEnumerator () {
3392                         return new MyEnumerator(this);
3393                 }
3394
3395                 IEnumerator IEnumerable.GetEnumerator () {
3396                         ...
3397                 }
3398                 
3399                 public struct MyEnumerator : IEnumerator {
3400                         ...
3401                 }
3402         }
3403
3404         Before, there were a few things we did wrong:
3405         1) we would emit callvirt on a struct, which is illegal
3406         2) we emited ldarg when we needed to emit ldarga
3407         3) we would mistakenly call the interface methods on an enumerator
3408         type that derived from IEnumerator and was in another assembly. For example:
3409
3410         public class MyEnumerator : IEnumerator
3411
3412         Would have the interface methods called, even if there were public impls of the
3413         method. In a struct, this lead to invalid IL code.
3414
3415 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
3416
3417         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
3418           renamed to Emit.
3419
3420         * delegate.cs (Define): Fixed crash when delegate type is undefined.
3421
3422 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
3423
3424         * cs-parser.jay: Fix small regression: we were not testing V2
3425         compiler features correctly.
3426
3427         * interface.cs: If the emit context is null, then create one
3428
3429 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
3430
3431         * decl.cs (GetSignatureForError): New virtual method to get full name
3432           for error messages.
3433
3434         * attribute.cs (IAttributeSupport): New interface for attribute setting.
3435           Now it is possible to rewrite ApplyAttributes method to be less if/else.
3436
3437         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
3438           Duplicated members and code in these classes has been removed.
3439           Better encapsulation in these classes.
3440
3441 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
3442
3443         * assign.cs (Assign.DoResolve): When dealing with compound
3444         assignments, there is a new rule in ECMA C# 2.4 (might have been
3445         there before, but it is documented here) that states that in:
3446
3447         a op= b;
3448
3449         If b is of type int, and the `op' is a shift-operator, then the
3450         above is evaluated as:
3451
3452         a = (int) a op b 
3453
3454         * expression.cs (Binary.ResolveOperator): Instead of testing for
3455         int/uint/long/ulong, try to implicitly convert to any of those
3456         types and use that in pointer arithmetic.
3457
3458         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
3459         method to print information for from the type, not from the
3460         null-method we were given.
3461
3462 2004-02-01  Duncan Mak  <duncan@ximian.com>
3463
3464         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
3465         parsing for cmd, fixes bug #53694.
3466
3467 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
3468
3469         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
3470         in the member name duplication tests. Property and operator name duplication
3471         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
3472
3473 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
3474
3475         * interface.cs (PopulateMethod): Fixed crash when interface method
3476         returns not existing type (error test cs0246-3.cs).
3477
3478 2004-02-02  Ravi Pratap M <ravi@ximian.com>
3479
3480         * cs-parser.jay (interface_accessors): Re-write actions to also
3481         store attributes attached to get and set methods. Fix spelling
3482         while at it.
3483
3484         (inteface_property_declaration): Modify accordingly.
3485
3486         (InterfaceAccessorInfo): New helper class to store information to pass
3487         around between rules that use interface_accessors.
3488
3489         * interface.cs (Emit): Apply attributes on the get and set
3490         accessors of properties and indexers too.
3491
3492         * attribute.cs (ApplyAttributes): Modify accordingly to use the
3493         right MethodBuilder when applying attributes to the get and set accessors.
3494
3495 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
3496
3497         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
3498
3499 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
3500
3501         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
3502
3503 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
3504
3505         * cs-parser.jay: Remove YIELD token, instead use the new grammar
3506         changes that treat `yield' specially when present before `break'
3507         or `return' tokens.
3508
3509         * cs-tokenizer.cs: yield is no longer a keyword.
3510
3511 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
3512
3513         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
3514         setting for default constructors.
3515         For default constructors are almost every time set wrong Modifier. The
3516         generated IL code has been alright. But inside mcs this values was
3517         wrong and this was reason why several of my CLS Compliance tests
3518         failed.
3519
3520 2004-02-27  Martin Baulig  <martin@ximian.com>
3521
3522         * generics.cs (ConstructedType.ResolveType): Make the nested type
3523         stuff actually work.
3524
3525 2004-02-25  Martin Baulig  <martin@ximian.com>
3526
3527         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
3528         property; returns the type parameters just from the current type,
3529         ie. with the ones from outer classes.
3530         (DeclSpace.LookupGeneric): First search in the current class, then
3531         in outer classes.
3532         (DeclSpace.initialize_type_params): When hiding a type parameter
3533         from an outer class, put it into the `type_param_list' anyways.
3534
3535         * expression.cs (MemberAccess.expr): Made this field protected.
3536
3537         * class.cs (TypeContainer.Define): The `CurrentType' just contains
3538         the type parameters from the current class.
3539
3540         * generic.cs (ConstructedType.ResolveType): Support nested generic
3541         types by taking the type parameters which we inherit from outer
3542         classes into account.
3543         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
3544         support for nested generic types.
3545
3546 2004-02-23  Martin Baulig  <martin@ximian.com>
3547
3548         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
3549         field and check whether we're nested inside a generic type.
3550         (DeclSpace.ResolveType): If we're resolving to a generic type
3551         definition, create a ConstructedType and return its resolved type.
3552         (DeclSpace.initialize_type_params): New private method;
3553         initializes the `type_param_list' field from the type parameters
3554         from this and all enclosing classes.
3555         (DeclSpace.TypeParameters): Call initialize_type_params() unless
3556         we're already initialized.
3557
3558 2004-02-23  Martin Baulig  <martin@ximian.com>
3559
3560         * class.cs (Method.Define): Create the generic method before
3561         calling DoDefine().
3562         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
3563         the TypeContainer one); we use this for generic methods.
3564
3565         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
3566         parent's TypeBuilder.
3567
3568 2004-02-18  Martin Baulig  <martin@ximian.com>
3569
3570         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
3571         to check for equality.
3572
3573 2004-02-05  Martin Baulig  <martin@ximian.com>
3574
3575         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
3576         `ec.TypeContainer.CurrentType', use it instead of
3577         `ec.ContainerType' to check whether we're in the type's ctor.
3578
3579 2004-01-29  Martin Baulig  <martin@ximian.com>
3580
3581         * expression.cs (Invocation.DoResolve): If we're a
3582         `ConstructedType', then we're actually a generic method, so
3583         rewrite the expr as a GenericMemberAccess.
3584
3585         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
3586         here; manually parse it into a string.
3587
3588 2004-01-28  Martin Baulig  <martin@ximian.com>
3589
3590         * typemanager.cs (TypeManager.IsEqual): New static method.
3591         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
3592         check for equality instead of using `=='.
3593
3594 2004-01-26  Martin Baulig  <martin@ximian.com>
3595
3596         * decl.cs (DeclSpace.CurrentType): New public field.
3597
3598         * expression.cs (This.ResolveBase): If we have an
3599         `ec.TypeContainer.CurrentType', use it instead of
3600         `ec.ContainerType'.
3601
3602         * class.cs (TypeContainer.DefineType): If we're a generic type,
3603         create the `CurrentType' (unresolved).
3604         (TypeContainer.GenericType): New private field.
3605         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
3606         it and store it in `GenericType' before creating the MemberCache.
3607         (TypeContainer.GetMembers): If we have a `GenericType', call
3608         TypeManager.FindMembers() on it.
3609
3610         * interface.cs (Interface.GenericType): New private field.
3611         (Interface.DefineType): If we're a generic type, create the
3612         `CurrentType' (unresolved).
3613         (Interface.DefineMembers): If we have a `CurrentType', resolve it
3614         and store it in `GenericType' before creating the MemberCache.
3615         (Interface.GetMembers): If we have a `GenericType', call
3616         TypeManager.FindMembers() on it.
3617
3618 2004-01-22  Martin Baulig  <martin@ximian.com>
3619
3620         * cs-parser.jay (namespace_or_type_name): Return an Expression,
3621         not a QualifiedIdentifier.  This is what `type_name_expression'
3622         was previously doing.
3623         (type_name_expression): Removed; the code is now in
3624         `namespace_or_type_name'.
3625         (qualified_identifier): Removed, use `namespace_or_type_name'
3626         instead.
3627         (QualifiedIdentifier): Removed this class.      
3628
3629 2004-01-22  Martin Baulig  <martin@ximian.com>
3630
3631         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
3632         not a string as alias name.
3633
3634 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
3635
3636         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
3637         #52730 bug, and instead compute correctly the need to use a
3638         temporary variable when requesting an address based on the
3639         static/instace modified of the field and the constructor.
3640  
3641 2004-01-21  Martin Baulig  <martin@ximian.com>
3642
3643         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
3644         class and namespace before looking up aliases.  Fixes #52517.
3645
3646 2004-01-21  Martin Baulig  <martin@ximian.com>
3647
3648         * flowanalysis.cs (UsageVector.Merge): Allow variables being
3649         assinged in a 'try'; fixes exception4.cs.
3650
3651 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3652         * class.cs : Implemented parameter-less constructor for TypeContainer
3653
3654         * decl.cs: Attributes are now stored here. New property OptAttributes
3655
3656         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
3657
3658         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
3659
3660 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3661
3662         * typemanager.cs (CSharpSignature): Now reports also inner class name.
3663           (CSharpSignature): New method for indexer and property signature.
3664
3665 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3666
3667         * pending.cs (IsVirtualFilter): Faster implementation.
3668
3669 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3670
3671         * typemanager.cs: Avoid inclusion of same assembly more than once.
3672
3673 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3674
3675         * cs-parser.jay: Fixed problem where the last assembly attribute
3676           has been applied also to following declaration (class, struct, etc.)
3677           
3678 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3679
3680         * class.cs: Added error CS0538, CS0539 reporting.
3681         Fixed crash on Microsoft runtime when field type is void.
3682
3683         * cs-parser.jay: Added error CS0537 reporting.
3684
3685         * pending.cs: Added error CS0535 reporting.
3686         Improved error report for errors CS0536, CS0534.
3687
3688 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
3689
3690         Merge a few bits from the Anonymous Method MCS tree.
3691
3692         * statement.cs (ToplevelBlock): New class for toplevel methods,
3693         will hold anonymous methods, lifted variables.
3694
3695         * cs-parser.jay: Create toplevel blocks for delegates and for
3696         regular blocks of code. 
3697
3698 2004-01-20  Martin Baulig  <martin@ximian.com>
3699
3700         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
3701         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
3702         and `NeedExplicitReturn'; added `IsLastStatement'.
3703         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
3704         have a `ReturnLabel' or we're not unreachable.
3705
3706         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
3707         child's reachability; don't just override ours with it.  Fixes
3708         #58058 (lluis's example).
3709         (FlowBranching): Added public InTryOrCatch(), InCatch(),
3710         InFinally(), InLoop(), InSwitch() and
3711         BreakCrossesTryCatchBoundary() methods.
3712
3713         * statement.cs (Return): Do all error checking in Resolve().
3714         Unless we are the last statement in a top-level block, always
3715         create a return label and jump to it.
3716         (Break, Continue): Do all error checking in Resolve(); also make
3717         sure we aren't leaving a `finally'.
3718         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
3719         statement in a top-level block.
3720         (Block.Flags): Added `IsDestructor'.
3721         (Block.IsDestructor): New public property.
3722
3723 2004-01-20  Martin Baulig  <martin@ximian.com>
3724
3725         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
3726
3727 2004-01-20  Martin Baulig  <martin@ximian.com>
3728
3729         * statement.cs (Statement.ResolveUnreachable): New public method.
3730         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
3731         (Block.Resolve): Resolve unreachable statements.
3732
3733 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3734
3735         * expression.cs: We need to fix the case where we do
3736         not have a temp variable here.
3737
3738         * assign.cs: Only expression compound assignments need
3739         temporary variables.
3740
3741 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3742
3743         * flowanalysis.cs: Reduce memory allocation in a few ways:
3744           - A block with no variables should not allocate a bit
3745             vector for itself.
3746           - A method with no out parameters does not need any tracking
3747             for assignment of the parameters, so we need not allocate
3748             any data for it.
3749           - The arrays:
3750                 public readonly Type[] VariableTypes;
3751                 public readonly string[] VariableNames;
3752             Are redundant. The data is already stored in the variable
3753             map, so we need not allocate another array for it.
3754           - We need to add alot of checks for if (params | locals) == null
3755             due to the first two changes.
3756
3757 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
3758
3759         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
3760         implement IMemoryLocation, we store a copy on a local variable and
3761         take the address of it.  Patch from Benjamin Jemlich
3762
3763         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
3764         to use a special "type_name_expression" rule which reduces the
3765         number of "QualifiedIdentifier" classes created, and instead
3766         directly creates MemberAccess expressions.
3767
3768 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
3769
3770         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
3771         that fixes #52853.  Null literal assignment to ValueType
3772
3773         * class.cs (MethodData.Emit): Instead of checking the name of the
3774         method to determine if its a destructor, create a new derived
3775         class from Method called Destructor, and test for that.  
3776
3777         * cs-parser.jay: Create a Destructor object instead of a Method.  
3778
3779         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
3780
3781         Fixes: 52933
3782
3783 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
3784
3785         * expression.cs (Binary.ResolveOperator): Perform an implicit
3786         conversion from MethodGroups to their delegate types on the
3787         Addition operation.
3788
3789         * delegate.cs: Introduce a new class DelegateCreation that is the
3790         base class for `NewDelegate' and `ImplicitDelegateCreation',
3791         factor some code in here.
3792
3793         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
3794         conversion from MethodGroups to compatible delegate types. 
3795
3796         * ecore.cs (Expression.Resolve): Do not flag error 654
3797         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
3798         we allow conversions from MethodGroups to delegate types now.
3799
3800         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
3801         assignments in v2 either.
3802
3803 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
3804
3805         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
3806         static read-only fields in ctors.
3807
3808         Applied patch from Benjamin Jemlich 
3809
3810         * expression.cs (UnaryMutator): Avoid leaking local variables. 
3811
3812 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
3813
3814         * cs-tokenizer.cs (IsCastToken): Allow the various native types
3815         here to return true, as they can be used like this:
3816
3817                 (XXX) int.MEMBER ()
3818
3819         Fixed 49836 and all the other dups
3820
3821 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
3822
3823         * driver.cs: Implement /win32res and /win32icon.
3824
3825 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
3826
3827         * cs-parser.jay: Add a rule to improve error handling for the
3828         common mistake of placing modifiers after the type.
3829
3830 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
3831
3832         * cs-parser.jay (interface_event_declaration): Catch
3833         initialization of events on interfaces, and report cs0068
3834
3835         * cs-parser.jay (interface_event_declaration): Catch
3836         initialization of events. 
3837
3838         * ecore.cs: Better report missing constructors.
3839
3840         * expression.cs (Binary.ResolveOperator): My previous bug fix had
3841         the error reporting done in the wrong place.  Fix.
3842
3843         * expression.cs (Binary.ResolveOperator): Catch the 
3844         operator + (E x, E y) error earlier, and later allow for implicit
3845         conversions in operator +/- (E e, U x) from U to the underlying
3846         type of E.
3847
3848         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
3849         52596, if the container class is abstract, the default constructor
3850         is protected otherwise its public (before, we were always public).
3851
3852         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
3853         fixed statement.
3854
3855         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
3856         Jemlich that fixes bug #52597, MCS was generating invalid code for
3857         idisposable structs.   Thanks to Ben for following up with this
3858         bug as well.
3859
3860 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
3861
3862         * driver.cs: Allow assemblies without code to be generated, fixes
3863         52230.
3864
3865 2004-01-07  Nick Drochak <ndrochak@gol.com>
3866
3867         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
3868
3869 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
3870
3871         * cs-parser.jay: Add rules to improve error reporting if fields or
3872         methods are declared at the namespace level (error 116)
3873
3874         * Add rules to catch event add/remove
3875
3876 2004-01-04  David Sheldon <dave-mono@earth.li>
3877
3878   * expression.cs: Added matching ")" to error message for 
3879   CS0077
3880
3881 2004-01-03 Todd Berman <tberman@gentoo.org>
3882
3883         * ecore.cs, attribute.cs:
3884         Applying fix from #52429.
3885
3886 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3887
3888         * ecore.cs, expression.cs, statement.cs:
3889         Total rewrite of how we handle branching. We
3890         now handle complex boolean expressions with fewer
3891         jumps. As well if (x == 0) no longer emits a ceq.
3892
3893         if (x is Foo) is much faster now, because we generate
3894         better code.
3895
3896         Overall, we get a pretty big improvement on our benchmark
3897         tests. The code we generate is smaller and more readable.
3898
3899         I did a full two-stage bootstrap. The patch was reviewed
3900         by Martin and Miguel.
3901
3902 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3903
3904         * cs-parser.jay: Make primary_expression not take a QI.
3905         we dont need this because the member_access rule covers
3906         us here. So we replace the rule with just IDENTIFIER.
3907
3908         This has two good effects. First, we remove a s/r conflict.
3909         Second, we allocate many fewer QualifiedIdentifier objects.
3910
3911 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3912
3913         * attribute.cs: Handle MarshalAs attributes as pseudo, and
3914         set the correct information via SRE. This prevents
3915         hanging on the MS runtime. Fixes #29374.
3916
3917 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3918
3919         * convert.cs: correctly handle conversions to value types
3920         from Enum and ValueType as unboxing conversions.
3921
3922         Fixes bug #52569. Patch by Benjamin Jemlich.
3923
3924 2004-01-02  Ravi Pratap  <ravi@ximian.com>
3925
3926         * expression.cs (BetterConversion): Prefer int -> uint
3927         over int -> ulong (csc's behaviour). This fixed bug #52046.
3928
3929 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3930
3931         * decl.cs (MemberCache.FindMembers): now returns a
3932         MemberInfo [].
3933
3934         * typemanager.cs: In general, go with with ^^.
3935         (CopyNewMethods): take an IList.
3936         (RealMemberLookup): Only allocate an arraylist
3937         if we copy from two sets of methods.
3938
3939         This change basically does two things:
3940         1) Fewer array lists allocated due to CopyNewMethods.
3941         2) the explicit cast in MemberList costed ALOT.
3942
3943 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
3944
3945         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
3946         a hashtable to avoid needless string allocations when an identifier is
3947         used more than once (the common case).
3948
3949 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3950
3951         * pending.cs: MS's TypeBuilder.GetInterfaces ()
3952         is broken, it will not return anything. So, we
3953         have to use the information we have in mcs to
3954         do the task.
3955
3956         * typemanager.cs: Add a cache for GetInterfaces,
3957         since this will now be used more often (due to ^^)
3958
3959         (GetExplicitInterfaces) New method that gets the
3960         declared, not effective, interfaces on a type
3961         builder (eg, if you have interface IFoo, interface
3962         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
3963         { IBar }.
3964
3965         This patch makes MCS able to bootstrap itself on
3966         Windows again.
3967
3968 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3969
3970         * expression.cs: Remove the Nop's that Miguel put
3971         in by mistake.
3972
3973 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3974
3975         * report.cs, codegen.cs: Give the real stack trace to
3976         the error when an exception is thrown.
3977
3978 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3979
3980         * decl.cs: only allocate hashtables for ifaces if 
3981         it is an iface!
3982
3983 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3984
3985         * expression.cs: fix the error from cs0121-2.cs
3986         (a parent interface has two child interfaces that
3987         have a function with the same name and 0 params
3988         and the function is called through the parent).
3989
3990 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3991
3992         * class.cs, rootcontext.cs, typmanager.cs: do not
3993         leak pointers.
3994
3995 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3996
3997         * codegen.cs: remove stack for the ec flow branching.
3998         It is already a linked list, so no need.
3999
4000 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
4001
4002         * Makefile: Allow custom profiler here.
4003
4004 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4005
4006         * typemanager.cs (LookupType):
4007           - Use a static char [], because split takes
4008             a param array for args, so it was allocating
4009             every time.
4010           - Do not store true in a hashtable, it boxes.
4011
4012 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
4013
4014         * flowanalysis.cs: bytify common enums.
4015
4016 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4017
4018         * modifiers.cs: Add a new set of flags for the
4019         flags allowed on explicit interface impls.
4020         * cs-parser.jay: catch the use of modifiers in
4021         interfaces correctly.
4022         * class.cs: catch private void IFoo.Blah ().
4023
4024         All related to bug #50572.
4025
4026 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4027
4028         * decl.cs: Rewrite the consistant accessability checking.
4029         Accessability is not linear, it must be implemented in
4030         a tableish way. Fixes #49704.
4031
4032 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
4033
4034         * expression.cs: Handle negation in a checked context.
4035         We must use subtraction from zero. Fixes #38674.
4036
4037 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4038
4039         * class.cs: Ignore static void main in DLLs.
4040         * rootcontext.cs: Handle the target type here,
4041         since we are have to access it from class.cs
4042         * driver.cs: account for the above.
4043
4044 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4045
4046         * report.cs: Give line numbers and files if available.
4047
4048 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
4049
4050         * driver.cs: Implement /addmodule.
4051
4052         * typemanager.cs:  Change 'modules' field so it now contains Modules not
4053         ModuleBuilders.
4054
4055 2003-12-20  Martin Baulig  <martin@ximian.com>
4056
4057         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
4058         (FieldBase.IsAssigned): Removed this field.
4059         (FieldBase.SetAssigned): New public method.
4060         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
4061
4062 2003-12-20  Martin Baulig  <martin@ximian.com>
4063
4064         * expression.cs (LocalVariableReference.DoResolve): Don't set
4065         `vi.Used' if we're called from DoResolveLValue().
4066
4067         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
4068         returns the usage vector it just merged into the current one -
4069         pass this one to UsageWarning().
4070         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
4071         of the `EmitContext', don't call this recursively on our children.
4072
4073 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
4074
4075         * driver.cs: Implement /target:module.
4076
4077 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
4078
4079         * support.cs (CharArrayHashtable): New helper class.
4080
4081         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
4082         char arrays, not strings, so we can avoid creating a string in
4083         consume_identifier if the identifier is a keyword.
4084
4085 2003-12-16  Martin Baulig  <martin@ximian.com>
4086
4087         * statement.cs (LocalInfo.Assigned): Removed this property.
4088         (LocalInfo.Flags): Removed `Assigned'.
4089         (LocalInfo.IsAssigned): New public method; takes the EmitContext
4090         and uses flow analysis.
4091         (Block.UsageWarning): Made this method private.
4092         (Block.Resolve): Call UsageWarning() if appropriate.
4093
4094         * expression.cs (LocalVariableReference.DoResolve): Always set
4095         LocalInfo.Used here.
4096
4097 2003-12-13  Martin Baulig  <martin@ximian.com>
4098
4099         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
4100         any value here; we're now using flow analysis to figure out
4101         whether a statement/block returns a value.
4102
4103 2003-12-13  Martin Baulig  <martin@ximian.com>
4104
4105         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
4106         working again.
4107         (FlowBranching.MergeFinally): Don't call
4108         `branching.CheckOutParameters()' here, this is called in
4109         MergeTopBlock().
4110         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
4111         when adding the `finally' vector.       
4112
4113 2003-12-13  Martin Baulig  <martin@ximian.com>
4114
4115         * flowanalysis.cs
4116         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
4117         actually work and also fix #48962.
4118
4119 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
4120
4121         * decl.cs: Do not check System.Object for nested types,
4122         since we know it does not have any. Big bang for buck:
4123
4124         BEFORE:
4125            Run 1:   8.35 seconds
4126            Run 2:   8.32 seconds
4127            corlib:  17.99 seconds
4128         AFTER:
4129            Run 1:   8.17 seconds
4130            Run 2:   8.17 seconds
4131            corlib:  17.39 seconds
4132
4133 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
4134
4135         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
4136         time we are returning 0 members, so we save alot here.
4137
4138 2003-12-11  Martin Baulig  <martin@ximian.com>
4139
4140         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
4141         `MergeChild()', also just take the `FlowBranching' as argument;
4142         call Merge() on it and return the result.
4143         (FlowBranching.Merge): We don't need to do anything if we just
4144         have one sibling.
4145
4146 2003-12-11  Martin Baulig  <martin@ximian.com>
4147
4148         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
4149         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
4150         Maurer for this idea.
4151
4152 2003-12-11  Martin Baulig  <martin@ximian.com>
4153
4154         * flowanalysis.cs (MergeResult): This class is now gone; we now
4155         use the `UsageVector' for this.  The reason for this is that if a
4156         branching just has one sibling, we don't need to "merge" them at
4157         all - that's the next step to do.
4158         (FlowBranching.Merge): We now return a `UsageVector' instead of a
4159         `MergeResult'.
4160
4161 2003-12-11  Martin Baulig  <martin@ximian.com>
4162
4163         Reworked flow analyis and made it more precise and bug-free.  The
4164         most important change is that we're now using a special `Reachability'
4165         class instead of having "magic" meanings of `FlowReturns'.  I'll
4166         do some more cleanups and optimizations and also add some more
4167         documentation this week.
4168
4169         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
4170         largely reworked this class.
4171         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
4172         the new `Reachability' class instead of having "magic" values here.
4173         (FlowBranching): We're now using an instance of `Reachability'
4174         instead of having separate `Returns', `Breaks' etc. fields.
4175
4176         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
4177         based on flow analysis; ignore the return value of block.Emit ().
4178
4179 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
4180
4181         * driver.cs typemanager.cs: Find the mono extensions to corlib even
4182         if they are private.
4183
4184 2003-12-09  Martin Baulig  <martin@ximian.com>
4185
4186         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
4187         call them directly on the UsageVector.
4188
4189 2003-12-09  Martin Baulig  <martin@ximian.com>
4190
4191         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
4192         Changed return type from `FlowReturns' to `Reachability'.
4193
4194 2003-12-09  Martin Baulig  <martin@ximian.com>
4195
4196         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
4197         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
4198         `Reachable' fields with a single `Reachability' one.
4199
4200 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4201
4202         * class.cs (FindMembers): Remove foreach's.
4203
4204         Bootstrap times:
4205
4206         BEFORE
4207                 Run 1:   8.74 seconds
4208                 Run 2:   8.71 seconds
4209
4210         AFTER
4211                 Run 1:   8.64 seconds
4212                 Run 2:   8.58 seconds
4213
4214
4215 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4216
4217         * cs-parser.jay:
4218         * gen-treedump.cs:
4219         * statement.cs:
4220         This patch does a few things:
4221                 1. EmptyStatement is now a singleton, so it is never reallocated.
4222                 2. All blah is EmptyStatement constructs have been changed to
4223                    blah == EmptyStatement.Value, which is much faster and valid
4224                    now that EmptyStatement is a singleton.
4225                 3. When resolving a block, rather than allocating a new array for
4226                    the non-empty statements, empty statements are replaced with
4227                    EmptyStatement.Value
4228                 4. Some recursive functions have been made non-recursive.
4229         Mainly the performance impact is from (3), however (1) and (2) are needed for
4230         this to work. (4) does not make a big difference in normal situations, however
4231         it makes the profile look saner.
4232
4233         Bootstrap times:
4234
4235         BEFORE
4236         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4237         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
4238         Total memory allocated: 56397 KB
4239
4240         AFTER
4241         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
4242         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
4243         Total memory allocated: 55666 KB
4244
4245 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4246
4247         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
4248         than the hashtable in a hashtable version
4249
4250         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
4251         we always end up concating a string. This results in a huge perf
4252         loss, because many strings have to be tracked by the GC. In this
4253         patch, we first use a hashtable that works with two keys, so that
4254         the strings do not need to be concat'ed.
4255
4256         Bootstrap times:
4257         BEFORE
4258                 Run 1:   8.74 seconds
4259                 Run 2:   8.71 seconds
4260
4261         AFTER
4262                 Run 1:   8.65 seconds
4263                 Run 2:   8.56 seconds
4264
4265 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
4266
4267         * Makefile: Add a new target `do-time' that does a quick and simple
4268         profile, leaving easy to parse output.
4269
4270 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
4271
4272         * codegen.cs (Init): Create the dynamic assembly with 
4273         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
4274
4275 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4276
4277         * support.cs: Make the PtrHashtable use only one
4278         instance of its comparer.
4279
4280 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
4281
4282         * typemanager.cs: Fix lookup of GetNamespaces.
4283
4284 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
4285
4286         * expression.cs: Removed redundant line.
4287
4288         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
4289         ArrayLists, use for loops with bounds.  
4290
4291         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
4292         arraylist.
4293
4294         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
4295         arraylists, use for loop with bounds.
4296
4297         The above three changes give us a 0.071 second performance
4298         improvement out of 3.294 seconds down to 3.223.  On my machine
4299         the above changes reduced the memory usage by 1,387 KB during
4300         compiler bootstrap.
4301
4302         * cs-parser.jay (QualifiedIdentifier): New class used to represent
4303         QualifiedIdentifiers.  Before we created a new string through
4304         concatenation, and mostly later on, the result would be
4305         manipulated by DecomposeQI through string manipulation.
4306
4307         This reduced the compiler memory usage for bootstrapping from
4308         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
4309         compile times in 0.05 seconds.
4310
4311 2003-11-28  Dick Porter  <dick@ximian.com>
4312
4313         * support.cs: Do string compares with the Invariant culture.
4314
4315         * rootcontext.cs: 
4316         * gen-treedump.cs: 
4317         * expression.cs: 
4318         * driver.cs: 
4319         * decl.cs: 
4320         * codegen.cs: 
4321         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
4322         the comparison is done with the Invariant culture.
4323
4324 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
4325
4326         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
4327         GetEnumerator method.
4328
4329         (ProbeCollectionType): Iterate starting at the most specific type
4330         upwards looking for a GetEnumerator
4331
4332         * expression.cs: Shift count can be up to 31 for int/uint and 63
4333         for long/ulong.
4334
4335 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
4336
4337         * statement.cs (Block.LookupLabel): Also look for the label on the
4338         children blocks.  Use a hash table to keep track of visited
4339         nodes. 
4340
4341         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
4342         we actually did transform the other operand, otherwise fall back
4343         to the common codepath that casts to long.
4344
4345         * cs-tokenizer.cs: Use the same code pattern as the int case.
4346         Maybe I should do the parsing myself, and avoid depending on the
4347         Parse routines to get this done.
4348
4349 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
4350
4351         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4352         which fixes bug 51347.  This time test it.
4353
4354         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
4355         attributes for example can not tell the difference between these.
4356         The difference was only a syntax feature of the language. 
4357
4358         * attribute.cs: Apply attributes to delegates.
4359
4360         * delegate.cs: Call the apply attributes method.
4361
4362 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
4363
4364         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
4365         comparing 0 vs Byte.MinValue, not the value
4366
4367         (ImplicitConversionRequired): When reporting a conversion error,
4368         use error 31 to print out the constant error instead of the
4369         simpler 29.
4370
4371         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4372         which fixes bug 51347.
4373
4374 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
4375
4376         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
4377         which fixes the -warnaserror command line option.
4378
4379 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
4380
4381         * cfold.cs (DoNumericPromotions): During constant folding of
4382         additions on UIntConstant, special case intconstants with
4383         IntConstants like we do on the expression binary operator. 
4384
4385 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
4386
4387         * convert.cs (ImplicitReferenceConversion): We were missing a case
4388         (System.Enum are not value types or class types, so we need to
4389         classify them separatedly).
4390
4391         * driver.cs: We do not support error 2007.
4392
4393 2003-11-12 Jackson Harper <jackson@ximian.com>
4394
4395         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
4396         system directory. Also use the full file name so users can
4397         libraries names mscorlib-o-tron.dll in a non system dir.
4398         
4399 2004-01-04  David Sheldon <dave-mono@earth.li>
4400
4401         * expression.cs: Added matching ")" to error message for CS0077.
4402
4403 2003-12-19  Martin Baulig  <martin@ximian.com>
4404
4405         * typemanager.cs (TypeManager.IsEqualGenericType): New public
4406         static method; see documentation in the method.
4407         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
4408
4409         * convert.cs (Convert.ImplicitReferenceConversion,
4410         Convert.ImplicitReferenceConversionExists): Add support for
4411         generic type declarations; see gen-36.cs.
4412
4413 2003-12-19  Martin Baulig  <martin@ximian.com>
4414
4415         * pending.cs (Pending.InterfaceMethod): Use
4416         `Type.IsAssignableFrom()' instead of `=='.
4417
4418 2003-12-18  Martin Baulig  <martin@ximian.com>
4419
4420         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
4421         byref types first.
4422
4423         * convert.cs (Convert.ImplicitStandardConversionExists): Use
4424         `expr_type.Equals (target_type)' instead of `=='.
4425
4426 2003-12-08  Martin Baulig  <martin@ximian.com>
4427
4428         * generics.cs (Constraints.Types): Removed.
4429         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
4430         to Type's.
4431         (Constraints.ResolveTypes): New public method; resolves the
4432         TypeExpr's to Type's.
4433         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
4434         longer takes the constraints.
4435         (TypeParameter.DefineMethod): Likewise.
4436         (TypeParameter.DefineType): New public method.  Calls
4437         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
4438         the constraints.
4439
4440 2003-12-08  Martin Baulig  <martin@ximian.com>
4441
4442         * convert.cs (Convert.ImplicitConversionStandard): Use
4443         `expr_type.Equals (target_type)' instead of `=='.
4444
4445 2003-12-08  Martin Baulig  <martin@ximian.com>
4446
4447         * typemanager.cs (TypeManager.GetReferenceType): Call
4448         `Type.MakeByRefType ()'.
4449
4450 2003-12-08  Martin Baulig  <martin@ximian.com>
4451
4452         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
4453         just has some special meaning in some situations.  For instance,
4454         it is allowed to use `where' as the name of a variable etc.
4455
4456 2003-12-04  Martin Baulig  <martin@ximian.com>
4457
4458         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4459         `Type.MakeArrayType()' for array types.
4460
4461 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
4462
4463         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
4464         debugging message.
4465
4466         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
4467         corlib to compile.
4468
4469 2003-11-16  Martin Baulig  <martin@ximian.com>
4470
4471         * codegen.cs (EmitContext.IsGeneric): Removed.
4472
4473         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
4474         ResolveGeneric() on the DeclSpace.
4475
4476 2003-11-16  Martin Baulig  <martin@ximian.com>
4477
4478         * generic.cs (TypeArguments.Resolve):
4479         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
4480         `ResolveType()' on it to get the Type.
4481
4482 2003-11-15  Martin Baulig  <martin@ximian.com>
4483
4484         * generic.cs (ConstructedType.GetInterfaces): Override this.
4485
4486 2003-11-14  Martin Baulig  <martin@ximian.com>
4487
4488         * interface.cs (Interface.DefineType): Define all type parameters
4489         before adding the interfaces we inherit.
4490
4491 2003-11-11  Martin Baulig  <martin@ximian.com>
4492
4493         * generic.cs (ConstructedType.ResolveType): Always call
4494         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
4495
4496 2003-11-10  Martin Baulig  <martin@ximian.com>
4497
4498         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
4499         (TypeManager.InitCoreTypes): Initialize them here, but instead of
4500         calling `ResolveType()' on them, directly assign their `Type'.
4501
4502 2003-11-08  Martin Baulig  <martin@ximian.com>
4503
4504         * generic.cs (ConstructedType): Override `IsClass' etc.
4505
4506 2003-11-08  Martin Baulig  <martin@ximian.com>
4507
4508         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
4509         return value and the `out parent' parameter.
4510         (TypeContainer.DefineType): Moved the CS0644 check into
4511         GetClassBases().  Don't pass the interface types to the
4512         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
4513         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
4514
4515         * ecore.cs (TypeExpr.IsAttribute): New property.
4516         (TypeExpr.GetInterfaces): New method.
4517
4518         * interface.cs (Interface.GetInterfaceTypeByName): Return a
4519         TypeExpr instead of a Type.
4520         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
4521         (Interface.DefineType): Don't pass the interface types to the
4522         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
4523         them later and then call `TypeBulider.AddInterfaceImplementation()'.
4524
4525         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
4526         instead of a `Type[]'.
4527         (TypeManager.RegisterBuilder): Likewise.
4528         (TypeManager.AddUserInterface): Likewise.
4529         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
4530         `Type[]' and also return a `TypeExpr[]'.
4531         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
4532
4533 2003-11-08  Martin Baulig  <martin@ximian.com>
4534
4535         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
4536         Expression.     
4537
4538 2003-11-08  Martin Baulig  <martin@ximian.com>
4539
4540         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
4541         TypeManager.ResolveExpressionTypes().
4542
4543         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
4544         instead of an Expression.
4545         (TypeExpr): This is now an abstract base class for `TypeExpression'.
4546         (TypeExpression): New public class; formerly known as `TypeExpr'.
4547
4548         * expression.cs (ComposedCast): Derive from TypeExpr.
4549
4550         * typemanager.cs (TypeManager.system_*_expr): These are now
4551         TypExpr's instead of Expression's.
4552         (TypeManager.ResolveExpressionTypes): New public static function;
4553         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
4554         of them.        
4555
4556 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
4557
4558         * expression.cs (New.DoResolve): Do not dereference value that
4559         might be a null return.
4560
4561         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
4562         sure that the constant value has the right type.  Fixes an
4563         unreported bug, similar to 50425.
4564
4565         * const.cs (Const.LookupConstantValue): Call
4566         ImplicitStandardConversionExists before doing a conversion to
4567         avoid havng the TypeManager.ChangeType do conversions.
4568
4569         Reduced the number of casts used
4570
4571         (Const.ChangeType): New routine to enable reuse of the constant
4572         type changing code from statement.
4573
4574         * typemanager.cs (ChangeType): Move common initialization to
4575         static global variables.
4576
4577         Fixes #50425.
4578
4579         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
4580         every value type to go through, even if it was void.  Fix that. 
4581
4582         * cs-tokenizer.cs: Use is_identifier_start_character on the start
4583         character of the define, and the is_identifier_part_character for
4584         the rest of the string.
4585
4586 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
4587
4588         * expression.cs (UnaryMutator.EmitCode): When I updated
4589         LocalVariableReference.DoResolve, I overdid it, and dropped an
4590         optimization done on local variable references.
4591
4592 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
4593
4594         * ecore.cs: Convert the return from Ldlen into an int.
4595
4596 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
4597
4598         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
4599         the accessibility, this is a special case for toplevel non-public
4600         classes (internal for instance).
4601
4602 2003-10-20  Nick Drochak <ndrochak@gol.com>
4603
4604         * ecore.cs: Fix typo and build.  Needed another right paren.
4605
4606 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
4607
4608         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
4609         `internal' case regular and protected, but not allowing protected
4610         to be evaluated later.  Bug 49840
4611
4612 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
4613
4614         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
4615         to kb.Nlast, and not the kb.nFirst to isolate the switch
4616         statement.
4617
4618         Extract the underlying type, so enumerations of long/ulong are
4619         treated like long/ulong.
4620
4621 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
4622
4623         * expression.cs (New): Overload the meaning of RequestedType to
4624         track the possible creation of the NewDelegate type, since
4625         DoResolve is invoked more than once for new constructors on field
4626         initialization.
4627
4628         See bugs: #48800 and #37014
4629
4630         * cs-parser.jay (declare_local_constants): Take an arraylist
4631         instead of a single constant.
4632
4633         (local_constant_declaration): It should take a
4634         constant_declarators, not a constant_declarator.  Fixes 49487
4635
4636         * convert.cs: Fix error report.
4637
4638 2003-10-13 Jackson Harper <jackson@ximian.com>
4639
4640         * typemanager.cs (TypeToCoreType): Add float and double this fixes
4641         bug #49611
4642         
4643 2003-11-03  Martin Baulig  <martin@ximian.com>
4644
4645         * expression.cs (ArrayAccess.GetStoreOpcode): Added
4646         `out bool has_type_arg'; if set, we need to pass the type to
4647         ig.Emit().
4648         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
4649         Stelem_Any/Ldelem_Any for generic parameters.   
4650
4651 2003-11-02  Martin Baulig  <martin@ximian.com>
4652
4653         * expression.cs (Invocation.EmitCall): Use
4654         `TypeManager.IsValueType()' to check whether it's a value type.
4655         Don't set `struct_call' when calling a method on a type parameter.
4656
4657 2003-11-02  Martin Baulig  <martin@ximian.com>
4658
4659         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
4660         and removed the TypeBuilder argument.
4661
4662         * typemanager.cs (TypeManager.IsValueType): Return
4663         `t.IsGenericParameter || t.IsValueType'.
4664
4665 2003-10-25  Martin Baulig  <martin@ximian.com>
4666
4667         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
4668         call ConstructedType.Resolve() on it.
4669
4670         * generic.cs (ConstructedType.Resolve): Set `type' on success.
4671
4672 2003-10-25  Martin Baulig  <martin@ximian.com>
4673
4674         * class.cs (TypeContainer.GetClassBases): Changed
4675         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
4676         CS8214 reporting here.
4677         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
4678         instead of a `Type' for our parent.  In case of a recursive
4679         declaration (see tests/gen-23.cs for an example), our parent is a
4680         ConstructedType and it doesn't have its type set.  So, first
4681         create our own TypeBuilder, then call constructed.Resolve() to get
4682         the parent's type and finally TypeBuilder.SetParent() it.
4683
4684         * ecore.cs (TypeExpr.Name): New public virtual property.
4685
4686         * generic.cs
4687         (ConstructedType): We're now a TypeExpr and not just an Expression.
4688         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
4689         arguments here; this is done later.
4690         (ConstructedType.Resolve): New public method to resolve the type
4691         arguments and bind them.
4692
4693 2003-10-21  Martin Baulig  <martin@ximian.com>
4694
4695         * convert.cs: Use `TypeManager.IsValueType' instead of
4696         'type.IsValueType' everywhere.
4697
4698         * typemanager.cs (TypeManager.IsValueType): Return true for type
4699         parameters.  The reason for this is that we need to box a type
4700         parameter when converting it to a reference type.
4701
4702         * cs-parser.jay: Added support for default value expressions.
4703
4704         * generics.cs (DefaultValueExpression): New public class.       
4705
4706 2003-10-17  Martin Baulig  <martin@ximian.com>
4707
4708         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
4709         TypeContainer so we can also use this for Interfaces.
4710         (TypeParameter.Resolve): Likewise.
4711
4712         * interface.cs (Interface.DefineType): Added support for generic
4713         interfaces.
4714
4715         * cs-parser.jay: Added support for generic structs and interfaces.
4716
4717 2003-10-17  Martin Baulig  <martin@ximian.com>
4718
4719         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
4720         call generic methods :-)
4721
4722 2003-10-16  Martin Baulig  <martin@ximian.com>
4723
4724         * cs-parser.jay (namespace_or_type_name): Only create a
4725         GenericMemberAccess if we actually have type arguments.
4726
4727 2003-10-13  Martin Baulig  <martin@ximian.com>
4728
4729         * class.cs (Method.Define): If we're a generic method, call
4730         TypeBuilder.DefineGenericMethod () before resolving
4731         the parameters.
4732         (MethodData): Added .ctor which takes an additional MethodBuilder
4733         argument; this is used for generic methods.
4734         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
4735         we already have a MethodBuilder.
4736
4737 2003-10-10  Martin Baulig  <martin@ximian.com>
4738
4739         * class.cs (Method): Added .ctor which takes a `GenericMethod'
4740         instead of a `DeclSpace'.  This is used for generic methods.
4741
4742         * cs-parser.jay (method_header): Added support for generic
4743         methods; create a `GenericMethod' instance and pass it to the
4744         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
4745         parameters and locals.
4746
4747         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
4748         since we already have the location.  Check whether we're a generic
4749         type declaration or a generic method and create the correct type
4750         parameter.
4751
4752         * generic.cs (TypeParameter.DefineMethod): New public method.
4753         (GenericMethod): New public class; derives from DeclSpace and is
4754         used for generic methods.       
4755
4756 2003-10-09  Martin Baulig  <martin@ximian.com>
4757
4758         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
4759         to the .ctor.
4760         (MethodCore.DoDefineParameters): Removed the TypeContainer
4761         argument; use the DeclSpace which was passed to the .ctor instead.
4762         (MethodCore.CheckParameter): Take a DeclSpace instead of a
4763         TypeContainer; we only need a DeclSpace here.
4764
4765 2003-10-09  Martin Baulig  <martin@ximian.com>
4766
4767         * class.cs (MethodData): Added additional `DeclSpace ds' argument
4768         to the .ctor.
4769         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
4770         EmitContext's .ctor.    
4771
4772 2003-10-09  Martin Baulig  <martin@ximian.com>
4773
4774         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
4775         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
4776         AsAccessible(), moved them as well.
4777
4778         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
4779
4780 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
4781
4782         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
4783         generation for >=, as spotted by Paolo, bug 48679.  
4784         Patch from David Waite.
4785
4786         * cs-tokenizer.cs: Add handling for #pragma.
4787
4788         * cs-parser.jay: Allow for both yield and yield return in the
4789         syntax.  The anti-cobolization of C# fight will go on!
4790
4791         * class.cs (TypeBuilder.DefineType): Catch error condition here
4792         (Parent.DefineType erroring out and returning null).
4793
4794         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4795         coping with enumerations variables, we were mistakenly processing
4796         them as a regular value type instead of built-in types.  Fixes the
4797         bug #48063
4798
4799         * typemanager.cs (IsBuiltinOrEnum): New method.
4800
4801 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
4802
4803         * cs-parser.jay: Upgrade: yield now needs the return clause.
4804
4805 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
4806
4807         * cs-parser.jay : Renamed yyName to yyNames related to jay.
4808
4809 2003-09-29  Martin Baulig  <martin@ximian.com>
4810
4811         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
4812         inflated generic methods.
4813
4814         * generics.cs (ConstructedType): Distinguish between open and
4815         closed constructed types; correctly resolve the arguments.
4816
4817 2003-09-22  Martin Baulig  <martin@ximian.com>
4818
4819         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
4820         all type arguments meet their constraints.
4821
4822 2003-09-19  Martin Baulig  <martin@ximian.com>
4823
4824         * decl.cs (MemberCache.SetupCacheForInterface): Take a
4825         `MemberCache parent' argument.  Normally, an interface doesn't
4826         have a parent type except System.Object, but we use this in gmcs
4827         for generic type parameters.
4828
4829 2003-09-18  Martin Baulig  <martin@ximian.com>
4830
4831         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
4832         on `type.IsInterface'; don't check whether the type has a parent
4833         to determine whether it's an interface.
4834
4835 2003-09-17  Martin Baulig  <martin@ximian.com>
4836
4837         * generic.cs (ConstructedType.ToString): Always use `name' as the
4838         type name.
4839
4840 2003-09-15  Martin Baulig  <martin@ximian.com>
4841
4842         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
4843
4844         * generic.cs (Constraints.Resolve): New public method; this is
4845         called to resolve the constraint types and to check whether all
4846         the constraints are correct.
4847         (Constraints.Types): New public property.
4848         (TypeParameter.Resolve): New public method; resolves all the
4849         type's constraints.
4850
4851         * class.cs (TypeContainer.DefineType): Call
4852         TypeParameter.Resolve() before actually defining the type.
4853
4854 2003-09-15  Martin Baulig  <martin@ximian.com>
4855
4856         * class.cs (TypeContainer.DefineType): Added an error flag to
4857         avoid reporting duplicate CS0146's ("class definition is
4858         circular.").
4859
4860         * driver.cs (Driver.MainDriver): Abort if
4861         RootContext.ResolveTree() reported any errors.
4862
4863 2003-09-07  Martin Baulig  <martin@ximian.com>
4864
4865         * report.cs (Error, Warning): Added overloaded versions which take
4866         a `params object[] args' and call String.Format().
4867
4868 2003-09-07  Martin Baulig  <martin@ximian.com>
4869
4870         * decl.cs (DeclSpace..ctor): Don't call
4871         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
4872         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
4873         (DeclSpace.RecordDecl): New method.
4874
4875         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
4876
4877 2003-09-02  Ravi Pratap  <ravi@ximian.com>
4878
4879         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
4880         value attributes to be applied to ParameterBuilders.
4881
4882         * class.cs (MethodCore.LabelParameters): Make static and more
4883         generic so that it can be used from other places - like interface
4884         methods, for instance.
4885
4886         * interface.cs (Interface.Emit): Call LabelParameters before
4887         emitting attributes on the InterfaceMethod.
4888
4889 2003-09-07  Martin Baulig  <martin@ximian.com>
4890
4891         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
4892         if the number of type parameters doesn't match.
4893
4894 2003-09-04  Martin Baulig  <martin@ximian.com>
4895
4896         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
4897         for arrays of generic type params (ie. `!0[]').
4898
4899 2003-09-04  Martin Baulig  <martin@ximian.com>
4900
4901         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
4902         for the moment.
4903
4904 2003-09-04  Martin Baulig  <martin@ximian.com>
4905
4906         * decl.cs (DeclSpace.LookupGeneric): New method.
4907         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
4908         moment.
4909
4910         * generic.cs (TypeParameterExpr): Take a TypeParameter as
4911         argument, not just a string.
4912         (TypeParameter.Define): New public method; this is called to
4913         actually define the generic parameter; after this, you can use the
4914         new `Type' property to get the type.
4915
4916 2003-09-04  Martin Baulig  <martin@ximian.com>
4917
4918         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
4919         is now an ArrayList; initialize the result of the `TypeParameters'
4920         property here.
4921         (DeclSpace.GetGenericData): Removed.
4922         (DeclSpace.LookupGeneric): Temporarily removed; we need to
4923         implement this in a different way.
4924         (DeclSpace.GetTypeParameters): Removed; there's now a
4925         `TypeParameters' property.
4926         (DeclSpace.TypeParameters): New public property.
4927
4928         * generic.cs (Constraints): Make this class public.
4929         (TypeParameter): New public class.
4930
4931 2003-09-04  Martin Baulig  <martin@ximian.com>
4932
4933         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
4934         generic parameters.
4935
4936         * class.cs (TypeContainer.DefineType): Call
4937         TypeBuilder.DefineGenericParameter () on all generic parameters if
4938         this is a generic type.
4939
4940 2003-08-28  Martin Baulig  <martin@ximian.com>
4941
4942         * sample-stack.il: Compile this with ilasm: "ilasm /dll
4943         sample-stack.il".
4944
4945         * sample-hello.cs: Compile this with gmcs: "gmcs
4946         /r:sample-stack.dll sample-hello.cs".
4947
4948 2003-08-28  Martin Baulig  <martin@ximian.com>
4949
4950         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
4951         the parameters to the generic type.
4952
4953 2003-08-28  Martin Baulig  <martin@ximian.com>
4954
4955         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
4956
4957 2003-08-28  Martin Baulig  <martin@ximian.com>
4958
4959         * cs-parser.jay (opt_type_argument_list): Use
4960         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
4961         (primary_expression): Replace `qualified_identifier' with `type_name'.
4962         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
4963
4964         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
4965         parser to check whether it is syntactically a type parameter list;
4966         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
4967         this case.
4968
4969 2003-08-26  Martin Baulig  <martin@ximian.com>
4970
4971         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
4972         resolving aliases; fixes #47927.
4973
4974 2003-08-26  Martin Baulig  <martin@ximian.com>
4975
4976         * statement.cs (Using.DoResolve): This is internally emitting a
4977         try/finally clause, so we need to set ec.NeedExplicitReturn if we
4978         do not always return.  Fixes #47681.
4979
4980 2003-08-26  Martin Baulig  <martin@ximian.com>
4981
4982         * decl.cs (MemberCore): Moved WarningNotHiding(),
4983         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
4984         into MemberBase.
4985         (AdditionResult): Make this nested in DeclSpace.
4986         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
4987         argument; call NamespaceEntry.Define() unless we're nested in a
4988         class or struct.
4989
4990         * namespace.cs (Namespace.DefineName): New public function.  This
4991         is called from DeclSpace's .ctor to add 
4992         (Namespace.Lookup): Include DeclSpaces in the lookup.
4993
4994         * class.cs (Operator): Derive from MemberBase, not MemberCore.
4995
4996         * const.cs (Const): Derive from MemberBase, not MemberCore.     
4997
4998 2003-08-25  Martin Baulig  <martin@ximian.com>
4999
5000         * convert.cs (Convert.ExplicitReferenceConversion): When
5001         converting from an interface type to a class, unbox if the target
5002         type is a struct type.  Fixes #47822.
5003
5004 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5005
5006         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
5007         #47854.
5008
5009 2003-08-22  Martin Baulig  <martin@ximian.com>
5010
5011         * class.cs (TypeManager.DefineType): When defining a nested type,
5012         call DefineType() on our parent; fixes #47801.
5013
5014 2003-08-22  Martin Baulig  <martin@ximian.com>
5015
5016         * class.cs (MethodData.Define): While checking if a method is an
5017         interface implementation, improve the test a bit more to fix #47654.
5018
5019 2003-08-22  Martin Baulig  <martin@ximian.com>
5020
5021         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
5022         correctly; fixes #47722.
5023
5024 2003-08-22  Martin Baulig  <martin@ximian.com>
5025
5026         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
5027         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
5028
5029         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
5030
5031 2003-08-22  Martin Baulig  <martin@ximian.com>
5032
5033         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
5034         can only be assigned in static constructors.  Fixes #47161.
5035
5036 2003-08-22  Martin Baulig  <martin@ximian.com>
5037
5038         Rewrote and improved the flow analysis code.
5039
5040         * flowbranching.cs (FlowBranching): Make this class abstract.
5041         (FlowBranching.CreateBranching): New static function to create a
5042         new flow branching.
5043         (FlowBranchingBlock, FlowBranchingException): New classes.
5044         (FlowBranching.UsageVector.Type): New public readonly field.
5045         (FlowBranching.UsageVector.Breaks): Removed the setter.
5046         (FlowBranching.UsageVector.Returns): Removed the setter.
5047         (FlowBranching.UsageVector): Added Break(), Return(),
5048         NeverReachable() and Throw() methods to modify the reachability.
5049         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
5050         done by FlowBranching.Merge().
5051         (FlowBranching.UsageVector.MergeChild): New method; merges the
5052         merge result into the current vector.
5053         (FlowBranching.Merge): New abstract method to merge a branching.
5054
5055 2003-08-12  Martin Baulig  <martin@ximian.com>
5056
5057         * expression.cs (Indirection.CacheTemporaries): Create the
5058         LocalTemporary with the pointer type, not its element type.
5059
5060 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
5061
5062         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
5063         token was a keyword or not.
5064
5065         Add `error' options where an IDENTIFIER was expected;  Provide
5066         CheckToken and CheckIdentifierToken convenience error reporting
5067         functions. 
5068
5069         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
5070
5071         * decl.cs: Rename `NamespaceEntry Namespace' public field into
5072         NameSpaceEntry NameSpaceEntry.
5073
5074         (LookupInterfaceOrClass): Avoid creating a full qualified name
5075         from namespace and name: avoid doing lookups when we know the
5076         namespace is non-existant.   Use new Tree.LookupByNamespace which
5077         looks up DeclSpaces based on their namespace, name pair.
5078
5079         * driver.cs: Provide a new `parser verbose' to display the
5080         exception thrown during parsing.  This is turned off by default
5081         now, so the output of a failure from mcs is more graceful.
5082
5083         * namespace.cs: Track all the namespaces defined in a hashtable
5084         for quick lookup.
5085
5086         (IsNamespace): New method
5087
5088 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
5089
5090         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
5091         we know that we need to concatenate (full typename can never be
5092         null). 
5093
5094         * class.cs: ditto.
5095
5096         * statement.cs: Use a bitfield;  Do not initialize to null things
5097         which are done by the constructor by default.
5098
5099         * cs-parser.jay: bug fix, parameter was 4, not 3.
5100
5101         * expression.cs: Just use the property;
5102
5103         * statement.cs: No need for GetVariableInfo method.
5104
5105 2003-08-08  Martin Baulig  <martin@ximian.com>
5106
5107         * flowanalysis.cs (FlowReturns): This is now nested in the
5108         `FlowBranching' class.
5109         (MyBitVector): Moved this here from statement.cs.
5110         (FlowBranching.SiblingType): New enum type.
5111         (FlowBranching.CreateSibling): Added `SiblingType' argument.
5112
5113 2003-08-07  Martin Baulig  <martin@ximian.com>
5114
5115         * flowanalysis.cs (FlowBranchingType): This is now nested in the
5116         `FlowBranching' class and called `BranchingType'.
5117
5118 2003-08-07  Martin Baulig  <martin@ximian.com>
5119
5120         * flowanalysis.cs: Moved all the control flow analysis code into
5121         its own file.
5122
5123 2003-08-07  Martin Baulig  <martin@ximian.com>
5124
5125         * assign.cs (Assign.DoResolve): `target' must either be an
5126         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
5127         #37319.
5128
5129 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
5130
5131         * expression.cs (BinaryMethod): This kind of expression is created by the
5132         Binary class if it determines that the operator has to be handled
5133         by a method.
5134
5135         (BinaryDelegate): This kind of expression is created if we are
5136         dealing with a + or - operator on delegates.
5137
5138         (Binary): remove method, argumetns, and DelegateOperator: when
5139         dealing with methods, 
5140
5141         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
5142
5143         * statement.cs (Block): use bitfields for the three extra booleans
5144         we had in use.   Remove unused topblock parameter.
5145
5146         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
5147
5148         * assign.cs: Drop extra unneeded tests.
5149
5150 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
5151
5152         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
5153
5154         * statement.cs (Foreach): Use VariableStorage instead of
5155         LocalBuilders.   
5156
5157         * codegen.cs (VariableStorage): New class used by clients that
5158         require a variable stored: locals or fields for variables that
5159         need to live across yield.
5160
5161         Maybe provide a convenience api for EmitThis+EmitLoad?
5162
5163         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
5164         these bad boys.
5165
5166 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
5167
5168         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
5169         RemapParameterLValue): New methods that are used to turn a
5170         precomputed FieldInfo into an expression like this:
5171
5172                 instance.FieldInfo
5173
5174         The idea is to use this instead of making LocalVariableReference
5175         have more than one meaning.
5176
5177         * cs-parser.jay: Add error production to BASE.
5178
5179         * ecore.cs: Deal with TypeManager.GetField returning null, which
5180         is now a valid return value.
5181
5182         (FieldExprNoAddress): New expression for Fields whose address can
5183         not be taken.
5184
5185         * expression.cs (LocalVariableReference): During the resolve
5186         phases, create new expressions if we are in a remapping context.
5187         Remove code that dealt with remapping here.
5188
5189         (ParameterReference): same.
5190
5191         (ProxyInstance): New expression, like the `This' expression, but
5192         it is born fully resolved.  We know what we are doing, so remove
5193         the errors that are targeted to user-provided uses of `this'.
5194
5195         * statement.cs (Foreach): our variable is now stored as an
5196         Expression;  During resolution, follow the protocol, dont just
5197         assume it will return this.
5198
5199 2003-08-06  Martin Baulig  <martin@ximian.com>
5200
5201         * support.cs (SeekableStreamReader.cs): New public class.
5202
5203         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
5204         SeekableStreamReader instead of the normal StreamReader.
5205
5206 2003-08-04  Martin Baulig  <martin@ximian.com>
5207
5208         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
5209         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
5210         deambiguate casts and delegate invocations.
5211         (parenthesized_expression): Use the new tokens to ensure this is
5212         not a cast of method invocation.
5213
5214         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
5215         when reading a `)' and Deambiguate_CloseParens () was previously
5216         called.
5217
5218         * expression.cs (ParenthesizedExpression): New class.  This is
5219         just used for the CS0075 test.
5220         (Binary.DoResolve): Check for CS0075.   
5221
5222 2003-07-29  Ravi Pratap  <ravi@ximian.com>
5223
5224         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
5225         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
5226         reference comparison.
5227
5228         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
5229         examine the ReturnType for equality - this is necessary in the
5230         cases of implicit and explicit operators whose signature also
5231         includes the return type.
5232
5233 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
5234
5235         * namespace.cs: Cache the result of the namespace computation,
5236         instead of computing it every time.
5237
5238 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
5239
5240         * decl.cs: Use a global arraylist that we reuse over invocations
5241         to avoid excesive memory consumption.  Reduces memory usage on an
5242         mcs compile by one meg (45 average).
5243
5244         * typemanager.cs (LookupTypeReflection): In .NET pointers are
5245         private, work around that.
5246
5247 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
5248
5249         * literal.cs (IntLiteral): Define Zero and One static literals. 
5250
5251         * cs-parser.jay (integer_literal): use static literals to reduce
5252         memory usage for the most used literals (0, 1 and -1).  211kb
5253         reduced in memory usage.
5254
5255         Replace all calls to `new ArrayList' with `new
5256         ArrayList(4)' which is a good average number for most allocations,
5257         and also requires only 16 bytes of memory for its buffer by
5258         default. 
5259
5260         This reduced MCS memory usage in seven megabytes for the RSS after
5261         bootstrapping.
5262
5263 2003-07-28  Ravi Pratap  <ravi@ximian.com>
5264
5265         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
5266         handle params methods the correct way by forming only one
5267         applicable set with params and normal methods in them. Earlier we
5268         were looking at params methods only if we found no normal methods
5269         which was not the correct thing to do.
5270
5271         (Invocation.BetterFunction): Take separate arguments indicating
5272         when candidate and the best method are params methods in their
5273         expanded form.
5274
5275         This fixes bugs #43367 and #46199.
5276
5277         * attribute.cs: Documentation updates.
5278
5279         (CheckAttribute): Rename to CheckAttributeTarget.
5280         (GetValidPlaces): Rename to GetValidTargets.
5281
5282         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
5283         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
5284
5285         Fixes bug #44468.
5286
5287 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
5288
5289         * codegen.cs: Compute IsGeneric correctly.
5290
5291         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
5292         resolution. 
5293
5294         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
5295         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
5296         regressions, and I was chasing more bugs than I required.
5297
5298         * interface.cs: Use expressions for base type names (like classes
5299         and structs have been doing for a while now), and resolve that.
5300         This patch should probably go into head as well.
5301
5302         This makes it one less user of FindType.
5303
5304 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
5305
5306         This compiler can not self host currently.  Need to fix that.
5307         
5308         * Makefile: compile to `gmcs.exe'
5309
5310         * driver.cs: Turn on v2 by default on gmcs.
5311
5312         * generic.cs (ConstructedType): Does no longer take a container
5313         type argument;  That will be taken care of later.
5314
5315         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
5316         Use SimpleName to resolve for now, so we can continue the work on
5317         the parser, until we get Type.GetType that understands generics.
5318
5319         (ConstructedType.ToString): Implement
5320
5321         (TypeArguments.Resolve): Resolve the child expressions as types. 
5322         
5323         * cs-parser.jay: Rename interface_constraints to
5324         type_parameter_constraints
5325
5326         (namespace_or_type_name): Only use constructed types for the basic
5327         construction, we will deal with identifier<...> later.
5328
5329         (type/type_name): No longer call DecomposeQI, as
5330         namespace_or_type_name is always decoded now.
5331         
5332 2003-07-22  Ravi Pratap  <ravi@ximian.com>
5333
5334         * expression.cs (Invocation.OverloadResolve): Follow the spec more
5335         closely: we eliminate methods in base types when we have an
5336         applicable method in a top-level type.
5337
5338         Please see section 14.5.5.1 for an exact description of what goes
5339         on. 
5340
5341         This fixes bug #45127 and a host of other related to corlib compilation.
5342
5343         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
5344         array is the method corresponding to the top-level type (this is
5345         because of the changes made to icall.c) so we change this
5346         accordingly.
5347
5348         (MethodGroupExpr.Name): This too.
5349
5350         * typemanager.cs (GetElementType): New method which does the right
5351         thing when compiling corlib. 
5352
5353         * everywhere: Make use of the above in the relevant places.
5354
5355 2003-07-22  Martin Baulig  <martin@ximian.com>
5356
5357         * cs-parser.jay (invocation_expression): Moved
5358         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
5359         `cast_expression', but create a InvocationOrCast which later
5360         resolves to either an Invocation or a Cast.
5361
5362         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
5363         method; call this before EmitStatement() to make sure that this
5364         expression can be used as a statement.
5365
5366         * expression.cs (InvocationOrCast): New class; resolves to either
5367         an Invocation or a Cast.
5368
5369         * statement.cs (StatementExpression): Call ResolveStatement() on
5370         the ExpressionStatement before emitting it.
5371
5372 2003-07-21  Martin Baulig  <martin@ximian.com>
5373
5374         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
5375         `ref' and `out' attributes match; fixes #46220.
5376         (MemberAccess.ResolveMemberAccess): You can't reference a type
5377         through an expression; fixes #33180.
5378         (Indexers.GetIndexersForType): Don't return the indexers from
5379         interfaces the class implements; fixes #46502.
5380
5381 2003-07-21  Martin Baulig  <martin@ximian.com>
5382
5383         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
5384         CS0661 checks; fixes bug #30442.
5385
5386 2003-07-21  Martin Baulig  <martin@ximian.com>
5387
5388         * decl.cs (AdditionResult): Added `Error'.
5389
5390         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
5391
5392         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
5393         cs0031.cs actually work.
5394
5395  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
5396  
5397         * cs-parser.jay (namespace_name): do not use
5398         namespace_or_type_name, use qualified_identifier, because
5399         namespace_or_type_name will soon return a composed expression
5400         instead of a string.
5401  
5402         (namespace_or_type_name): Instead of returning a string, now this
5403         production returns an expression.
5404  
5405         * codegen.cs (EmitContext): Setup IsGeneric property based on
5406         whether our DeclSpace is generic, our the method is generic.
5407  
5408         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
5409         the method is generic.
5410  
5411         * cs-parser.jay (type_arguments, opt_type_argument_list,
5412         type_parameters, type_parameter_list, opt_type_parameter_list,
5413         type_parameter,, opt_type_parameter_constraints_clauses,
5414         type_parameter_constraints_clauses,
5415         type_parameter_constraint_clause, type_parameter_constraint,
5416         interface_constraints): Add new production
5417  
5418         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
5419         DeclSpace is generic or not.
5420  
5421         (DeclSpace.SetParameterInfo): New routine, used to set the
5422         parameter info for a type.
5423  
5424         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
5425         returns a GenericTypeExpr
5426  
5427         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
5428         generic, lookup the generic argument.
5429  
5430         * attribute.cs: Do not allow TypeParameterExpressions in
5431         Attributes.
5432  
5433         * class.cs: Do not allow the Main method to be defined in a
5434         Generic container.
5435  
5436         * expression.cs (SizeOf): Do not allow generic types to be used as
5437         arguments to sizeof.
5438  
5439         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
5440         it: whether a type is generic or not.  Only works for types we are
5441         currently building for now.
5442         
5443 2003-07-20  Martin Baulig  <martin@ximian.com>
5444
5445         * namespace.cs: Fixed that bug which caused a crash when compiling
5446         the debugger's GUI.
5447
5448 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
5449
5450         * typemanager.cs (LookupTypeReflection): Never expose types which
5451         are NotPublic, NestedPrivate, NestedAssembly, or
5452         NestedFamANDAssem.  We used to return these, and later do a check
5453         that would report a meaningful error, but the problem is that we
5454         would not get the real match, if there was a name override.
5455
5456 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
5457
5458         * namespace.cs (Namespace, Name): Do not compute the namespace
5459         name dynamically, compute it in the constructor.  This reduced
5460         memory usage by 1697 KB.
5461
5462         * driver.cs: Use --pause to pause at the end.
5463
5464 2003-07-17  Peter Williams  <peter@newton.cx>
5465
5466         * Makefile: Change the name of the test target so that it doesn't
5467         conflict with the recursive test target.
5468
5469 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
5470
5471         * expression.cs (LocalVariableReference.Emit, EmitAssign,
5472         AddressOf): Do not use EmitThis, that was wrong, use the actual
5473         this pointer.
5474
5475 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
5476
5477         * class.cs (MethodData.Define): While checking if a method is an
5478         interface implementation, improve the test: If we are not public
5479         (use new test here: use the computed MethodAttributes directly,
5480         instead of the parsed modifier flags) check if the `implementing'
5481         method comes from an interface or not.
5482
5483         * pending.cs (VerifyPendingMethods): Slightly better error
5484         message.
5485
5486         * makefile: add test target that does the mcs bootstrap.
5487
5488 2003-07-16  Ravi Pratap  <ravi@ximian.com>
5489
5490         * interface.cs (Define): Do nothing here since there are no
5491         members to populate etc. Move the attribute emission out of here
5492         since this was just totally the wrong place to put it. Attribute
5493         application happens during the 'Emit' phase, not in the 'Define'
5494         phase.
5495
5496         (Emit): Add this method and move the attribute emission here
5497
5498         * rootcontext.cs (EmitCode): Call the Emit method on interface
5499         types too.
5500
5501 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5502
5503         * expression.cs (OverloadResolve): Report error only if Location
5504         is not 'Null' which means that there was a probe going on.
5505
5506 2003-07-14  Martin Baulig  <martin@ximian.com>
5507
5508         * expression.cs (ConditionalLogicalOperator): New public class to
5509         implement user defined conditional logical operators.
5510         This is section 14.11.2 in the spec and bug #40505.
5511
5512 2003-07-14  Martin Baulig  <martin@ximian.com>
5513
5514         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
5515
5516 2003-07-14  Martin Baulig  <martin@ximian.com>
5517
5518         * codegen.cs (EmitContext.InFixedInitializer): New public field.
5519
5520         * ecore.cs (IVariable.VerifyFixed): New interface method.
5521
5522         * expression.cs (Unary.ResolveOperator): When resolving the `&'
5523         operator, check whether the variable is actually fixed.  Fixes bug
5524         #36055.  Set a variable definitely assigned when taking its
5525         address as required by the spec.
5526
5527         * statement.cs (LocalInfo.IsFixed): New field.
5528         (LocalInfo.MakePinned): Set `IsFixed' to true.
5529
5530 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
5531
5532         * attribute.cs (Attribute.Resolve): While doing a Member lookup
5533         for .ctors, ensure that we only ask for members declared in the
5534         attribute type (BindingFlags.DeclaredOnly).
5535
5536         Fixes bug #43632.
5537
5538         * expression.cs (Error_WrongNumArguments): Report error 1501
5539         correctly the way CSC does.
5540
5541 2003-07-13  Martin Baulig  <martin@ximian.com>
5542
5543         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
5544         lookup on the fully qualified name, to make things like "X.X" work
5545         where "X.X" is a fully qualified type name, but we also have a
5546         namespace "X" in the using list.  Fixes #41975.
5547
5548 2003-07-13  Martin Baulig  <martin@ximian.com>
5549
5550         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
5551         function. If we're a CompoundAssign, we need to create an embedded
5552         CompoundAssign, not an embedded Assign.
5553         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
5554         Fixes #45854.
5555
5556 2003-07-13  Martin Baulig  <martin@ximian.com>
5557
5558         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
5559         work to fix bug #46088.
5560
5561 2003-07-13  Ravi Pratap <ravi@ximian.com>
5562
5563         * class.cs (Operator.Emit): Do not emit attributes here - it is
5564         taken care of by the Method class that we delegate too. This takes
5565         care of bug #45876.
5566
5567 2003-07-10  Martin Baulig  <martin@ximian.com>
5568
5569         * expression.cs (TypeOfVoid): New class.
5570         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
5571
5572 2003-07-10  Martin Baulig  <martin@ximian.com>
5573
5574         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
5575         bug #35957.
5576
5577 2003-07-10  Martin Baulig  <martin@ximian.com>
5578
5579         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
5580         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
5581
5582         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
5583
5584         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
5585
5586 2003-07-10  Martin Baulig  <martin@ximian.com>
5587
5588         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
5589         of decimal.  Fixes #42850.
5590
5591         NOTE: I also fixed the created byte blob, but this doesn't work on
5592         the MS runtime and csc never produces any byte blobs for decimal
5593         arrays.
5594
5595 2003-07-10  Martin Baulig  <martin@ximian.com>
5596
5597         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
5598         structs; fixes #32068.
5599         (Block.AddChildVariableNames): Fixed #44302.
5600
5601 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5602
5603         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
5604
5605 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5606
5607         * attribute.cs: And this test is onger needed.
5608
5609 2003-07-08  Martin Baulig  <martin@ximian.com>
5610
5611         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
5612         inaccessible types.  Fixes #36313.
5613
5614         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
5615
5616         * namespace.cs (NamespaceEntry): Create implicit entries for all
5617         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
5618         implicit entries for N1.N2 and N1.
5619
5620 2003-07-08  Martin Baulig  <martin@ximian.com>
5621
5622         Rewrote the handling of namespaces to fix a lot of the issues
5623         wrt. `using' aliases etc.
5624
5625         * namespace.cs (Namespace): Splitted this class into a
5626         per-assembly `Namespace' and a per-file `NamespaceEntry'.
5627
5628         * typemanager.cs (TypeManager.IsNamespace): Removed.
5629         (TypeManager.ComputeNamespaces): Only compute namespaces from
5630         loaded assemblies here, not the namespaces from the assembly we're
5631         currently compiling.
5632
5633 2003-07-08  Martin Baulig  <martin@ximian.com>
5634
5635         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
5636
5637 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5638
5639         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
5640         already fixed it.  
5641
5642         I thought about the memory savings here, but LookupTypeReflection
5643         is used under already very constrained scenarios.  Compiling
5644         corlib or mcs only exposes one hit, so it would not really reduce
5645         any memory consumption.
5646
5647 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5648
5649         * typemanager.cs: fixes bug #45889 by only adding public types from
5650         other assemblies to the list of known types.
5651
5652 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5653
5654         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
5655         on the type we resolved.
5656
5657 2003-07-05  Martin Baulig  <martin@ximian.com>
5658
5659         * pending.cs (PendingImplementation.ParentImplements): Don't
5660         create the proxy if the parent is abstract.
5661
5662         * class.cs (TypeContainer.DefineIndexers): Process explicit
5663         interface implementations first.  Fixes #37714.
5664
5665 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
5666
5667         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
5668         defined recursively;  but since we modify the input parameters
5669         (left is set to `this' temporarily), we reset this value if the
5670         left_is_explicit is false, which gives the original semantics to
5671         the code.  
5672
5673         * literal.cs (NullPointer): new class used to represent a null
5674         literal in a pointer context.
5675
5676         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
5677         type is a pointer, use a NullPointer object instead of a
5678         NullLiteral.   Closes 43687
5679
5680         (ExplicitConversion): Convert pointer values using
5681         the conv opcode to the proper type.
5682
5683         * ecore.cs (New): change ValueTypeVariable property into a method,
5684         that returns whether the valuetype is suitable for being used.
5685
5686         * expression.cs (Binary.DoNumericPromotions): Only return if we
5687         the int constant was a valid uint, and we can return both left and
5688         right as uints.  If not, we continue processing, to trigger the
5689         type conversion.  This fixes 39018.
5690
5691         * statement.cs (Block.EmitMeta): During constant resolution, set
5692         the CurrentBlock property on the emitcontext, so that we resolve
5693         constants propertly.
5694
5695 2003-07-02  Martin Baulig  <martin@ximian.com>
5696
5697         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
5698         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
5699
5700         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
5701         than emitting it here.
5702
5703         * statement.cs: Fixed some more flow analysis bugs.
5704
5705 2003-07-02  Martin Baulig  <martin@ximian.com>
5706
5707         * class.cs (MethodData.Define): When implementing interface
5708         methods, set Final unless we're Virtual.
5709
5710         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
5711         check work for interface methods.
5712
5713 2003-07-01  Martin Baulig  <martin@ximian.com>
5714
5715         * ecore.cs (EmitContext.This): Replaced this property with a
5716         GetThis() method which takes a Location argument.  This ensures
5717         that we get the correct error location for a CS0188.
5718
5719 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
5720
5721         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
5722         ImplicitStandardConversion.
5723
5724         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
5725
5726 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
5727
5728         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
5729         optimization.
5730
5731 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
5732
5733         * class.cs (Constructor.Define): Turn off initlocals for unsafe
5734         constructors.
5735
5736         (MethodData.Define): Turn off initlocals for unsafe methods.
5737
5738 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
5739
5740         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
5741         complete;  Fixes #37521.
5742
5743         * delegate.cs: Use Modifiers.TypeAttr to compute the
5744         TypeAttributes, instead of rolling our own.  This makes the flags
5745         correct for the delegates.
5746
5747 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
5748
5749         * class.cs (Constructor.Define): Set the private flag for static
5750         constructors as well.
5751
5752         * cs-parser.jay (statement_expression): Set the return value to
5753         null, to avoid a crash when we catch an error.
5754
5755 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
5756
5757         * cs-parser.jay: Applied patch from Jackson that adds support for
5758         extern and unsafe modifiers to destructor declarations.
5759
5760         * expression.cs: Report error 21 if the user is trying to index a
5761         System.Array.
5762
5763         * driver.cs: Add an error message, suggested by the bug report.
5764
5765         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
5766         if we do not have a ": this ()" constructor initializer.  Fixes 45149
5767
5768 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
5769
5770         * namespace.cs: Add some information to reduce FAQs.
5771
5772 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
5773
5774         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
5775         underlying enumeration types.  Fixes #43915.
5776
5777         * expression.cs: Treat ushort/short as legal values to be used in
5778         bitwise operations.
5779
5780 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
5781
5782         * delegate.cs: transfer custom attributes for paramenters from
5783         the delegate declaration to Invoke and BeginInvoke.
5784
5785 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
5786
5787         * attribute.cs: handle custom marshalers and emit marshal info
5788         for fields, too.
5789
5790 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
5791
5792         * makefile.gnu: Added anonymous.cs to the compiler sources.
5793
5794 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
5795
5796         * iterators.cs: Change the name of the proxy class to include two
5797         underscores.
5798
5799         * cs-parser.jay: Update grammar to include anonymous methods.
5800
5801         * anonymous.cs: new file.
5802
5803 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
5804
5805         * class.cs (Field.Define): Add missing test for pointers and
5806         safety. 
5807
5808 2003-05-27  Ravi Pratap  <ravi@ximian.com>
5809
5810         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
5811         we use the stobj opcode.
5812
5813         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
5814         since it wasn't the correct fix. 
5815
5816         It still is puzzling that we are required to use stobj for IntPtr
5817         which seems to be a ValueType.
5818
5819 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
5820
5821         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
5822         during regular simple name resolution.   Now, the trick is that
5823         instead of returning for processing the simplename, we do a
5824         TypeManager.LookupType (ie, a rooted lookup as opposed to a
5825         contextual lookup type).   If a match is found, return that, if
5826         not, return for further composition.
5827
5828         This fixes long-standing 30485.
5829
5830         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
5831         using the address to initialize an object, do an Stobj instead of
5832         using the regular Stelem.
5833
5834         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
5835         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
5836         Because if we are a BaseIndexerAccess that value will be true.
5837         Fixes 43643.
5838
5839         * statement.cs (GotoCase.Resolve): Return after reporting an
5840         error, do not attempt to continue. 
5841
5842         * expression.cs (PointerArithmetic.Emit): If our operand is a
5843         long, convert our constants to match the operand before
5844         multiplying.  Convert to I type before adding.   Fixes 43670.
5845
5846 2003-05-14  Ravi Pratap  <ravi@ximian.com>
5847
5848         * enum.cs (ImplicitConversionExists) : Rename to
5849         ImplicitEnumConversionExists to remove ambiguity. 
5850
5851         * ecore.cs (NullCast): New type of cast expression class which
5852         basically is very similar to EmptyCast with the difference being
5853         it still is a constant since it is used only to cast a null to
5854         something else
5855         (eg. (string) null)
5856
5857         * convert.cs (ImplicitReferenceConversion): When casting a null
5858         literal, we return a NullCast.
5859
5860         * literal.cs (NullLiteralTyped): Remove - I don't see why this
5861         should be around anymore.
5862
5863         The renaming (reported was slightly wrong). Corrections:
5864
5865         ConvertImplicitStandard -> ImplicitConversionStandard
5866         ConvertExplicitStandard -> ExplicitConversionStandard
5867
5868         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
5869         before passing them in !
5870
5871         * convert.cs (ImplicitConversionStandard): When comparing for
5872         equal expr and target types, ensure that expr is not a
5873         NullLiteral.
5874
5875         In general, we must not be checking (expr_type ==
5876         target_type) in the top level conversion methods
5877         (ImplicitConversion, ExplicitConversion etc). This checking is
5878         done in the methods that they delegate to.
5879
5880 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
5881
5882         * convert.cs: Move Error_CannotConvertType,
5883         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
5884         ImplicitNumericConversion, ImplicitConversionExists,
5885         ImplicitUserConversionExists, StandardConversionExists,
5886         FindMostEncompassedType, FindMostSpecificSource,
5887         FindMostSpecificTarget, ImplicitUserConversion,
5888         ExplicitUserConversion, GetConversionOperators,
5889         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
5890         TryImplicitIntConversion, Error_CannotConvertImplicit,
5891         ConvertImplicitRequired, ConvertNumericExplicit,
5892         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
5893         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
5894         its own file.
5895
5896         Perform the following renames:
5897
5898         StandardConversionExists -> ImplicitStandardConversionExists
5899         ConvertImplicit -> ImplicitConversion
5900         ConvertImplicitStandard -> ImplicitStandardConversion
5901         TryImplicitIntConversion -> ImplicitIntConversion
5902         ConvertImplicitRequired -> ImplicitConversionRequired
5903         ConvertNumericExplicit -> ExplicitNumericConversion
5904         ConvertReferenceExplicit -> ExplicitReferenceConversion
5905         ConvertExplicit -> ExplicitConversion
5906         ConvertExplicitStandard -> ExplicitStandardConversion
5907
5908 2003-05-19  Martin Baulig  <martin@ximian.com>
5909
5910         * statement.cs (TypeInfo.StructInfo): Made this type protected.
5911         (TypeInfo): Added support for structs having structs as fields.
5912
5913         * ecore.cs (FieldExpr): Implement IVariable.
5914         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
5915         VariableInfo for the field.
5916
5917 2003-05-18  Martin Baulig  <martin@ximian.com>
5918
5919         * expression.cs (This.DoResolve): Report a CS0027 if we're
5920         emitting a field initializer.
5921
5922 2003-05-18  Martin Baulig  <martin@ximian.com>
5923
5924         * expression.cs (This.ResolveBase): New public function.
5925         (This.DoResolve): Check for CS0188.
5926
5927         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
5928         This.Resolve().
5929
5930         * ecore.cs (MethodGroupExpr.DoResolve): Set the
5931         `instance_expression' to null if we don't have any non-static
5932         methods.
5933
5934 2003-05-18  Martin Baulig  <martin@ximian.com>
5935
5936         Reworked the way how local variables and parameters are handled by
5937         the flow analysis code.
5938
5939         * statement.cs (TypeInfo, VariableMap): New public classes.
5940         (VariableInfo): New public class.  This is now responsible for
5941         checking whether a variable has been assigned.  It is used for
5942         parameters and local variables.
5943         (Block.EmitMeta): Take the InternalParameters as argument; compute
5944         the layout of the flow vectors here.
5945         (Block.LocalMap, Block.ParameterMap): New public properties.
5946         (FlowBranching): The .ctor doesn't get the InternalParameters
5947         anymore since Block.EmitMeta() now computes the layout of the flow
5948         vector.
5949         (MyStructInfo): This class is now known as `StructInfo' and nested
5950         in `TypeInfo'; we don't access this directly anymore.
5951
5952         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
5953         property and removed IsAssigned(), IsFieldAssigned(),
5954         SetAssigned() and SetFieldAssigned(); we now call them on the
5955         VariableInfo so we don't need to duplicate this code everywhere.
5956
5957         * expression.cs (ParameterReference): Added `Block block' argument
5958         to the .ctor.
5959         (LocalVariableReference, ParameterReference, This): The new
5960         VariableInfo class is now responsible for all the definite
5961         assignment stuff.
5962
5963         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
5964         IsParameterAssigned, SetParameterAssigned): Removed.
5965
5966 2003-05-18  Martin Baulig  <martin@ximian.com>
5967
5968         * typemanager.cs (InitCoreTypes): Try calling
5969         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
5970         the 3-args-version.  Corlib now also needs our `void_type'.
5971         (GetMethod): Added overloaded version which takes an optional
5972         `bool report_errors' to allow lookups of optional methods.
5973
5974 2003-05-12  Martin Baulig  <martin@ximian.com>
5975
5976         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
5977         only used for locals and not for parameters.
5978
5979 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
5980
5981         * support.cs (InternalParameters.ParameterType): Return the
5982         ExternalType of the parameter.
5983
5984         * parameter.cs (Parameter.ExternalType): drop the two arguments,
5985         they were unused.
5986
5987 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
5988
5989         * class.cs (MethodData.Define): Do not set the `newslot' on
5990         interface members, if they are also flagged as "override".
5991
5992         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
5993         better code for ++i and i++.  This only works for static fields
5994         and local variables.
5995
5996         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
5997         want to pull the DeclSpace out of the builder_to_declspace instead
5998         of the TypeBuilder (like in TypeContainer.FindMembers).
5999
6000         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
6001         instead of LookupTypeContainer.  Fixes the crash on .NET for
6002         looking up interface members.
6003
6004         * const.cs: Create our own emit context during the Definition
6005         stage, so that constants are evaluated in the proper context, when
6006         a recursive definition happens.
6007
6008 2003-05-11  Martin Baulig  <martin@ximian.com>
6009
6010         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
6011         new block for a switch section.
6012         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
6013         the adding/lookup in the switch block.  Fixes #39828.
6014
6015 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
6016
6017         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
6018         functionality: I needed to convert the data after I had performed
6019         the add/sub operation into the operands type size.
6020
6021         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
6022         pass the type for the box operation, otherwise the resulting
6023         object would have been of type object.
6024
6025         (BoxedCast): Add constructor to specify the type to box as.
6026
6027 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
6028
6029         * iterators.cs: I was reusing the `count' variable inadvertently,
6030         take steps to not allow this to happen.
6031
6032 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
6033
6034         * attribute.cs (Attribute.Resolve): Params attributes are encoded
6035         by creating an array at the point where the params starts and
6036         putting all those arguments there, then adjusting the size of the
6037         array.
6038
6039 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
6040
6041         * expression.cs (New.AddressOf): Implement interface
6042         IMemoryLocation.  This is used when the `new' operator is used in
6043         the context of an invocation to a method on a value type.
6044
6045         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
6046         example. 
6047
6048         * namespace.cs: Also check the using aliases here.
6049
6050         * driver.cs: Move the test for using validity after the types have
6051         been entered, so we do a single pass that also includes the using
6052         aliases. 
6053
6054         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
6055         in the regular case.   CreateSiblingForFinally is doing extra
6056         error checking.
6057
6058         * attribute.cs (GetAttributeArgumentExpression): Store the result
6059         on an out value, and use the return value to indicate failure
6060         instead of using null (which is a valid return for Constant.GetValue).
6061
6062         * statement.cs: Perform the analysis flow for the increment
6063         portion after the statement, because this will be the real flow of
6064         execution.  Fixes #42385
6065
6066         * codegen.cs (EmitContext.EmitArgument,
6067         EmitContext.EmitStoreArgument): New helper functions when the
6068         RemapToProxy flag is set.
6069
6070         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
6071         function.
6072
6073         Add support for remapping parameters. 
6074
6075         * iterators.cs: Propagate parameter values;  Store parameter
6076         values in the proxy classes.
6077
6078 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
6079
6080         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
6081         need a proxy reference;  I do not know what I was thinking
6082
6083         * cs-parser.jay (constructor_initializer): catch another error,
6084         and display nice message.
6085
6086         (field_declaration): catch void field declaration
6087         to flag a better error. 
6088
6089         * class.cs (MemberBase.CheckBase): Report an error instead of a
6090         warning if a new protected member is declared in a struct. 
6091         (Field.Define): catch the error of readonly/volatile.
6092
6093         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
6094
6095         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
6096         volatile variable is taken
6097
6098 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
6099
6100         * statement.cs (Fixed.Resolve): Report an error if we are not in
6101         an unsafe context.
6102
6103 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
6104
6105         * typemanager.cs: reuse the code that handles type clashes for
6106         delegates and enumerations.
6107
6108         * class.cs (Report28): Always report.
6109
6110         * expression.cs (EncodeAsAttribute): Allow nulls here.
6111
6112 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
6113
6114         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
6115         the functionality for testing whether an expression is valid for
6116         an attribute here.  Also handle the case of arrays of elements
6117         being stored. 
6118
6119         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
6120         encoding a linear array into an array of objects that are suitable
6121         to be passed to an CustomAttributeBuilder.
6122
6123         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
6124
6125         * ecore.cs: (FieldExpr): Handle field remapping here.
6126
6127         * iteratators.cs: Pass the instance variable (if the method is an
6128         instance method) to the constructors, so we can access the field
6129         variables on the class.
6130
6131         TODO: Test this with structs.  I think the THIS variable on
6132         structs might have to be a pointer, and not a refenrece
6133
6134 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
6135
6136         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
6137         local variables to fields in a proxy class.
6138
6139         * iterators.cs (PopulateProxy): Rename our internal fields to
6140         <XXX>.  
6141         Create a <THIS> field if we are an instance method, so we can
6142         reference our parent container variables.
6143         (MapVariable): Called back from the EmitContext code to enter a
6144         new variable to field mapping into the proxy class (we just create
6145         a FieldBuilder).
6146
6147         * expression.cs
6148         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
6149         for using the remapped locals to fields.
6150
6151         I placed the code here, because that gives the same semantics to
6152         local variables, and only changes the Emit code.
6153
6154         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
6155         statements inside iterators.
6156         (VariableInfo): Add a FieldBuilder for the cases when we are
6157         remapping local variables to fields in a proxy class
6158
6159         * ecore.cs (SimpleNameResolve): Avoid testing two times for
6160         current_block != null.
6161
6162         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
6163         not cope with strings, as it has been moved to the
6164         TableSwitchEmit.  Fixed bug in switch generation.
6165
6166         * expression.cs (New.DoResolve): Provide more context for the user
6167         when reporting an error.
6168
6169         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
6170         pointers. 
6171
6172         * expression.cs (MemberAccess.DoResolve): When we get a type back,
6173         check the permissions for it.  Note than in a type-resolution
6174         context the check was already present in DeclSpace.ResolveType,
6175         but was missing from the MemberAccess.
6176
6177         (ArrayCreation.CheckIndices): warn if the user has
6178         more nested levels of expressions, but there are no more
6179         dimensions specified.  Avoids crash on bug 41906.
6180
6181 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
6182
6183         * statement.cs (Block): replace Implicit bool, for a generic
6184         flags.   
6185         New flag: `Unchecked'.  This is used during the EmitMeta phase
6186         (which is out-of-line with the regular Resolve/Emit process for a
6187         statement, as this is done ahead of time, but still gets a chance
6188         to call constant resolve).
6189
6190         (Block.Flags): new enum for adding a new flag.
6191
6192         (Block.EmitMeta): track the state of unchecked.
6193
6194         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
6195         to enable constant resolution to work there as well.
6196
6197 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
6198
6199         * typemanager.cs (ienumerable_type): Also look up
6200         System.Collections.IEnumerable. 
6201
6202 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
6203
6204         TODO: Test more than one conditional per method.
6205
6206         * class.cs (Indexer.Define): Report the location where the user is
6207         referencing the unsupported feature.
6208
6209         (MethodData): Overload the use of `conditionals' to
6210         minimize the creation of needless ArrayLists.   This saves roughly
6211         212kb on my machine.
6212
6213         (Method): Implement the new IIteratorContainer interface.
6214         (Method.SetYields): Implement the method by setting the ModFlags
6215         to contain METHOD_YIELDS.
6216
6217         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
6218         which just got set to null.
6219
6220         * iterators.cs: New file.
6221
6222         (Yield, YieldBreak): New statements.
6223
6224         * statement.cs (Return.Resolve): Flag an error if we are used in
6225         an iterator method.
6226
6227         * codegen.cs (InIterator): New flag set if the code is being
6228         compiled in an iterator method.
6229
6230         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
6231         internal modifier, and we just use it to avoid adding extra
6232         fields, as this is seldom used.  
6233
6234         * cs-parser.jay: Add yield_statement (yield and yield break).
6235
6236         * driver.cs: New flag -v2 to turn on version 2 features. 
6237
6238         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
6239         hashtable when v2 is enabled.
6240
6241 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
6242
6243         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
6244         there is already a namespace defined with this name.
6245
6246         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
6247         people upgraded their corlibs.
6248
6249         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
6250         always use fully qualified types, no need to use the compiler
6251         front end.
6252
6253         (TypeManager.IsNamespace): Use binarysearch.
6254
6255         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
6256         AddDelegate): I did not quite use the new IsValid API properly: I
6257         have to pass the short-name and the fullname.  I was passing only
6258         the basename instead of the fullname sometimes. 
6259
6260         (TypeContainer.DefineType): call NamespaceClash.
6261
6262         * interface.cs (Interface.DefineType): use NamespaceClash before
6263         defining the type.
6264
6265         * delegate.cs (Delegate.DefineType): use NamespaceClash before
6266         defining the type.
6267
6268         * enum.cs: (Enum.DefineType): use NamespaceClash before
6269         defining the type.
6270
6271         * typemanager.cs (: 3-line patch that gives us some tasty 11%
6272         speed increase.  First, use the negative_hits cache when we get a
6273         negative.  Second, add the type with its full original name
6274         instead of the new . and + encoded name (reflection uses + to
6275         separate type from a nested type).  Use LookupTypeReflection
6276         directly which bypasses the type->name hashtable (that we already
6277         know does not contain the type.
6278
6279         * decl.cs (DeclSpace.ResolveTypeExpr): track the
6280         location/container type. 
6281
6282         * driver.cs: When passing utf8, use directly the UTF8Encoding.
6283
6284 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
6285
6286         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
6287
6288         * delegate.cs (NewDelegate.Resolve): Test whether an instance
6289         method is being referenced in the method group from a static
6290         context, and report error 120 if so.
6291
6292         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
6293         Error118. 
6294
6295         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
6296         is created, we create the A namespace).
6297
6298         * cs-parser.jay: A namespace also introduces a DeclarationFound.
6299         Fixes #41591
6300
6301 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
6302
6303         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
6304         invocation to ModuleBuilder.GetType with the same values will
6305         return a new type instance, so we need to cache its return
6306         values. 
6307
6308         * expression.cs (Binary.ResolveOperator): Only allow the compare
6309         operators on enums if they are of the same type.
6310
6311         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
6312         types of ValueType on their own case.  Before we were giving them
6313         the same treatment as objects.
6314
6315         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
6316         fullname.  Short name is used to compare against container name.
6317         Fullname is used to check against defined namespace names.
6318
6319         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
6320         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
6321
6322         (Method.CheckBase): Call parent.
6323         (MemberBase.CheckBase): Check for protected members on sealed
6324         classes.
6325         (PropertyBase.CheckBase): Call parent.
6326         (Field.Define): Call parent.
6327
6328         * report.cs: Negative error codes are now mapped to 8000 - code,
6329         so that the display is render more nicely.
6330
6331         * typemanager.cs: Do not use try/catch, instead report a regular
6332         error. 
6333
6334         (GetPointerType, GetReferenceType): These methods provide
6335         mechanisms to obtain the T* and T& from a T.  We had the code
6336         previously scattered around the code base, and it also used
6337         TypeManager.LookupType that would go through plenty of caches.
6338         This one goes directly to the type source.
6339
6340         In some places we did the Type.GetType followed by
6341         ModuleBuilder.GetType, but not in others, so this unifies the
6342         processing as well.
6343
6344         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
6345         statements now that we have namespace information.
6346
6347         * typemanager.cs (IsNamespace): New method, returns whether the
6348         string presented is a namespace or not.
6349
6350         (ComputeNamespaces): New public entry point, computes the list of
6351         available namespaces, using the GetNamespaces API call in Mono, or
6352         the slower version in MS.NET.   
6353
6354         Now before we start the semantic analysis phase, we have a
6355         complete list of namespaces including everything that the user has
6356         provided.
6357
6358         Deleted old code to cache namespaces in .nsc files.
6359
6360 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
6361
6362         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
6363         class/struct location definition Location for the implicit
6364         constructor location.
6365
6366         (Operator.Define): Use the location of the operator for the
6367         implicit Method definition.
6368
6369         (Constructor.Emit): use the constructor location for the implicit
6370         base initializer constructor.
6371
6372         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
6373         and the Expression class now contains two new methods:
6374
6375         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
6376         isolate type lookup from the rest of the resolution process.
6377
6378         Since we use Expressions to hold type definitions due to the way
6379         we parse the input we have historically overloaded Resolve to
6380         perform the Type lookups if a special flag is passed.  Now this is
6381         eliminated and two methods take their place. 
6382
6383         The differences in the two methods between xStep and xTerminal is
6384         that xStep is involved in our current lookup system that uses
6385         SimpleNames to compose a name, while xTerminal is used just to
6386         catch the case where the simplename lookup failed.
6387
6388 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
6389
6390         * expression.cs (ResolveMemberAccess): Remove redundant code.
6391         TypeExpr expressions are always born fully resolved.
6392
6393         * interface.cs (PopulateMethod): Do not lookup the types twice.
6394         We were doing it once during SemanticAnalysis and once during
6395         PopulateMethod.
6396
6397         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
6398         in local variable type definitions, were being returned as a
6399         SimpleName (we decomposed everything into a string), that is
6400         because primary_expression was being used instead of a type in the
6401         grammar (reduce/reduce conflicts).
6402
6403         The part that was wrong is that we converted the expression into a
6404         string (an oversimplification in one hand, compounded with primary
6405         expressions doing string concatenation).
6406
6407         So things like:
6408
6409         A.B.C [] x;
6410
6411         Would return "A.B.C[]" as a SimpleName.  This stopped things like
6412         using clauses from working on this particular context.  And a type
6413         was being matched directly against "A.B.C[]".
6414
6415         We now use the correct approach, and allow for ComposedCast to be
6416         part of the unary expression.  So the "A.B.C []" become a composed
6417         cast of "A.B.C" (as a nested group of MemberAccess with a
6418         SimpleName at the end) plus the rank composition "[]". 
6419
6420         Also fixes 35567
6421
6422 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
6423
6424         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
6425         for the access level checking.
6426
6427         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
6428         `TypeContainer container', because I kept getting confused when I
6429         was debugging this code.
6430
6431         * expression.cs (Indexers): Instead of tracking getters/setters,
6432         we now track them in parallel.  We create one arraylist less, but
6433         most importantly it is possible now for the LValue code to find a
6434         matching get for a set.
6435
6436         (IndexerAccess.DoResolveLValue): Update the code.
6437         GetIndexersForType has been modified already to extract all the
6438         indexers from a type.  The code assumed it did not.
6439
6440         Also make the code set the correct return type for the indexer.
6441         This was fixed a long time ago for properties, but was missing for
6442         indexers.  It used to be void_type.
6443
6444         (Binary.Emit): Test first for doubles instead of
6445         floats, as they are more common.
6446
6447         (Binary.EmitBranchable): Use the .un version of the branch opcodes
6448         when dealing with floats and the <=, >= operators.  This fixes bug
6449         #39314 
6450
6451         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
6452         to load the array value by emitting a load on the foreach variable
6453         type.  This was incorrect.  
6454
6455         We now emit the code to load an element using the the array
6456         variable type, and then we emit the conversion operator.
6457
6458         Fixed #40176
6459
6460 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
6461
6462         * attribute.cs: Avoid allocation of ArrayLists in the common case.
6463
6464 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
6465
6466         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
6467         test for protection before we test for signatures. 
6468
6469         (MethodSignature.ToString): implement.
6470
6471         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
6472         to the case where we reduced into a LongConstant.
6473
6474         * decl.cs (CheckAccessLevel): If the type is an array, we can not
6475         depend on whether the information is acurrate, because the
6476         Microsoft runtime will always claim that the array type is public,
6477         regardless of the real state.
6478
6479         If the type is a pointer, another problem happens: the type is
6480         reported as non-public in Microsoft.  
6481
6482         In both cases we have to call CheckAccessLevel recursively with
6483         the underlying type as the argument to be tested.
6484
6485 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
6486
6487         * assign.cs (Assign.Emit): If we are dealing with a compound
6488         assignment expression, we should use the code path that stores the
6489         intermediate result in a temporary value.  This fixes #40903.
6490
6491         *expression.cs (Indirection.ToString): Provide ToString method for
6492         debugging. 
6493
6494 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
6495
6496         * class.cs: Null out fields holding references to Block objects so
6497         they can be garbage collected.
6498
6499         * expression.cs (OverloadResolve): Remove unused local.
6500
6501 2003-04-07  Martin Baulig  <martin@ximian.com>
6502
6503         * codegen.cs (EmitContext.CurrentFile): New public field.
6504         (EmitContext.Mark): Use the CurrentFile to check whether the
6505         location is in the correct file.
6506         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
6507
6508 2003-04-07  Martin Baulig  <martin@ximian.com>
6509
6510         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
6511
6512         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
6513         location.  [FIXME: The location argument which gets passed to this
6514         method is sometimes wrong!]
6515
6516 2003-04-07  Nick Drochak <ndrochak@gol.com>
6517
6518         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
6519
6520 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
6521
6522         * expression.cs (Indirection.EmitAssign): We were using the
6523         temporary, but returning immediately instead of continuing the
6524         EmitAssing flow.
6525
6526 2003-04-06  Martin Baulig  <martin@ximian.com>
6527
6528         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
6529         if it's a nested child, but also deriving from the outer class.
6530         See test 190.cs.
6531
6532         * typemanager.cs (IsNestedChildOf): Make this work if it's a
6533         nested child, but also deriving from the outer class.  See
6534         test-190.cs.
6535         (FilterWithClosure): We may access private members of the outer
6536         class if we're a nested child and deriving from the outer class.
6537         (RealMemberLookup): Only set `closure_private_ok' if the
6538         `original_bf' contained BindingFlags.NonPublic.
6539
6540 2003-04-05  Martin Baulig  <martin@ximian.com>
6541
6542         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
6543         probe if its a type parameter, and if so, flag an error.
6544
6545         * decl.cs: Move here the SetParameterInfo code from class.cs.
6546         Handle IsGeneric here.
6547
6548         Handle a variety of errors in the parameter info definition.
6549
6550         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
6551         type parameters here.
6552
6553         * cs-parser.jay (class_declaration): report errors for parameters
6554         here as well.
6555
6556 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
6557
6558         * generic.cs: New file, contains support code for generics.
6559
6560         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
6561         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
6562
6563         Update parser for the above removals.
6564
6565         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
6566         now taken care of in the parser.
6567
6568 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
6569
6570         * class.cs (Event.Define): Do not allow abstract events to have
6571         initializers. 
6572
6573 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
6574
6575         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
6576         block in event declarations.
6577
6578         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
6579         value type, get its address.
6580
6581         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
6582         leaving a class on the stack instead of a boolean value (int
6583         0/1).  Change the code so we compare against null, and then the
6584         result against zero.
6585
6586         * class.cs (TypeContainer.GetClassBases): We were checking for the
6587         parent class being sealed too late.
6588
6589         * expression.cs (Binary.Emit): For <= and >= when dealing with
6590         floating point values, use cgt.un and clt.un instead of cgt and
6591         clt alone.
6592
6593 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
6594
6595         * statement.cs: Apply the same optimization as MS: skip the 
6596         GetEnumerator returning an IEnumerator, and use the one returning a 
6597         CharEnumerator instead. This allows us to avoid the try-finally block 
6598         and the boxing.
6599
6600 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
6601
6602         * cs-parser.jay: Attributes cannot be applied to
6603                          namespaces. Fixes #40473
6604
6605 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6606
6607         * class.cs:
6608         (Add*): check if the name is valid using the full name for constants,
6609         fields, properties and events.
6610
6611 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
6614         char constants to be part of the enumeration.
6615
6616         * expression.cs (Conditional.DoResolve): Add support for operator
6617         true. Implements the missing functionality from 14.12
6618
6619         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
6620         operator true/false as required by the spec.
6621
6622         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
6623         implicit conversion to boolean.
6624
6625         * statement.cs (Statement.ResolveBoolean): A boolean expression is
6626         also one where the type implements `operator true'. 
6627
6628         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
6629         get an expression that will invoke operator true based on an
6630         expression.  
6631
6632         (GetConversionOperators): Removed the hack that called op_True
6633         here.  
6634
6635         (Expression.ResolveBoolean): Move this from Statement.
6636
6637 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
6638
6639         * ecore.cs (FieldExpr): do not allow initialization of initonly
6640         fields on derived classes
6641
6642 2003-03-13  Martin Baulig  <martin@ximian.com>
6643
6644         * statement.cs (Block.Emit): Call ig.BeginScope() and
6645         ig.EndScope() when compiling with debugging info; call
6646         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
6647
6648 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
6649
6650         * expression.cs (Indexers): Do not construct immediately, allow
6651         for new members to be appended as we go.  Fixes 38143
6652
6653 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6654
6655         * expression.cs: save/restore context when resolving an unchecked
6656         expression.
6657
6658 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
6659
6660         * cfold.cs: Catch division by zero in modulus operator during
6661         constant folding.
6662
6663 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
6664
6665         * interface.cs (Interface.DefineMembers): Avoid defining members
6666         twice. 
6667
6668 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
6669
6670         * driver.cs: handle the +/- options for -noconfig
6671
6672         * statement.cs (Unckeched.Resolve): Also track the state of
6673         unchecked in the Resolve phase.
6674
6675 2003-02-27  Martin Baulig  <martin@ximian.com>
6676
6677         * ecore.cs (Expression.MemberLookup): Don't create a
6678         MethodGroupExpr for something which is not a method.  Fixes #38291.
6679
6680 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
6681
6682         * class.cs (MemberBase.CheckParameters): Also check that the type
6683         is unmanaged if it is a pointer.
6684
6685         * expression.cs (SizeOf.Resolve): Add location information.
6686
6687         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
6688         a managed type is declared.
6689
6690         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
6691         parameter modifiers as well.  Fixes bug 38606
6692
6693         * class.cs: Very sad.  Am backing out the speed up changes
6694         introduced by the ArrayList -> Array in the TypeContainer, as they
6695         were not actually that much faster, and introduced a bug (no error
6696         reports on duplicated methods).
6697
6698         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
6699         source first, this will guarantee that we have a valid expression
6700         before calling in lower levels functions that will require a
6701         resolved object.  Then use this original_source in the
6702         target.ResolveLValue instead of the original source that was
6703         passed to us.
6704
6705         Another change.  Use target.Resolve instead of LValueResolve.
6706         Although we are resolving for LValues, we will let the Assign code
6707         take care of that (it will be called again from Resolve).  This
6708         basically allows code like this:
6709
6710         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
6711         class Y { void A (X x) { x [0] += o; }
6712
6713         The problem was that the indexer was trying to resolve for
6714         set_Item (idx, object o) and never finding one.  The real set_Item
6715         was set_Item (idx, X).  By delaying the process we get the right
6716         semantics. 
6717
6718         Fixes bug 36505
6719
6720 2003-02-23  Martin Baulig  <martin@ximian.com>
6721
6722         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
6723         while calling DoEmit ().
6724
6725         * codegen.cs (EmitContext.Mark): Don't mark locations in other
6726         source files; if you use the #line directive inside a method, the
6727         compiler stops emitting line numbers for the debugger until it
6728         reaches the end of the method or another #line directive which
6729         restores the original file.
6730
6731 2003-02-23  Martin Baulig  <martin@ximian.com>
6732
6733         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
6734
6735 2003-02-23  Martin Baulig  <martin@ximian.com>
6736
6737         * statement.cs (Block.AddChildVariableNames): We need to call this
6738         recursively, not just for our immediate children.
6739
6740 2003-02-23  Martin Baulig  <martin@ximian.com>
6741
6742         * class.cs (Event.Define): Always make the field private, like csc does.
6743
6744         * typemanager.cs (TypeManager.RealMemberLookup): Make events
6745         actually work, fixes bug #37521.
6746
6747 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
6748
6749         * delegate.cs: When creating the various temporary "Parameters"
6750         classes, make sure that we call the ComputeAndDefineParameterTypes
6751         on those new parameters (just like we do with the formal ones), to
6752         allow them to be resolved in the context of the DeclSpace.
6753
6754         This fixes the bug that Dick observed in Bugzilla #38530.
6755
6756 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
6757
6758         * expression.cs (ResolveMemberAccess): When resolving a constant,
6759         do not attempt to pull a constant if the value was not able to
6760         generate a valid constant.
6761
6762         * const.cs (LookupConstantValue): Do not report more errors than required.
6763
6764 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6765
6766         * expression.cs: fixes bug #38328.
6767
6768 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6769
6770         * class.cs: Changed all the various members that can be part of a
6771         class from being an ArrayList to be an Array of the right type.
6772         During the DefineType type_list, interface_list, delegate_list and
6773         enum_list are turned into types, interfaces, delegates and enums
6774         arrays.  
6775
6776         And during the member population, indexer_list, event_list,
6777         constant_list, field_list, instance_constructor_list, method_list,
6778         operator_list and property_list are turned into their real arrays.
6779
6780         Although we could probably perform this operation earlier, for
6781         good error reporting we need to keep the lists and remove the
6782         lists for longer than required.
6783
6784         This optimization was triggered by Paolo profiling the compiler
6785         speed on the output of `gen-sample-program.pl' perl script. 
6786
6787         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
6788         not crash in methods like MemberLookupFailed that use this field.  
6789
6790         This problem arises when the compiler fails to resolve a type
6791         during interface type definition for example.
6792
6793 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6794
6795         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
6796         inherit from System.Object, so we have to stop at null, not only
6797         when reaching System.Object.
6798
6799 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
6800
6801         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
6802         DeclaredOnly because the parent indexer might have had a different
6803         name, but did not loop until the top of the hierarchy was reached.
6804
6805         The problem this one fixes is 35492: when a class implemented an
6806         indexer from an interface, we were getting the interface method
6807         (which was abstract) and we were flagging an error (can not invoke
6808         abstract method).
6809
6810         This also keeps bug 33089 functioning, and test-148 functioning.
6811
6812         * typemanager.cs (IsSpecialMethod): The correct way of figuring
6813         out if a method is special is to see if it is declared in a
6814         property or event, or whether it is one of the predefined operator
6815         names.   This should fix correctly #36804.
6816
6817 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
6818
6819         The goal here is to remove the dependency on EmptyCast.Peel ().
6820         Killing it completely.
6821
6822         The problem is that currently in a number of places where
6823         constants are expected, we have to "probe" for an EmptyCast, and
6824         Peel, which is not the correct thing to do, as this will be
6825         repetitive and will likely lead to errors. 
6826
6827         The idea is to remove any EmptyCasts that are used in casts that
6828         can be reduced to constants, so we only have to cope with
6829         constants. 
6830
6831         This bug hunt was triggered by Bug 37363 and the desire to remove
6832         the duplicate pattern where we were "peeling" emptycasts to check
6833         whether they were constants.  Now constants will always be
6834         constants.
6835
6836         * ecore.cs: Use an enumconstant here instead of wrapping with
6837         EmptyCast.  
6838
6839         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
6840         throwing me off.  By handling this we can get rid of a few hacks.
6841
6842         * statement.cs (Switch): Removed Peel() code.
6843
6844 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
6845
6846         * class.cs: Location information for error 508
6847
6848         * expression.cs (New.DoResolve): Add a guard against double
6849         resolution of an expression.  
6850
6851         The New DoResolve might be called twice when initializing field
6852         expressions (see EmitFieldInitializers, the call to
6853         GetInitializerExpression will perform a resolve on the expression,
6854         and later the assign will trigger another resolution
6855
6856         This leads to bugs (#37014)
6857
6858         * delegate.cs: The signature for EndInvoke should contain any ref
6859         or out parameters as well.  We were not doing this in the past. 
6860
6861         * class.cs (Field.Define): Do not overwrite the type definition
6862         inside the `volatile' group.  Turns out that volatile enumerations
6863         were changing the type here to perform a validity test, which
6864         broke conversions. 
6865
6866 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
6867
6868         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
6869         and structs, we do not want to load the instance variable
6870
6871         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
6872         enum_type has to be handled like an object reference (implicit
6873         conversions exists from this to object), but the regular IsClass
6874         and IsValueType tests will never return true for this one.
6875
6876         Also we use TypeManager.IsValueType instead of type.IsValueType,
6877         just for consistency with the rest of the code (this is only
6878         needed if we ever use the construct exposed by test-180.cs inside
6879         corlib, which we dont today).
6880
6881 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
6882
6883         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
6884         just InternalCall.
6885
6886 2003-02-09  Martin Baulig  <martin@ximian.com>
6887
6888         * namespace.cs (Namespace..ctor): Added SourceFile argument.
6889         (Namespace.DefineNamespaces): New static public method; this is
6890         called when we're compiling with debugging to add all namespaces
6891         to the symbol file.
6892
6893         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
6894         pass it to the Namespace's .ctor.
6895
6896         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
6897         and MethodBase arguments; pass the namespace ID to the symwriter;
6898         pass the MethodBase instead of the token to the symwriter.
6899         (SymbolWriter.DefineNamespace): New method to add a namespace to
6900         the symbol file.
6901
6902 2003-02-09  Martin Baulig  <martin@ximian.com>
6903
6904         * symbolwriter.cs: New file.  This is a wrapper around
6905         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
6906         methods here in near future.
6907
6908 2003-02-09  Martin Baulig  <martin@ximian.com>
6909
6910         * codegen.cs (EmitContext.Mark): Just pass the arguments to
6911         ILGenerator.MarkSequencePoint() which are actually used by the
6912         symbol writer.
6913
6914 2003-02-09  Martin Baulig  <martin@ximian.com>
6915
6916         * location.cs (SourceFile): New public sealed class.  This
6917         contains the name and an index which is used in the location's token.
6918         (Location): Reserve an appropriate number of bits in the token for
6919         the source file instead of walking over that list, this gives us a
6920         really huge performance improvement when compiling with debugging.
6921
6922         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
6923         `SourceFile' argument instead of a string.
6924         (Driver.ProcessFile): Add all the files via Location.AddFile(),
6925         but don't parse/tokenize here, we need to generate the list of all
6926         source files before we do that.
6927         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
6928         the files.
6929
6930         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
6931         instead of a string.
6932
6933         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
6934         of a string.
6935
6936 2003-02-09  Martin Baulig  <martin@ximian.com>
6937
6938         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
6939         filename on `#line default'.
6940
6941 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
6942
6943         * statement.cs: don't clear the pinned var when the fixed statement
6944         returns from the method (fixes bug#37752).
6945
6946 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
6947
6948         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
6949         to IsValueType.
6950
6951 2003-02-07  Martin Baulig  <martin@ximian.com>
6952
6953         * driver.cs: Removed the `--debug-args' command line argument.
6954
6955         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
6956         automatically by the AsssemblyBuilder.
6957         (CodeGen.InitializeSymbolWriter): We don't need to call any
6958         initialization function on the symbol writer anymore.  This method
6959         doesn't take any arguments.
6960
6961 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
6962
6963         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
6964         from referenced assemblies as well.
6965
6966 2003-02-02  Martin Baulig  <martin@ximian.com>
6967
6968         * class.cs (MethodData.Emit): Generate debugging info for external methods.
6969
6970 2003-02-02  Martin Baulig  <martin@ximian.com>
6971
6972         * class.cs (Constructor.Emit): Open the symbol writer before
6973         emitting the constructor initializer.
6974         (ConstructorInitializer.Emit): Call ec.Mark() to allow
6975         single-stepping through constructor initializers.
6976
6977 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
6978
6979         * class.cs: Handle error 549: do not allow virtual methods in
6980         sealed classes. 
6981
6982 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
6983
6984         * decl.cs: Check access levels when resolving types
6985
6986 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
6987
6988         * statement.cs: Add parameters and locals set in catch blocks that might 
6989         return to set vector
6990
6991 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
6992
6993         * class.cs (Operator): Set the SpecialName flags for operators.
6994
6995         * expression.cs (Invocation.DoResolve): Only block calls to
6996         accessors and operators on SpecialName methods.
6997
6998         (Cast.TryReduce): Handle conversions from char constants.
6999
7000
7001 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
7002
7003         * statement.cs: small memory and time optimization in FlowBranching.
7004
7005 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
7006
7007         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
7008         problem that the last fix but in the other sid (Set).
7009
7010         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
7011         access when there is no indexer in the hierarchy.
7012
7013 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
7014
7015         * class.cs: Combine some if statements.
7016
7017 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7018
7019         * driver.cs: fixed bug #37187.
7020
7021 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
7022
7023         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
7024         any indexer, it's needed to build a list with all the indexers in the
7025         hierarchy (AllGetters), else we have problems. Fixes #35653.
7026
7027 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
7028
7029         * class.cs (MethodData.Define): It is wrong for an interface
7030         implementation to be static in both cases: explicit and implicit.
7031         We were only handling this in one case.
7032
7033         Improve the if situation there to not have negations.
7034
7035         * class.cs (Field.Define): Turns out that we do not need to check
7036         the unsafe bit on field definition, only on usage.  Remove the test.
7037
7038 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7039
7040         * driver.cs: use assembly.Location instead of Codebase (the latest
7041         patch made mcs fail when using MS assemblies).
7042
7043 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
7044
7045         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
7046         get the path to *corlib.dll.
7047
7048 2003-01-21  Nick Drochak <ndrochak@gol.com>
7049
7050         * cs-tokenizer.cs:
7051         * pending.cs:
7052         * typemanager.cs: Remove compiler warnings
7053
7054 2003-01-20  Duncan Mak  <duncan@ximian.com>
7055
7056         * AssemblyInfo.cs: Bump the version number to 0.19.
7057
7058 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7059
7060         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
7061
7062 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
7063
7064         * class.cs (Constructor::Emit): Emit debugging info for constructors.
7065
7066 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
7067
7068         * cs-parser.jay: Small fix: we were not comparing the constructor
7069         name correctly.   Thanks to Zoltan for the initial pointer.
7070
7071 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
7072
7073         * cs-tokenizer.cs: Set file name when specified with #line
7074
7075 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
7076
7077         * cs-parser.jay: Only perform the constructor checks here if we
7078         are named like the class;  This will help provider a better
7079         error.  The constructor path is taken when a type definition is
7080         not found, but most likely the user forgot to add the type, so
7081         report that rather than the constructor error.
7082
7083 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
7084
7085         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
7086         allocations.
7087
7088 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
7089
7090         * cs-parser.jay: Add cleanup call.
7091
7092 2003-01-13  Duncan Mak  <duncan@ximian.com>
7093
7094         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
7095         consistent with other methods.
7096
7097 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
7098
7099         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
7100
7101 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
7102
7103         * attribute.cs: only set GuidAttr to true when we have a
7104         GuidAttribute.
7105
7106 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7107
7108         * ecore.cs:
7109         * expression.cs:
7110         * typemanager.cs: fixes to allow mcs compile corlib with the new
7111         Type.IsSubclassOf fix.
7112
7113 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
7114
7115         * expression.cs (LocalVariableReference.DoResolve): Classify a
7116         constant as a value, not as a variable.   Also, set the type for
7117         the variable.
7118
7119         * cs-parser.jay (fixed_statement): take a type instead of a
7120         pointer_type, so we can produce a better error message later.
7121
7122         * statement.cs (Fixed.Resolve): Flag types that are not pointers
7123         as an error.  
7124
7125         (For.DoEmit): Make inifinite loops have a
7126         non-conditional branch back.
7127
7128         (Fixed.DoEmit): First populate the pinned variables, then emit the
7129         statement, then clear the variables.  Before I was emitting the
7130         code once for each fixed piece.
7131
7132
7133 2003-01-08  Martin Baulig  <martin@ximian.com>
7134
7135         * statement.cs (FlowBranching.MergeChild): A break in a
7136         SWITCH_SECTION does not leave a loop.  Fixes #36155.
7137
7138 2003-01-08  Martin Baulig  <martin@ximian.com>
7139
7140         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
7141         lives in the same number space than `param_map'.  Fixes #36154.
7142
7143 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
7144
7145         * cs-parser.jay (constructor_declaration): Set the
7146         Constructor.ModFlags before probing for it.  This makes the
7147         compiler report 514, 515 and 132 (the code was there, but got
7148         broken). 
7149
7150         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
7151         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
7152         (GotoCase.Resolve): Set `Returns' to ALWAYS.
7153
7154 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
7155
7156         * enum.cs: create the enum static fields using the enum type.
7157
7158 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
7159
7160         * class.cs: don't try to create the ParamBuilder for the return
7161         type if it's not needed (and handle it breaking for the ms runtime
7162         anyway).
7163
7164 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
7165
7166         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
7167
7168 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
7169
7170         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
7171         the command.   This showed up while compiling the JANET source
7172         code, which used \r as its only newline separator.
7173
7174 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
7175
7176         * class.cs (Method.Define): If we are an operator (because it
7177         reuses our code), then set the SpecialName and HideBySig.  #36128
7178
7179 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
7180
7181         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
7182         exception, report error 120 `object reference required'.
7183
7184         * driver.cs: Add --pause option, used during to measure the size
7185         of the process as it goes with --timestamp.
7186
7187         * expression.cs (Invocation.DoResolve): Do not allow methods with
7188         SpecialName to be invoked.
7189
7190 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
7191
7192         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
7193         number before adding it.
7194
7195 2002-12-21  Ravi Pratap  <ravi@ximian.com>
7196
7197         * ecore.cs (StandardImplicitConversion): When in an unsafe
7198         context, we allow conversion between void * to any other pointer
7199         type. This fixes bug #35973.
7200
7201 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
7202
7203         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
7204         is not thrown when extensionless outputs are used 
7205
7206 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7207
7208         * rootcontext.cs: fixed compilation of corlib.
7209
7210 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
7211
7212         * attribute.cs (Attributes.Contains): Add new method.
7213
7214         * class.cs (MethodCore.LabelParameters): if the parameter is an
7215         `out' parameter, check that no attribute `[In]' has been passed.
7216
7217         * enum.cs: Handle the `value__' name in an enumeration.
7218
7219 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
7220
7221         * decl.cs: Added special case to allow overrides on "protected
7222         internal" methods
7223
7224 2002-12-18  Ravi Pratap  <ravi@ximian.com>
7225
7226         * attribute.cs (Attributes.AddAttributeSection): Rename to this
7227         since it makes much more sense.
7228
7229         (Attributes.ctor): Don't require a Location parameter.
7230
7231         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
7232
7233         * attribute.cs (ApplyAttributes): Remove extra Location parameters
7234         since we already have that information per attribute.
7235
7236         * everywhere : make appropriate changes.
7237
7238         * class.cs (LabelParameters): Write the code which actually
7239         applies attributes to the return type. We can't do this on the MS
7240         .NET runtime so we flag a warning in the case an exception is
7241         thrown.
7242
7243 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
7244
7245         * const.cs: Handle implicit null conversions here too.
7246
7247 2002-12-17  Ravi Pratap  <ravi@ximian.com>
7248
7249         * class.cs (MethodCore.LabelParameters): Remove the extra
7250         Type [] parameter since it is completely unnecessary. Instead
7251         pass in the method's attributes so that we can extract
7252         the "return" attribute.
7253
7254 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
7255
7256         * cs-parser.jay (parse): Use Report.Error to flag errors instead
7257         of ignoring it and letting the compile continue.
7258
7259         * typemanager.cs (ChangeType): use an extra argument to return an
7260         error condition instead of throwing an exception.
7261
7262 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
7263
7264         * expression.cs (Unary.TryReduce): mimic the code for the regular
7265         code path.  Perform an implicit cast in the cases where we can
7266         implicitly convert to one of the integral types, and then reduce
7267         based on that constant.   This fixes bug #35483.
7268
7269 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7270
7271         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
7272
7273 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7274
7275         * namespace.cs: fixed bug #35489.
7276
7277 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
7278
7279         * class.cs: Remove some dead code.
7280
7281         * cs-parser.jay: Estimate the number of methods needed
7282         (RootContext.MethodCount);
7283
7284         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
7285         numbers instead of StringBuilders.
7286
7287         * support.cs (PtrHashtable): Add constructor with initial size;
7288         We can now reduce reallocations of the method table.
7289
7290 2002-12-10  Ravi Pratap  <ravi@ximian.com>
7291
7292         * attribute.cs (ApplyAttributes): Keep track of the emitted
7293         attributes on a per-target basis. This fixes bug #35413.
7294
7295 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
7296
7297         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
7298         default to the Windows 1252 encoding.
7299
7300         (UnixParseOption): Support version, thanks to Alp for the missing
7301         pointer. 
7302
7303         * AssemblyInfo.cs: Add nice assembly information.
7304
7305         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
7306         (bug 35169).
7307
7308         * cs-parser.jay: Allow a trailing comma before the close bracked
7309         in the attribute_section production.
7310
7311         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
7312         address of the instance was being taken, I will take this out,
7313         because we take the address of the object immediately here.
7314
7315 2002-12-09  Ravi Pratap  <ravi@ximian.com>
7316
7317         * typemanager.cs (AreMultipleAllowed): Take care of the most
7318         obvious case where attribute type is not in the current assembly -
7319         stupid me ;-)
7320
7321 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
7322
7323         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
7324         definitions, instead of doing that afterwards.  
7325
7326         Also we use a nice little hack, depending on the constructor, we
7327         know if we are a "composed" name or a simple name.  Hence, we
7328         avoid the IndexOf test, and we avoid 
7329
7330         * codegen.cs: Add code to assist in a bug reporter to track down
7331         the source of a compiler crash. 
7332
7333 2002-12-07  Ravi Pratap  <ravi@ximian.com>
7334
7335         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
7336         types have been emitted for a given element and flag an error
7337         if something which does not have AllowMultiple set is used more
7338         than once.
7339
7340         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
7341         attribute types and their corresponding AllowMultiple properties
7342
7343         (AreMultipleAllowed): Check the property for a given type.
7344
7345         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
7346         property in the case we have a TypeContainer.
7347
7348         (Attributes.AddAttribute): Detect duplicates and just skip on
7349         adding them. This trivial fix catches a pretty gross error in our
7350         attribute emission - global attributes were being emitted twice!
7351
7352         Bugzilla bug #33187 is now fixed.
7353
7354 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
7355
7356         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
7357         instead of pp_and).
7358
7359         * expression.cs (Binary.ResolveOperator): I can only use the
7360         Concat (string, string, string) and Concat (string, string,
7361         string, string) if the child is actually a concatenation of
7362         strings. 
7363
7364 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
7365
7366         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
7367         context where we need a 2-character lookahead.
7368
7369         * pending.cs (PendingImplementation): Rework so we can keep track
7370         of interface types all the time, and flag those which were
7371         implemented by parents as optional.
7372
7373 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
7374
7375         * expression.cs (Binary.ResolveOperator): Use
7376         String.Concat(string,string,string) or
7377         String.Concat(string,string,string,string) when possible. 
7378
7379         * typemanager: More helper methods.
7380
7381
7382 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
7383
7384         * pending.cs: remove the bogus return from GetMissingInterfaces()
7385         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
7386
7387 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7388
7389         * namespace.cs: avoid duplicated 'using xxx' being added to
7390         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
7391         when we get more than one 'using' statement for the same namespace.
7392         Report a CS0105 warning for it.
7393
7394 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
7395
7396         * cs-tokenizer.cs (consume_identifier): use read directly, instead
7397         of calling getChar/putback, uses internal knowledge of it.    
7398
7399         (xtoken): Reorder tokenizer so most common patterns are checked
7400         first.  This reduces the compilation time in another 5% (from 8.11s
7401         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
7402
7403         The parsing time is 22% of the compilation in mcs, and from that
7404         64% is spent on the tokenization process.  
7405
7406         I tried using a binary search for keywords, but this is slower
7407         than the hashtable.  Another option would be to do a couple of
7408         things:
7409
7410                 * Not use a StringBuilder, instead use an array of chars,
7411                   with a set value.  Notice that this way we could catch
7412                   the 645 error without having to do it *afterwards*.
7413
7414                 * We could write a hand-parser to avoid the hashtable
7415                   compares altogether.
7416
7417         The identifier consumption process takes 37% of the tokenization
7418         time.  Another 15% is spent on is_number.  56% of the time spent
7419         on is_number is spent on Int64.Parse:
7420
7421                 * We could probably choose based on the string length to
7422                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
7423                   computations. 
7424
7425         Another 3% is spend on wrapping `xtoken' in the `token' function.
7426
7427         Handle 0xa0 as whitespace (#34752)
7428
7429 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
7430
7431         * typemanager.cs (IsCLRType): New routine to tell whether a type
7432         is one of the builtin types.  
7433
7434         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
7435         typecode in more places instead of doing pointer comparissions.
7436         We could leverage some knowledge about the way the typecodes are
7437         laid out.
7438
7439         New code to cache namespaces in assemblies, it is currently not
7440         invoked, to be used soon.
7441
7442         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
7443
7444         * expression.cs (Binary.ResolveOperator): specially handle
7445         strings, and do not perform user-defined operator overloading for
7446         built-in types.
7447
7448 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
7449
7450         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
7451         internalcall as it is a pretty simple operation;  Avoid whenever
7452         possible to call Char.IsLetter.
7453
7454         (consume_identifier): Cut by half the number of
7455         hashtable calls by merging the is_keyword and GetKeyword behavior.
7456
7457         Do not short-circuit, because if we do, we
7458         report errors (ie, #if false && true would produce an invalid
7459         directive error);
7460
7461
7462 2002-11-24  Martin Baulig  <martin@ximian.com>
7463
7464         * expression.cs (Cast.TryReduce): If we're in checked syntax,
7465         check constant ranges and report a CS0221.  Fixes #33186.
7466
7467 2002-11-24  Martin Baulig  <martin@ximian.com>
7468
7469         * cs-parser.jay: Make this work for uninitialized variable
7470         declarations in the `for' initializer.  Fixes #32416.
7471
7472 2002-11-24  Martin Baulig  <martin@ximian.com>
7473
7474         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
7475         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
7476
7477 2002-11-24  Martin Baulig  <martin@ximian.com>
7478
7479         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
7480         argument; if true, we also check for user-defined conversions.
7481         This is only needed if both arguments are of a user-defined type.
7482         Fixes #30443, added test-175.cs.
7483         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
7484
7485         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
7486
7487 2002-11-24  Martin Baulig  <martin@ximian.com>
7488
7489         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
7490         function to get the store opcode.
7491         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
7492         only emit the Ldelema if the store opcode is Stobj.  You must run
7493         both test-34 and test-167 to test this.  Fixes #34529.
7494
7495 2002-11-23  Martin Baulig  <martin@ximian.com>
7496
7497         * ecore.cs (Expression.MemberLookup): Added additional
7498         `qualifier_type' argument which is used when we're being called
7499         from MemberAccess.DoResolve() and null if we're called from a
7500         SimpleName lookup.
7501         (Expression.MemberLookupFailed): New method to report errors; this
7502         does the CS1540 check and reports the correct error message.
7503
7504         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
7505         argument for the CS1540 check and redone the way how we're dealing
7506         with private members.  See the comment in the source code for details.
7507         (FilterWithClosure): Reverted this back to revision 1.197; renamed
7508         `closure_start_type' to `closure_qualifier_type' and check whether
7509         it's not null.  It was not this filter being broken, it was just
7510         being called with the wrong arguments.
7511
7512         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
7513         and pass it the correct `qualifier_type'; this also does the error
7514         handling for us.
7515
7516 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
7517
7518         * expression.cs (Invocation.EmitParams): If the we are dealing
7519         with a non-built-in value type, load its address as well.
7520
7521         (ArrayCreation): Use a a pretty constant instead
7522         of the hardcoded value 2.   Use 6 instead of 2 for the number of
7523         static initializers.  
7524
7525         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
7526         because they are not really value types, just glorified integers. 
7527
7528         * driver.cs: Do not append .exe, the CSC compiler does not do it.
7529
7530         * ecore.cs: Remove redundant code for enumerations, make them use
7531         the same code path as everything else, fixes the casting issue
7532         with enumerations in Windows.Forms.
7533
7534         * attribute.cs: Do only cast to string if it is a string, the
7535         validation happens later.
7536
7537         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
7538         people upgrade their corlibs.
7539
7540         * ecore.cs: Oops, enumerations were not following the entire code path
7541
7542 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
7543
7544         * typemanager.cs (FilterWithClosure): Commented out the test for
7545         1540 in typemanager.cs, as it has problems when accessing
7546         protected methods from a parent class (see test-174.cs). 
7547
7548         * attribute.cs (Attribute.ValidateGuid): new method.
7549         (Attribute.Resolve): Use above.
7550
7551 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
7552
7553         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
7554
7555         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
7556         handling for enumerations, as we only needed the TypeContainer
7557         functionality to begin with (this is required for the fix below to
7558         work for enums that reference constants in a container class for
7559         example). 
7560
7561         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
7562
7563         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
7564         a valid TypeBuilder to perform lookups on.o
7565
7566         * class.cs (InheritableMemberSignatureCompare): Use true in the
7567         call to GetGetMethod and GetSetMethod, because we are comparing
7568         the signature, and we need to get the methods *even* if they are
7569         private. 
7570
7571         (PropertyBase.CheckBase): ditto.
7572
7573         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
7574         GotoCase.Resolve): Use Peel on EmpytCasts.
7575
7576         * ecore.cs (EmptyCast): drop child, add Peel method.
7577
7578 2002-11-17  Martin Baulig  <martin@ximian.com>
7579
7580         * ecore.cs (EmptyCast.Child): New public property.
7581
7582         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
7583         label resolved to an EmptyCast.  Fixes #34162.
7584         (GotoCase.Resolve): Likewise.
7585         (Block.EmitMeta): Likewise.
7586
7587 2002-11-17  Martin Baulig  <martin@ximian.com>
7588
7589         * expression.cs (Invocation.BetterConversion): Prefer int over
7590         uint; short over ushort; long over ulong for integer literals.
7591         Use ImplicitConversionExists instead of StandardConversionExists
7592         since we also need to check for user-defined implicit conversions.
7593         Fixes #34165.  Added test-173.cs.
7594
7595 2002-11-16  Martin Baulig  <martin@ximian.com>
7596
7597         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
7598         with the `true' and `false' literals.  Fixes #33151.
7599
7600 2002-11-16  Martin Baulig  <martin@ximian.com>
7601
7602         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
7603         October 22nd; don't do the cs1540 check for static members.
7604
7605         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
7606         now using our own filter here and doing the cs1540 check again.
7607
7608 2002-11-16  Martin Baulig  <martin@ximian.com>
7609
7610         * support.cs (InternalParameters): Don't crash if we don't have
7611         any fixed parameters.  Fixes #33532.
7612
7613 2002-11-16  Martin Baulig  <martin@ximian.com>
7614
7615         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
7616         when looking up static methods to make this work on Windows.
7617         Fixes #33773.
7618
7619 2002-11-16  Martin Baulig  <martin@ximian.com>
7620
7621         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
7622         a setter rather than using PropertyInfo.CanWrite.
7623
7624 2002-11-15  Nick Drochak  <ndrochak@gol.com>
7625
7626         * class.cs: Allow acces to block member by subclasses. Fixes build
7627         breaker.
7628
7629 2002-11-14  Martin Baulig  <martin@ximian.com>
7630
7631         * class.cs (Constructor.Emit): Added the extern/block check.
7632         Fixes bug #33678.
7633
7634 2002-11-14  Martin Baulig  <martin@ximian.com>
7635
7636         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
7637         iteration while looking for indexers, this is needed because the
7638         indexer may have a different name in our base classes.  Fixed the
7639         error reporting (no indexers at all, not get accessor, no
7640         overloaded match).  Fixes bug #33089.
7641         (IndexerAccess.DoResolveLValue): Likewise.
7642
7643 2002-11-14  Martin Baulig  <martin@ximian.com>
7644
7645         * class.cs (PropertyBase.CheckBase): Make this work for multiple
7646         indexers.  Fixes the first part of bug #33089.
7647         (MethodSignature.InheritableMemberSignatureCompare): Added support
7648         for properties.
7649
7650 2002-11-13  Ravi Pratap  <ravi@ximian.com>
7651
7652         * attribute.cs (Attribute.Resolve): Catch the
7653         NullReferenceException and report it since it isn't supposed to
7654         happen. 
7655
7656 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
7657
7658         * expression.cs (Binary.EmitBranchable): Also handle the cases for
7659         LogicalOr and LogicalAnd that can benefit from recursively
7660         handling EmitBranchable.  The code now should be nice for Paolo.
7661
7662 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
7663
7664         * typemanager.cs (LookupType): Added a negative-hit hashtable for
7665         the Type lookups, as we perform quite a number of lookups on
7666         non-Types.  This can be removed once we can deterministically tell
7667         whether we have a type or a namespace in advance.
7668
7669         But this might require special hacks from our corlib.
7670
7671         * TODO: updated.
7672
7673         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
7674         and double which avoids a conversion from an integer to a double.
7675
7676         * expression.cs: tiny optimization, avoid calling IsConstant,
7677         because it effectively performs the lookup twice.
7678
7679 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
7680
7681         But a bogus return here to keep the semantics of the old code
7682         until the Mono runtime is fixed.
7683
7684         * pending.cs (GetMissingInterfaces): New method used to remove all
7685         the interfaces that are already implemented by our parent
7686         classes from the list of pending methods. 
7687
7688         * interface.cs: Add checks for calls after ResolveTypeExpr.
7689
7690 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
7691
7692         * class.cs (Class.Emit): Report warning 67: event not used if the
7693         warning level is beyond 3.
7694
7695         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
7696         being a NullLiteral.
7697
7698         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
7699         specifiers. 
7700
7701         * class.cs (TypeContainer.GetClassBases): Cover a missing code
7702         path that might fail if a type can not be resolved.
7703
7704         * expression.cs (Binary.Emit): Emit unsigned versions of the
7705         operators. 
7706
7707         * driver.cs: use error 5.
7708
7709 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
7710
7711         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
7712
7713 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
7714
7715         * cs-parser.jay (switch_section): A beautiful patch from Martin
7716         Baulig that fixed 33094.
7717
7718 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
7719
7720         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
7721         Check whether the base is abstract and report an error if so.
7722
7723         * expression.cs (IndexerAccess.DoResolveLValue,
7724         IndexerAccess.DoResolve): ditto. 
7725
7726         (Invocation.DoResolve): ditto.
7727
7728         (Invocation.FullMethodDesc): Improve the report string.
7729
7730         * statement.cs (Block): Eliminate IsVariableDefined as it is
7731         basically just a wrapper for GetVariableInfo.
7732
7733         * ecore.cs (SimpleName): Use new 
7734
7735         * support.cs (ReflectionParamter.ParameterType): We unwrap the
7736         type, as we return the actual parameter ref/unref state on a
7737         different call.
7738
7739 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
7740
7741         * support.cs: Return proper flags REF/OUT fixing the previous
7742         commit.  
7743
7744         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
7745         not used to mean `ref' but `ref or out' in ParameterReference
7746
7747         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
7748         full type signature instead of calling TypeManger.CSharpName
7749         ourselves. 
7750
7751         * support.cs (InternalParameters.ParameterDesc): Do not compare
7752         directly to the modflags, because REF/OUT will actually be bitsets
7753         if set. 
7754
7755         * delegate.cs (VerifyMethod): Check also the modifiers.
7756
7757         * cs-tokenizer.cs: Fix bug where floating point values with an
7758         exponent where a sign was missing was ignored.
7759
7760         * driver.cs: Allow multiple assemblies to be specified in a single
7761         /r: argument
7762
7763 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
7764
7765         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
7766         because identifiers after a parenthesis would end up in this kind
7767         of production, and we needed to desamiguate it for having casts
7768         like:
7769
7770                 (UserDefinedType *) xxx
7771
7772 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
7773
7774         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
7775         we should set on the Bindingflags.NonPublic, but not turn on
7776         private_ok.  private_ok controls whether a Private member is
7777         returned (this is chekced on the filter routine), while the
7778         BindingFlags.NonPublic just controls whether private/protected
7779         will be allowed.   This fixes the problem part of the problem of
7780         private properties being allowed to be used in derived classes.
7781
7782         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
7783         so we can call the children DoResolveLValue method (this will
7784         properly signal errors on lvalue assignments to base properties)
7785
7786         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
7787         getter are null, and we have a property info, we know that this
7788         happened because the lookup failed, so we report an error 122 for
7789         protection level violation.
7790
7791         We also silently return if setter and getter are null in the
7792         resolve functions, this condition only happens if we have flagged
7793         the error before.  This is the other half of the problem. 
7794
7795         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
7796         not have accessibility information, that is why we were returning
7797         true in the filter function in typemanager.cs.
7798
7799         To properly report 122 (property is inaccessible because of its
7800         protection level) correctly, we report this error in ResolveAccess
7801         by failing if both the setter and the getter are lacking (ie, the
7802         lookup failed). 
7803
7804         DoResolve and DoLResolve have been modified to check for both
7805         setter/getter being null and returning silently, the reason being
7806         that I did not want to put the knowledge about this error in upper
7807         layers, like:
7808
7809         int old = Report.Errors;
7810         x = new PropertyExpr (...);
7811         if (old != Report.Errors)
7812                 return null;
7813         else
7814                 return x;
7815
7816         So the property expr is returned, but it is invalid, so the error
7817         will be flagged during the resolve process. 
7818
7819         * class.cs: Remove InheritablePropertySignatureCompare from the
7820         class, as we no longer depend on the property signature to compute
7821         whether it is possible to implement a method or not.
7822
7823         The reason is that calling PropertyInfo.GetGetMethod will return
7824         null (in .NET, in Mono it works, and we should change this), in
7825         cases where the Get Method does not exist in that particular
7826         class.
7827
7828         So this code:
7829
7830         class X { public virtual int A { get { return 1; } } }
7831         class Y : X { }
7832         class Z : Y { public override int A { get { return 2; } } }
7833
7834         Would fail in Z because the parent (Y) would not have the property
7835         defined.  So we avoid this completely now (because the alternative
7836         fix was ugly and slow), and we now depend exclusively on the
7837         method names.
7838
7839         (PropertyBase.CheckBase): Use a method-base mechanism to find our
7840         reference method, instead of using the property.
7841
7842         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
7843         routines are gone now.
7844
7845         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
7846         names, they were incorrectly named.
7847
7848         * cs-tokenizer.cs: Return are more gentle token on failure. 
7849
7850         * pending.cs (PendingImplementation.InterfaceMethod): This routine
7851         had an out-of-sync index variable, which caused it to remove from
7852         the list of pending methods the wrong method sometimes.
7853
7854 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
7855
7856         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
7857         CanWrite, because those refer to this particular instance of the
7858         property, and do not take into account the fact that we can
7859         override single members of a property.
7860
7861         Constructor requires an EmitContext.  The resolution process does
7862         not happen here, but we need to compute the accessors before,
7863         because the resolution does not always happen for properties.
7864
7865         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
7866         subclass, before we did not update this flag, but we did update
7867         bindingflags. 
7868
7869         (GetAccessors): Drop this routine, as it did not work in the
7870         presence of partially overwritten set/get methods. 
7871
7872         Notice that this broke the cs1540 detection, but that will require
7873         more thinking. 
7874
7875 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7876
7877         * class.cs:
7878         * codegen.cs:
7879         * driver.cs: issue a warning instead of an error if we don't support
7880         debugging for the platform. Also ignore a couple of errors that may
7881         arise when trying to write the symbols. Undo my previous patch.
7882
7883 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7884
7885         * driver.cs: ignore /debug switch except for Unix platforms.
7886
7887 2002-10-23  Nick Drochak  <ndrochak@gol.com>
7888
7889         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
7890
7891 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
7892
7893         * driver.cs: Do not make mcs-debug conditional, so we do not break
7894         builds that use it.
7895
7896         * statement.cs (UsageVector.MergeChildren): I would like Martin to
7897         review this patch.  But basically after all the children variables
7898         have been merged, the value of "Breaks" was not being set to
7899         new_breaks for Switch blocks.  I think that it should be set after
7900         it has executed.  Currently I set this to the value of new_breaks,
7901         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
7902         conservative, but I do not understand this code very well.
7903
7904         I did not break anything in the build, so that is good ;-)
7905
7906         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
7907
7908 2002-10-20  Mark Crichton  <crichton@gimp.org>
7909
7910         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
7911
7912 2002-10-20  Nick Drochak  <ndrochak@gol.com>
7913
7914         * cfold.cs: Fixed compile blocker.
7915
7916 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * driver.cs: I was chekcing the key, not the file.
7919
7920 2002-10-19  Ravi Pratap  <ravi@ximian.com>
7921
7922         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
7923         message that we were generating - we just need to silently return
7924         a null.
7925
7926 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
7927
7928         * class.cs (Event.Define): Change my previous commit, as this
7929         breaks the debugger.  This is a temporary hack, as it seems like
7930         the compiler is generating events incorrectly to begin with.
7931
7932         * expression.cs (Binary.ResolveOperator): Added support for 
7933         "U operator - (E x, E y)"
7934
7935         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
7936         y)".
7937
7938         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
7939         init-only variables, but this path did not take into account that
7940         there might be also instance readonly variables.  Correct this
7941         problem. 
7942
7943         This fixes bug 32253
7944
7945         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
7946         delegates as well.
7947
7948         * driver.cs: Change the extension for modules to `netmodule'
7949
7950         * cs-parser.jay: Improved slightly the location tracking for
7951         the debugger symbols.
7952
7953         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
7954         modifiers that were specified instead of the hardcoded value
7955         (FamAndAssem).  This was basically ignoring the static modifier,
7956         and others.  Fixes 32429.
7957
7958         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
7959         fixed a bug in the process (32476)
7960
7961         * expression.cs (ArrayAccess.EmitAssign): Patch from
7962         hwang_rob@yahoo.ca that fixes bug 31834.3
7963
7964 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
7965
7966         * driver.cs: Make the module extension .netmodule.
7967
7968 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
7969
7970         * driver.cs: Report an error if the resource file is not found
7971         instead of crashing.
7972
7973         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
7974         false, like Emit does.
7975
7976 2002-10-16  Nick Drochak  <ndrochak@gol.com>
7977
7978         * typemanager.cs: Remove unused private member.  Also reported mcs
7979         bug to report this as a warning like csc.
7980
7981 2002-10-15  Martin Baulig  <martin@gnome.org>
7982
7983         * statement.cs (Statement.Emit): Made this a virtual method; emits
7984         the line number info and calls DoEmit().
7985         (Statement.DoEmit): New protected abstract method, formerly knows
7986         as Statement.Emit().
7987
7988         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
7989
7990 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
7991
7992         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
7993         have fixed a remaining problem: not every AddXXXX was adding a
7994         fully qualified name.  
7995
7996         Now everyone registers a fully qualified name in the DeclSpace as
7997         being defined instead of the partial name.  
7998
7999         Downsides: we are slower than we need to be due to the excess
8000         copies and the names being registered this way.  
8001
8002         The reason for this is that we currently depend (on the corlib
8003         bootstrap for instance) that types are fully qualified, because
8004         we dump all the types in the namespace, and we should really have
8005         types inserted into the proper namespace, so we can only store the
8006         basenames in the defined_names array.
8007
8008 2002-10-10  Martin Baulig  <martin@gnome.org>
8009
8010         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
8011         from bug #31834, see the bug report for a testcase which is
8012         miscompiled.
8013
8014 2002-10-10  Martin Baulig  <martin@gnome.org>
8015
8016         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
8017         flow analysis code for this.
8018
8019         * statement.cs (Do, While, For): Tell the flow analysis code about
8020         infinite loops.
8021         (FlowBranching.UsageVector): Added support for infinite loops.
8022         (Block.Resolve): Moved the dead code elimination here and use flow
8023         analysis to do it.
8024
8025 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
8026
8027         * class.cs (Field.Define): Catch cycles on struct type
8028         definitions. 
8029
8030         * typemanager.cs (IsUnmanagedtype): Do not recursively check
8031         fields if the fields are static.  We only need to check instance
8032         fields. 
8033
8034         * expression.cs (As.DoResolve): Test for reference type.
8035
8036         * statement.cs (Using.ResolveExpression): Use
8037         ConvertImplicitRequired, not ConvertImplicit which reports an
8038         error on failture
8039         (Using.ResolveLocalVariableDecls): ditto.
8040
8041         * expression.cs (Binary.ResolveOperator): Report errors in a few
8042         places where we had to.
8043
8044         * typemanager.cs (IsUnmanagedtype): Finish implementation.
8045
8046 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
8047
8048         * expression.cs: Use StoreFromPtr instead of extracting the type
8049         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
8050
8051         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
8052         an enumeration value to a System.Enum, but System.Enum is not a
8053         value type, but an class type, so we need to box.
8054
8055         (Expression.ConvertExplicit): One codepath could return
8056         errors but not flag them.  Fix this.  Fixes #31853
8057
8058         * parameter.cs (Resolve): Do not allow void as a parameter type.
8059
8060 2002-10-06  Martin Baulig  <martin@gnome.org>
8061
8062         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
8063         if it's a class type and not a struct.  Fixes #31815.
8064
8065 2002-10-06  Martin Baulig  <martin@gnome.org>
8066
8067         * statement.cs: Reworked the flow analysis code a bit to make it
8068         usable for dead code elimination.
8069
8070 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8071
8072         * cs-parser.jay: allow empty source files. Fixes bug #31781.
8073
8074 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
8075
8076         * expression.cs (ComposedCast.DoResolveType): A quick workaround
8077         to fix the test 165, will investigate deeper.
8078
8079 2002-10-04  Martin Baulig  <martin@gnome.org>
8080
8081         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
8082         finally blocks actually work.
8083         (Try.Resolve): We don't need to create a sibling for `finally' if
8084         there is no finally block.
8085
8086 2002-10-04  Martin Baulig  <martin@gnome.org>
8087
8088         * class.cs (Constructor.Define): The default accessibility for a
8089         non-default constructor is private, not public.
8090
8091 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
8092
8093         * class.cs (Constructor): Make AllowedModifiers public, add
8094         EXTERN.
8095
8096         * cs-parser.jay: Perform the modifiers test here, as the
8097         constructor for the Constructor class usually receives a zero
8098         because of the way we create it (first we create, later we
8099         customize, and we were never checking the modifiers).
8100
8101         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
8102         is a version of LookupTypeReflection that includes the type-name
8103         cache.  This can be used as a fast path for functions that know
8104         the fully qualified name and are only calling into *.GetType() to
8105         obtain a composed type.
8106
8107         This is also used by TypeManager.LookupType during its type
8108         composition.
8109
8110         (LookupType): We now also track the real type name, as sometimes
8111         we can get a quey for the real type name from things like
8112         ComposedCast.  This fixes bug 31422.
8113
8114         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
8115         complete type fullname, it does not have to go through the type
8116         resolution system to obtain the composed version of the type (for
8117         obtaining arrays or pointers).
8118
8119         (Conditional.Emit): Use the EmitBoolExpression to
8120         generate nicer code, as requested by Paolo.
8121
8122         (ArrayCreation.CheckIndices): Use the patch from
8123         hwang_rob@yahoo.ca to validate the array initializers. 
8124
8125 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * class.cs (ConstructorInitializer.Emit): simplify code by using
8128         Invocation.EmitCall, and at the same time, fix the bugs in calling
8129         parent constructors that took variable arguments. 
8130
8131         * ecore.cs (Expression.ConvertNumericExplicit,
8132         Expression.ImplicitNumericConversion): Remove the code that
8133         manually wrapped decimal (InternalTypeConstructor call is now gone
8134         as well).
8135
8136         * expression.cs (Cast.TryReduce): Also handle decimal types when
8137         trying to perform a constant fold on the type.
8138
8139         * typemanager.cs (IsUnmanagedtype): Partially implemented.
8140
8141         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
8142         that only turned off an error report, and did nothing else. 
8143
8144 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
8145
8146         * driver.cs: Handle and ignore /fullpaths
8147
8148 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
8149
8150         * expression.cs (Binary.ResolveOperator): Catch the case where
8151         DoNumericPromotions returns true, 
8152
8153         (Binary.DoNumericPromotions): Simplify the code, and the tests.
8154
8155 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
8156
8157         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
8158         report error 70.
8159
8160 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
8161
8162         * ecore.cs (ConvertNumericExplicit): It is not enough that the
8163         conversion exists, but it is also required that the conversion be
8164         performed.  This manifested in "(Type64Enum) 2".  
8165
8166         * class.cs (TypeManager.AddMethod): The fix is not to change
8167         AddEnum, because that one was using a fully qualified name (every
8168         DeclSpace derivative does), but to change the AddMethod routine
8169         that was using an un-namespaced name.  This now correctly reports
8170         the duplicated name.
8171
8172         Revert patch until I can properly fix it.  The issue
8173         is that we have a shared Type space across all namespaces
8174         currently, which is wrong.
8175
8176         Options include making the Namespace a DeclSpace, and merge
8177         current_namespace/current_container in the parser.
8178
8179 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
8180
8181         * cs-parser.jay: Improve error reporting when we get a different
8182         kind of expression in local_variable_type and
8183         local_variable_pointer_type. 
8184
8185         Propagate this to avoid missleading errors being reported.
8186
8187         * ecore.cs (ImplicitReferenceConversion): treat
8188         TypeManager.value_type as a target just like object_type.   As
8189         code like this:
8190
8191         ValueType v = 1;
8192
8193         Is valid, and needs to result in the int 1 being boxed before it
8194         is assigned to the value type v.
8195
8196         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
8197         to validate the enumeration name.
8198
8199         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
8200         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
8201         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
8202
8203         * ecore.cs (TryImplicitIntConversion): When doing an
8204         implicit-enumeration-conversion, check if the type is 64-bits and
8205         perform a conversion before passing to EnumConstant.
8206
8207 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
8208
8209         * decl.cs (Error_AmbiguousTypeReference); New routine used to
8210         report ambiguous type references.  Unlike the MS version, we
8211         report what the ambiguity is.   Innovation at work ;-)
8212
8213         (DeclSpace.FindType): Require a location argument to
8214         display when we display an ambiguous error.
8215
8216         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
8217
8218         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
8219
8220         * expression.cs (EmitDynamicInitializers): Apply patch from
8221         hwang_rob@yahoo.ca that fixes the order in which we emit our
8222         initializers. 
8223
8224 2002-09-21  Martin Baulig  <martin@gnome.org>
8225
8226         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
8227         delegate takes no arguments.
8228
8229 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
8230
8231         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
8232         from integers.
8233
8234         * expression.cs: Extract the underlying type.
8235
8236         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
8237
8238         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
8239
8240 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
8241
8242         * class.cs (TypeContainer.DefineType): We can not use the nice
8243         PackingSize with the size set to 1 DefineType method, because it
8244         will not allow us to define the interfaces that the struct
8245         implements.
8246
8247         This completes the fixing of bug 27287
8248
8249         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
8250         means also structs.  This fixes part of the problem. 
8251         (Expresion.ImplicitReferenceConversionExists): ditto.
8252
8253         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
8254         error if there were no errors reported during the type lookup
8255         process, to avoid duplicates or redundant errors.  Without this
8256         you would get an ambiguous errors plus a type not found.  We have
8257         beaten the user enough with the first error.  
8258
8259         (DeclSparce.FindType): Emit a warning if we have an ambiguous
8260         reference. 
8261
8262         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
8263         during the resolution process, stop the lookup, this avoids
8264         repeated error reports (same error twice).
8265
8266         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
8267
8268         * typemanager.cs (LookupType): Redo the type lookup code to match
8269         the needs of System.Reflection.  
8270
8271         The issue is that System.Reflection requires references to nested
8272         types to begin with a "+" sign instead of a dot.  So toplevel
8273         types look like: "NameSpace.TopLevelClass", and nested ones look
8274         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
8275         levels. 
8276
8277 2002-09-19  Martin Baulig  <martin@gnome.org>
8278
8279         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
8280         says that a method always returns or always throws an exception,
8281         don't report the CS0161.
8282
8283         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
8284         set `Returns = new_returns'.
8285
8286 2002-09-19  Martin Baulig  <martin@gnome.org>
8287
8288         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
8289         to an enum constant, check for a CS0176.
8290
8291 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
8292
8293         * class.cs (TypeContainer.CheckPairedOperators): Now we check
8294         for operators that must be in pairs and report errors.
8295
8296         * ecore.cs (SimpleName.DoResolveType): During the initial type
8297         resolution process, when we define types recursively, we must
8298         check first for types in our current scope before we perform
8299         lookups in the enclosing scopes.
8300
8301         * expression.cs (MakeByteBlob): Handle Decimal blobs.
8302
8303         (Invocation.VerifyArgumentsCompat): Call
8304         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
8305         I thought we were supposed to always call this, but there are a
8306         few places in the code where we dont do it.
8307
8308 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
8309
8310         * driver.cs: Add support in -linkres and -resource to specify the
8311         name of the identifier.
8312
8313 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8314
8315         * ecore.cs (StandardConversionExists): Sync with the conversion
8316         code: allow anything-* to void* conversions.
8317
8318         (FindMostSpecificSource): Use an Expression argument
8319         instead of a Type, because we might be handed over a Literal which
8320         gets a few more implicit conversions that plain types do not.  So
8321         this information was being lost.
8322
8323         Also, we drop the temporary type-holder expression when not
8324         required.
8325
8326 2002-09-17  Martin Baulig  <martin@gnome.org>
8327
8328         * class.cs (PropertyBase.CheckBase): Don't check the base class if
8329         this is an explicit interface implementation.
8330
8331 2002-09-17  Martin Baulig  <martin@gnome.org>
8332
8333         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
8334         different `IndexerName' attributes.
8335
8336         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
8337         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
8338         virtual CommonResolve().
8339
8340 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
8341
8342         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
8343         and convert that to the UnderlyingType.
8344
8345         * statement.cs (Foreach.Resolve): Indexers are just like variables
8346         or PropertyAccesses.
8347
8348         * cs-tokenizer.cs (consume_string): Track line numbers and columns
8349         inside quoted strings, we were not doing this before.
8350
8351 2002-09-16  Martin Baulig  <martin@gnome.org>
8352
8353         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
8354         resolve it.  This is needed for the definite assignment check of the
8355         instance expression, fixes bug #29846.
8356         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
8357
8358 2002-09-16  Nick Drochak  <ndrochak@gol.com>
8359
8360         * parameter.cs: Fix compile error.  Cannot reference static member
8361         from an instance object.  Is this an mcs bug?
8362
8363 2002-09-14  Martin Baulig  <martin@gnome.org>
8364
8365         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
8366         multiple times.  Fixes bug #30295, added test-166.cs.
8367
8368 2002-09-14  Martin Baulig  <martin@gnome.org>
8369
8370         * statement.cs (Block.Emit): Don't emit unreachable code.
8371         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
8372         `break' statements.
8373         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
8374
8375 2002-09-14  Martin Baulig  <martin@gnome.org>
8376
8377         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
8378         is set.
8379
8380 2002-09-14  Martin Baulig  <martin@gnome.org>
8381
8382         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
8383         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
8384         be false on the ms runtime.
8385
8386 2002-09-13  Martin Baulig  <martin@gnome.org>
8387
8388         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
8389         the CS0038 error message.
8390
8391 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
8392
8393         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
8394         constant inside, return it.
8395
8396 2002-09-12  Martin Baulig  <martin@gnome.org>
8397
8398         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
8399         implicit conversion can be done between enum types.
8400
8401         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
8402         check whether an implicit conversion to the current enum's UnderlyingType
8403         exists and report an error if not.
8404
8405         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
8406         without debugging support.
8407
8408         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
8409         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
8410
8411 2002-09-12  Martin Baulig  <martin@gnome.org>
8412
8413         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
8414
8415         * ecore.cs (IMemberExpr.DeclaringType): New property.
8416         (SimpleName.SimpleNameResolve): Check whether we're accessing a
8417         nonstatic member of an outer type (CS0038).
8418
8419 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
8420
8421         * driver.cs: Activate the using-error detector at warning level
8422         4 (at least for MS-compatible APIs).
8423
8424         * namespace.cs (VerifyUsing): Small buglett fix.
8425
8426         * pending.cs (PendingImplementation): pass the container pointer. 
8427
8428         * interface.cs (GetMethods): Allow for recursive definition.  Long
8429         term, I would like to move every type to support recursive
8430         definitions, not the current ordering mechanism that we have right
8431         now.
8432
8433         The situation is this: Attributes are handled before interfaces,
8434         so we can apply attributes to interfaces.  But some attributes
8435         implement interfaces, we will now handle the simple cases
8436         (recursive definitions will just get an error).  
8437
8438         * parameter.cs: Only invalidate types at the end if we fail to
8439         lookup all types.  
8440
8441 2002-09-09  Martin Baulig  <martin@gnome.org>
8442
8443         * ecore.cs (PropertyExpr.Emit): Also check for
8444         TypeManager.system_int_array_get_length so this'll also work when
8445         compiling corlib.  Fixes #30003.
8446
8447 2002-09-09  Martin Baulig  <martin@gnome.org>
8448
8449         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
8450         and throw an exception if we can't get the type's size.  Fixed #30040,
8451         added test-165.cs.
8452
8453 2002-09-09  Martin Baulig  <martin@gnome.org>
8454
8455         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
8456
8457         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
8458         context.  Fixes bug #30027.
8459
8460         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
8461         virtual functions.  Fixes bug #30043, added test-164.cs.
8462
8463 2002-09-08  Ravi Pratap  <ravi@ximian.com>
8464
8465         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
8466
8467 2002-09-08  Nick Drochak  <ndrochak@gol.com>
8468
8469         * driver.cs: Use an object to get the windows codepage since it's not a
8470         static property.
8471
8472 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
8473
8474         * statement.cs (For.Emit): for infinite loops (test == null)
8475         return whether there is a break inside, not always "true".
8476
8477         * namespace.cs (UsingEntry): New struct to hold the name of the
8478         using definition, the location where it is defined, and whether it
8479         has been used in a successful type lookup.
8480
8481         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
8482         strings.
8483
8484         * decl.cs: ditto.
8485
8486 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8487
8488         * attribute.cs : Fix incorrect code which relied on catching
8489         a NullReferenceException to detect a null being passed in
8490         where an object was expected.
8491
8492 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
8493
8494         * statement.cs (Try): flag the catch variable as assigned
8495
8496         * expression.cs (Cast): Simplified by using ResolveType instead of
8497         manually resolving.
8498
8499         * statement.cs (Catch): Fix bug by using ResolveType.
8500
8501 2002-09-06  Ravi Pratap  <ravi@ximian.com>
8502
8503         * expression.cs (BetterConversion): Special case for when we have
8504         a NullLiteral as the argument and we have to choose between string
8505         and object types - we choose string the way csc does.
8506
8507         * attribute.cs (Attribute.Resolve): Catch the
8508         NullReferenceException and report error #182 since the Mono
8509         runtime no more has the bug and having this exception raised means
8510         we tried to select a constructor which takes an object and is
8511         passed a null.
8512
8513 2002-09-05  Ravi Pratap  <ravi@ximian.com>
8514
8515         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
8516         message (1502, 1503) when we can't locate a method after overload
8517         resolution. This is much more informative and closes the bug
8518         Miguel reported.
8519
8520         * interface.cs (PopulateMethod): Return if there are no argument
8521         types. Fixes a NullReferenceException bug.
8522
8523         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
8524         expressions too. Previously we were checking only in one place for
8525         positional arguments leaving out named arguments.
8526
8527         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
8528         type to the enum type is not allowed. Remove code corresponding to
8529         that.
8530
8531         (ConvertNumericExplicit): Allow explicit conversions from
8532         the underlying type to enum type. This precisely follows the spec
8533         and closes a bug filed by Gonzalo.
8534
8535 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8536
8537         * compiler.csproj:
8538         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
8539
8540 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
8541
8542         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
8543         it was important that we stored the right value after the
8544         reduction in `converted'.
8545
8546 2002-09-04  Martin Baulig  <martin@gnome.org>
8547
8548         * location.cs (Location.SymbolDocument): Use full pathnames for the
8549         source files.
8550
8551 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
8552
8553         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
8554         of the expression resolve mechanism, because that will catch the
8555         SimpleName error failures.
8556
8557         (Conditional): If we can not resolve the
8558         expression, return, do not crash.
8559
8560 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8561
8562         * cs-tokenizer.cs:
8563         (location): display token name instead of its number.
8564
8565 2002-08-28  Martin Baulig  <martin@gnome.org>
8566
8567         * expression.cs (Binary.ResolveOperator): Don't silently return
8568         but return an error if an operator cannot be applied between two
8569         enum types.
8570
8571 2002-08-28  Martin Baulig  <martin@gnome.org>
8572
8573         * class.cs (Constructor.Define): Set the permission attributes
8574         correctly instead of making all constructors public.
8575
8576 2002-08-28  Martin Baulig  <martin@gnome.org>
8577
8578         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
8579         for private members before reporting a CS0103; if we find anything,
8580         it's a CS0122.
8581
8582 2002-08-28  Martin Baulig  <martin@gnome.org>
8583
8584         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
8585         to check whether `closure_start_type == closure_invocation_type',
8586         we also need to check whether `m.DeclaringType == closure_invocation_type'
8587         before bypassing the permission checks.  We might be accessing
8588         protected/private members from the base class.
8589         (TypeManager.RealMemberLookup): Only set private_ok if private
8590         members were requested via BindingFlags.NonPublic.
8591
8592         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
8593
8594         * expression.cs (MemberAccess.ResolveMemberAccess): Set
8595         MethodGroupExpr.IsExplicitImpl if appropriate.
8596         (Invocation.DoResolve): Don't report the CS0120 for explicit
8597         interface implementations.
8598
8599 2002-08-27  Martin Baulig  <martin@gnome.org>
8600
8601         * expression.cs (Invocation.DoResolve): If this is a static
8602         method and we don't have an InstanceExpression, we must report
8603         a CS0120.
8604
8605 2002-08-25  Martin Baulig  <martin@gnome.org>
8606
8607         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
8608         `==' between a valuetype and an object.
8609
8610 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
8611
8612         * ecore.cs (TypeExpr): Provide a ToString method.
8613
8614 2002-08-24  Martin Baulig  <martin@gnome.org>
8615
8616         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
8617         now called proggie.dbg and it's a binary file.
8618
8619 2002-08-23  Martin Baulig  <martin@gnome.org>
8620
8621         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
8622
8623 2002-08-23  Martin Baulig  <martin@gnome.org>
8624
8625         * struct.cs (MyStructInfo.ctor): Make this work with empty
8626         structs; it's not allowed to use foreach() on null.
8627
8628 2002-08-23  Martin Baulig  <martin@gnome.org>
8629
8630         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
8631         writer the full pathname of the generated assembly.
8632
8633 2002-08-23  Martin Baulig  <martin@gnome.org>
8634
8635         * statements.cs (FlowBranching.UsageVector.MergeChildren):
8636         A `finally' block never returns or breaks; improved handling of
8637         unreachable code.
8638
8639 2002-08-23  Martin Baulig  <martin@gnome.org>
8640
8641         * statement.cs (Throw.Resolve): Allow `throw null'.
8642
8643 2002-08-23  Martin Baulig  <martin@gnome.org>
8644
8645         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
8646         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
8647         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
8648         MemberLookup would return a wrong event if this is an explicit
8649         interface implementation and the class has an event with the same
8650         name.
8651
8652 2002-08-23  Martin Baulig  <martin@gnome.org>
8653
8654         * statement.cs (Block.AddChildVariableNames): New public method.
8655         (Block.AddChildVariableName): Likewise.
8656         (Block.IsVariableNameUsedInChildBlock): Likewise.
8657         (Block.AddVariable): Check whether a variable name has already
8658         been used in a child block.
8659
8660         * cs-parser.jay (declare_local_variables): Mark all variable names
8661         from the current block as being used in a child block in the
8662         implicit block.
8663
8664 2002-08-23  Martin Baulig  <martin@gnome.org>
8665
8666         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
8667         find the symbol writer.
8668
8669         * driver.cs: csc also allows the arguments to /define being
8670         separated by commas, not only by semicolons.
8671
8672 2002-08-23  Martin Baulig  <martin@gnome.org>
8673
8674         * interface.cs (Interface.GetMembers): Added static check for events.
8675
8676 2002-08-15  Martin Baulig  <martin@gnome.org>
8677
8678         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
8679         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
8680
8681         * ecore.cs (Expression.MemberLookup): Added documentation and explained
8682         why the MethodData.EmitDestructor() change was necessary.
8683
8684 2002-08-20  Martin Baulig  <martin@gnome.org>
8685
8686         * class.cs (TypeContainer.FindMembers): Added static check for events.
8687
8688         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
8689
8690         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
8691         use Type.GetEvents(), not Type.FindMembers().
8692
8693 2002-08-20  Martin Baulig  <martin@gnome.org>
8694
8695         * decl.cs (MemberCache): Added a special method cache which will
8696         be used for method-only searched.  This ensures that a method
8697         search will return a MethodInfo with the correct ReflectedType for
8698         inherited methods.      
8699
8700 2002-08-20  Martin Baulig  <martin@gnome.org>
8701
8702         * decl.cs (DeclSpace.FindMembers): Made this public.
8703
8704 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8705
8706         * delegate.cs: fixed build on windows.
8707         [FIXME:  Filed as bug #29150: MCS must report these errors.]
8708
8709 2002-08-19  Ravi Pratap  <ravi@ximian.com>
8710
8711         * ecore.cs (StandardConversionExists): Return a false
8712         if we are trying to convert the void type to anything else
8713         since that is not allowed.
8714
8715         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
8716         we flag error 70 in the event an event is trying to be accessed
8717         directly from outside the declaring type.
8718
8719 2002-08-20  Martin Baulig  <martin@gnome.org>
8720
8721         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
8722         MemberCache from typemanager.cs to decl.cs.
8723
8724 2002-08-19  Martin Baulig  <martin@gnome.org>
8725
8726         * class.cs (TypeContainer): Implement IMemberContainer.
8727         (TypeContainer.DefineMembers): Create the MemberCache.
8728         (TypeContainer.FindMembers): Do better BindingFlags checking; only
8729         return public members if BindingFlags.Public was given, check
8730         whether members are static.
8731
8732 2002-08-16  Martin Baulig  <martin@gnome.org>
8733
8734         * decl.cs (DeclSpace.Define): Splitted this in Define and
8735         DefineMembers.  DefineMembers is called first and initializes the
8736         MemberCache.
8737
8738         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
8739         DefineMembers() on all our DeclSpaces.
8740
8741         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
8742         but call DefineMembers() on all nested interfaces.  We call their
8743         Define() in our new Define() function.
8744
8745         * interface.cs (Interface): Implement IMemberContainer.
8746         (Interface.Define): Moved all code except the attribute stuf to
8747         DefineMembers().
8748         (Interface.DefineMembers): Initialize the member cache.
8749
8750         * typemanager.cs (IMemberFinder): Removed this interface, we don't
8751         need this anymore since we can use MemberCache.FindMembers directly.
8752
8753 2002-08-19  Martin Baulig  <martin@gnome.org>
8754
8755         * typemanager.cs (MemberCache): When creating the cache for an
8756         interface type, add all inherited members.
8757         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
8758         to `out bool used_cache' and documented it.
8759         (TypeManager.MemberLookup): If we already used the cache in the first
8760         iteration, we don't need to do the interfaces check.
8761
8762 2002-08-19  Martin Baulig  <martin@gnome.org>
8763
8764         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
8765         here from IMemberFinder and don't implement this interface anymore.
8766         (DeclSpace.MemberCache): Moved here from IMemberFinder.
8767
8768         * typemanager.cs (IMemberFinder): This interface is now only used by
8769         classes which actually support the member cache.
8770         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
8771         since we only put DeclSpaces into this Hashtable.
8772         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
8773         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
8774
8775 2002-08-16  Martin Baulig  <martin@gnome.org>
8776
8777         * typemanager.cs (ICachingMemberFinder): Removed.
8778         (IMemberFinder.MemberCache): New property.
8779         (TypeManager.FindMembers): Merged this with RealFindMembers().
8780         This function will never be called from TypeManager.MemberLookup()
8781         so we can't use the cache here, just the IMemberFinder.
8782         (TypeManager.MemberLookup_FindMembers): Check whether the
8783         IMemberFinder has a MemberCache and call the cache's FindMembers
8784         function.
8785         (MemberCache): Rewrote larger parts of this yet another time and
8786         cleaned it up a bit.
8787
8788 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * driver.cs (LoadArgs): Support quoting.
8791
8792         (Usage): Show the CSC-like command line arguments.
8793
8794         Improved a few error messages.
8795
8796 2002-08-15  Martin Baulig  <martin@gnome.org>
8797
8798         * typemanager.cs (IMemberContainer.Type): New property.
8799         (IMemberContainer.IsInterface): New property.
8800
8801         The following changes are conditional to BROKEN_RUNTIME, which is
8802         defined at the top of the file.
8803
8804         * typemanager.cs (MemberCache.MemberCache): Don't add the base
8805         class'es members, but add all members from TypeHandle.ObjectType
8806         if we're an interface.
8807         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
8808         is the current type.
8809         (MemberCache.CacheEntry.Container): Removed this field.
8810         (TypeHandle.GetMembers): Include inherited members.
8811
8812 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8813
8814         * typemanager.cs: fixed compilation and added a comment on a field that
8815         is never used.
8816
8817 2002-08-15  Martin Baulig  <martin@gnome.org>
8818
8819         * class.cs (ConstructorInitializer.Resolve): In the
8820         Expression.MemberLookup call, use the queried_type as
8821         invocation_type.
8822
8823         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
8824         declared' attribute, it's always true.
8825         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
8826         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
8827         temporary wrapper for FindMembers which tells MemberLookup whether
8828         members from the base classes are included in the return value.
8829         This will go away soon.
8830         (TypeManager.MemberLookup): Use this temporary hack here; once the
8831         new MemberCache is completed, we don't need to do the DeclaredOnly
8832         looping here anymore since the MemberCache will take care of this.
8833         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
8834         (MemberCache): When creating the MemberCache for a class, get
8835         members from the current class and all its base classes.
8836         (MemberCache.CacheEntry.Container): New field.  This is a
8837         temporary hack until the Mono runtime is fixed to distinguish
8838         between ReflectedType and DeclaringType.  It allows us to use MCS
8839         with both the MS runtime and the unfixed Mono runtime without
8840         problems and without accecting performance.
8841         (MemberCache.SearchMembers): The DeclaredOnly looping from
8842         TypeManager.MemberLookup is now done here.      
8843
8844 2002-08-14  Martin Baulig  <martin@gnome.org>
8845
8846         * statement.cs (MyStructInfo.MyStructInfo): Don't call
8847         Type.GetFields on dynamic types but get the fields from the
8848         corresponding TypeContainer.
8849         (MyStructInfo.GetStructInfo): Added check for enum types.
8850
8851         * typemanager.cs (MemberList.IsSynchronized): Implemented.
8852         (MemberList.SyncRoot): Implemented.
8853         (TypeManager.FilterWithClosure): No need to check permissions if
8854         closure_start_type == closure_invocation_type, don't crash if
8855         closure_invocation_type is null.
8856
8857 2002-08-13  Martin Baulig  <martin@gnome.org>
8858
8859         Rewrote TypeContainer.FindMembers to use a member cache.  This
8860         gives us a speed increase of about 35% for the self-hosting MCS
8861         build and of about 15-20% for the class libs (both on GNU/Linux).
8862
8863         * report.cs (Timer): New class to get enhanced profiling.  This
8864         whole class is "TIMER" conditional since it remarkably slows down
8865         compilation speed.
8866
8867         * class.cs (MemberList): New class.  This is an IList wrapper
8868         which we're now using instead of passing MemberInfo[]'s around to
8869         avoid copying this array unnecessarily.
8870         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
8871         (ICachingMemberFinder, IMemberContainer): New interface.
8872         (TypeManager.FilterWithClosure): If `criteria' is null, the name
8873         has already been checked, otherwise use it for the name comparision.
8874         (TypeManager.FindMembers): Renamed to RealMemberFinder and
8875         provided wrapper which tries to use ICachingMemberFinder.FindMembers
8876         if possible.  Returns a MemberList, not a MemberInfo [].
8877         (TypeHandle): New class, implements IMemberContainer.  We create
8878         one instance of this class per type, it contains a MemberCache
8879         which is used to do the member lookups.
8880         (MemberCache): New class.  Each instance of this class contains
8881         all members of a type and a name-based hash table.
8882         (MemberCache.FindMembers): This is our new member lookup
8883         function.  First, it looks up all members of the requested name in
8884         the hash table.  Then, it walks this list and sorts out all
8885         applicable members and returns them.
8886
8887 2002-08-13  Martin Baulig  <martin@gnome.org>
8888
8889         In addition to a nice code cleanup, this gives us a performance
8890         increase of about 1.4% on GNU/Linux - not much, but it's already
8891         half a second for the self-hosting MCS compilation.
8892
8893         * typemanager.cs (IMemberFinder): New interface.  It is used by
8894         TypeManager.FindMembers to call FindMembers on a TypeContainer,
8895         Enum, Delegate or Interface.
8896         (TypeManager.finder_to_member_finder): New PtrHashtable.
8897         (TypeManager.finder_to_container): Removed.
8898         (TypeManager.finder_to_delegate): Removed.
8899         (TypeManager.finder_to_interface): Removed.
8900         (TypeManager.finder_to_enum): Removed.
8901
8902         * interface.cs (Interface): Implement IMemberFinder.
8903
8904         * delegate.cs (Delegate): Implement IMemberFinder.
8905
8906         * enum.cs (Enum): Implement IMemberFinder.
8907
8908         * class.cs (TypeContainer): Implement IMemberFinder.
8909
8910 2002-08-12  Martin Baulig  <martin@gnome.org>
8911
8912         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
8913
8914 2002-08-12  Martin Baulig  <martin@gnome.org>
8915
8916         * ecore.cs (ITypeExpression): New interface for expressions which
8917         resolve to a type.
8918         (TypeExpression): Renamed to TypeLookupExpression.
8919         (Expression.DoResolve): If we're doing a types-only lookup, the
8920         expression must implement the ITypeExpression interface and we
8921         call DoResolveType() on it.
8922         (SimpleName): Implement the new ITypeExpression interface.
8923         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
8924         hack, the situation that we're only looking up types can't happen
8925         anymore when this method is called.  Moved the type lookup code to
8926         DoResolveType() and call it.
8927         (SimpleName.DoResolveType): This ITypeExpression interface method
8928         is now doing the types-only lookup.
8929         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
8930         (ResolveFlags): Added MaskExprClass.
8931
8932         * expression.cs (MemberAccess): Implement the ITypeExpression
8933         interface.
8934         (MemberAccess.DoResolve): Added support for a types-only lookup
8935         when we're called via ITypeExpression.DoResolveType().
8936         (ComposedCast): Implement the ITypeExpression interface.
8937
8938         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
8939         Expression.Resolve() with ResolveFlags.Type instead.
8940
8941 2002-08-12  Martin Baulig  <martin@gnome.org>
8942
8943         * interface.cs (Interface.Define): Apply attributes.
8944
8945         * attribute.cs (Attribute.ApplyAttributes): Added support for
8946         interface attributes.
8947
8948 2002-08-11  Martin Baulig  <martin@gnome.org>
8949
8950         * statement.cs (Block.Emit): Only check the "this" variable if we
8951         do not always throw an exception.
8952
8953         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
8954         whether the property has a set accessor.
8955
8956 2002-08-11  Martin Baulig  <martin@gnome.org>
8957
8958         Added control flow analysis support for structs.
8959
8960         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
8961         with control flow analysis turned off.
8962         (IVariable): New interface.
8963         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
8964         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
8965         (FieldExpr.DoResolve): Resolve the instance expression with flow
8966         analysis turned off and do the definite assignment check after the
8967         resolving when we know what the expression will resolve to.
8968
8969         * expression.cs (LocalVariableReference, ParameterReference):
8970         Implement the new IVariable interface, only call the flow analysis
8971         code if ec.DoFlowAnalysis is true.
8972         (This): Added constructor which takes a Block argument.  Implement
8973         the new IVariable interface.
8974         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
8975         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
8976         This does the definite assignment checks for struct members.
8977
8978         * class.cs (Constructor.Emit): If this is a non-static `struct'
8979         constructor which doesn't have any initializer, call
8980         Block.AddThisVariable() to tell the flow analysis code that all
8981         struct elements must be initialized before control returns from
8982         the constructor.
8983
8984         * statement.cs (MyStructInfo): New public class.
8985         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
8986         argument to this indexer.  If non-zero, check an individual struct
8987         member, not the whole struct.
8988         (FlowBranching.CheckOutParameters): Check struct members.
8989         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
8990         overloaded versions of these methods which take an additional
8991         `int field_idx' argument to check struct members.
8992         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
8993         overloaded versions of these methods which take an additional
8994         `string field_name' argument to check struct member.s
8995         (VariableInfo): Implement the IVariable interface.
8996         (VariableInfo.StructInfo): New public property.  Returns the
8997         MyStructInfo instance of the variable if it's a struct or null.
8998         (Block.AddThisVariable): New public method.  This is called from
8999         Constructor.Emit() for non-static `struct' constructor which do
9000         not have any initializer.  It creates a special variable for the
9001         "this" instance variable which will be checked by the flow
9002         analysis code to ensure that all of the struct's fields are
9003         initialized before control returns from the constructor.
9004         (UsageVector): Added support for struct members.  If a
9005         variable/parameter is a struct with N members, we reserve a slot
9006         in the usage vector for each member.  A struct is considered fully
9007         initialized if either the struct itself (slot 0) or all its
9008         members are initialized.
9009
9010 2002-08-08  Martin Baulig  <martin@gnome.org>
9011
9012         * driver.cs (Driver.MainDriver): Only report an error CS5001
9013         if there were no compilation errors.
9014
9015         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
9016         `UnsafeContext' property to determine whether the parent is in
9017         unsafe context rather than checking the parent's ModFlags:
9018         classes nested in an unsafe class are unsafe as well.
9019
9020 2002-08-08  Martin Baulig  <martin@gnome.org>
9021
9022         * statement.cs (UsageVector.MergeChildren): Distinguish between
9023         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
9024         we return.  Added test17() and test18() to test-154.cs.
9025
9026 2002-08-08  Martin Baulig  <martin@gnome.org>
9027
9028         * typemanager.cs (TypeManager.FilterWithClosure): If we have
9029         Family access, make sure the invoking type isn't a subclass of the
9030         queried type (that'd be a CS1540).
9031
9032         * ecore.cs (Expression.MemberLookup): Added overloaded version of
9033         this method which takes an additional `Type invocation_type'.
9034
9035         * expression.cs (BaseAccess.DoResolve): Use the base type as
9036         invocation and query type.
9037         (MemberAccess.DoResolve): If the lookup failed and we're about to
9038         report a CS0122, try a lookup with the ec.ContainerType - if this
9039         succeeds, we must report a CS1540.
9040
9041 2002-08-08  Martin Baulig  <martin@gnome.org>
9042
9043         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
9044         (MethodGroupExpr): Implement the IMemberExpr interface.
9045
9046         * expression (MemberAccess.ResolveMemberAccess): No need to have
9047         any special code for MethodGroupExprs anymore, they're now
9048         IMemberExprs.   
9049
9050 2002-08-08  Martin Baulig  <martin@gnome.org>
9051
9052         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
9053         Family, FamANDAssem and FamORAssem permissions.
9054         (TypeManager.IsSubclassOrNestedChildOf): New public method.
9055
9056 2002-08-08  Martin Baulig  <martin@gnome.org>
9057
9058         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
9059         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
9060         or loop block.
9061
9062 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
9063
9064         * driver.cs: implemented /resource option to embed managed resources.
9065
9066 2002-08-07  Martin Baulig  <martin@gnome.org>
9067
9068         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
9069         (FieldBase.HasFieldInitializer): New public property.
9070         (FieldBase.GetInitializerExpression): New public method.  Resolves and
9071         returns the field initializer and makes sure it is only resolved once.
9072         (TypeContainer.EmitFieldInitializers): Call
9073         FieldBase.GetInitializerExpression to get the initializer, this ensures
9074         that it isn't resolved multiple times.
9075
9076         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
9077         the resolving process (SimpleName/MemberLookup) that we're currently
9078         emitting a field initializer (which must not access any instance members,
9079         this is an error CS0236).
9080
9081         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
9082         argument, if the `IsFieldInitializer' flag is set, we must report and
9083         error CS0236 and not an error CS0120.   
9084
9085 2002-08-07  Martin Baulig  <martin@gnome.org>
9086
9087         * ecore.cs (IMemberExpr): New public interface.
9088         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
9089         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
9090         if the expression is an IMemberExpr.
9091
9092         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
9093         to be null, implicitly default to `this' if we're non-static in
9094         this case.  Simplified the code a lot by using the new IMemberExpr
9095         interface.  Also fixed bug #28176 here.
9096
9097 2002-08-06  Martin Baulig  <martin@gnome.org>
9098
9099         * cs-parser.jay (SimpleLookup): Removed.  We need to create
9100         ParameterReferences during semantic analysis so that we can do a
9101         type-only search when resolving Cast, TypeOf and SizeOf.
9102         (block): Pass the `current_local_parameters' to the Block's
9103         constructor.
9104
9105         * class.cs (ConstructorInitializer): Added `Parameters parameters'
9106         argument to the constructor.
9107         (ConstructorInitializer.Resolve): Create a temporary implicit
9108         block with the parameters.
9109
9110         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
9111         references here if we aren't doing a type-only search.
9112
9113         * statement.cs (Block): Added constructor which takes a
9114         `Parameters parameters' argument.
9115         (Block.Parameters): New public property.
9116
9117         * support.cs (InternalParameters.Parameters): Renamed `parameters'
9118         to `Parameters' and made it public readonly.
9119
9120 2002-08-06  Martin Baulig  <martin@gnome.org>
9121
9122         * ecore.cs (Expression.Warning): Made this public as well.
9123
9124         * report.cs (Report.Debug): Print the contents of collections.
9125
9126 2002-08-06  Martin Baulig  <martin@gnome.org>
9127
9128         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
9129         used to tell Resolve() which kinds of expressions it may return.
9130         (Expression.Resolve): Added overloaded version of this method which
9131         takes a `ResolveFlags flags' argument.  This can be used to tell
9132         Resolve() which kinds of expressions it may return.  Reports a
9133         CS0118 on error.
9134         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
9135         ResolveFlags.SimpleName.
9136         (Expression.Error118): Added overloaded version of this method which
9137         takes a `ResolveFlags flags' argument.  It uses the flags to determine
9138         which kinds of expressions are allowed.
9139
9140         * expression.cs (Argument.ResolveMethodGroup): New public method.
9141         Resolves an argument, but allows a MethodGroup to be returned.
9142         This is used when invoking a delegate.
9143
9144         * TODO: Updated a bit.
9145
9146 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9147
9148         Fixed compilation with csc.
9149
9150         * ecore.cs: Expression.Error made public. Is this correct? Should
9151         Warning be made public too?
9152
9153         * expression.cs: use ea.Location instead of ea.loc.
9154         [FIXME:  Filed as bug #28607: MCS must report these errors.]
9155
9156 2002-08-06  Martin Baulig  <martin@gnome.org>
9157
9158         * ecore.cs (Expression.loc): Moved the location here instead of
9159         duplicating it in all derived classes.
9160         (Expression.Location): New public property.
9161         (Expression.Error, Expression.Warning): Made them non-static and
9162         removed the location argument.
9163         (Expression.Warning): Added overloaded version which takes an
9164         `int level' argument.
9165         (Expression.Error118): Make this non-static and removed the
9166         expression and location arguments.
9167         (TypeExpr): Added location argument to the constructor.
9168
9169         * expression.cs (StaticCallExpr): Added location argument to
9170         the constructor.
9171         (Indirection, PointerArithmetic): Likewise.
9172         (CheckedExpr, UnCheckedExpr): Likewise.
9173         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
9174         (StringPtr): Likewise.
9175
9176
9177 2002-08-05  Martin Baulig  <martin@gnome.org>
9178
9179         * expression.cs (BaseAccess.DoResolve): Actually report errors.
9180
9181         * assign.cs (Assign.DoResolve): Check whether the source
9182         expression is a value or variable.
9183
9184         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
9185         while resolving the corresponding blocks.
9186
9187         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
9188         an error, don't silently return null.
9189
9190         * statement.cs (Block.AddVariable): Do the error reporting here
9191         and distinguish between CS0128 and CS0136.
9192         (Block.DoResolve): Report all unused labels (warning CS0164).
9193         (LabeledStatement): Pass the location to the constructor.
9194         (LabeledStatement.HasBeenReferenced): New property.
9195         (LabeledStatement.Resolve): Set it to true here.
9196
9197         * statement.cs (Return.Emit): Return success even after reporting
9198         a type mismatch error (CS0126 or CS0127), this is what csc does and
9199         it avoids confusing the users with any consecutive errors.
9200
9201 2002-08-05  Martin Baulig  <martin@gnome.org>
9202
9203         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
9204
9205         * const.cs (Const.LookupConstantValue): Catch circular definitions.
9206
9207         * expression.cs (MemberAccess.DoResolve): Silently return if an
9208         error has already been reported.
9209
9210         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
9211         error has already been reported.
9212
9213 2002-08-05  Martin Baulig  <martin@gnome.org>
9214
9215         * statement.cs (UsageVector): Only initialize the `parameters'
9216         vector if we actually have any "out" parameters.
9217
9218 2002-08-05  Martin Baulig  <martin@gnome.org>
9219
9220         * expression.cs (Binary.ResolveOperator): When combining delegates,
9221         they must have the same type.
9222
9223 2002-08-05  Martin Baulig  <martin@gnome.org>
9224
9225         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
9226         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
9227         work with the ms runtime and we also don't need it: if we're a
9228         PropertyBuilder and not in the `indexer_arguments' hash, then we
9229         are a property and not an indexer.
9230
9231         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
9232         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
9233         since the latter one doesn't work with the ms runtime.
9234
9235 2002-08-03  Martin Baulig  <martin@gnome.org>
9236
9237         Fixed bugs #27998 and #22735.
9238
9239         * class.cs (Method.IsOperator): New public field.
9240         (Method.CheckBase): Report CS0111 if there's already a method
9241         with the same parameters in the current class.  Report CS0508 when
9242         attempting to change the return type of an inherited method.
9243         (MethodData.Emit): Report CS0179 if a method doesn't have a body
9244         and it's not marked abstract or extern.
9245         (PropertyBase): New abstract base class for Property and Indexer.
9246         (PropertyBase.CheckBase): Moved here from Property and made it work
9247         for indexers.
9248         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
9249         the same so we can reuse it there.
9250         (Property, Indexer): Derive from PropertyBase.
9251         (MethodSignature.inheritable_property_signature_filter): New delegate
9252         to find properties and indexers.
9253
9254         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
9255         argument and improved error reporting.
9256
9257         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
9258         EmptyReadOnlyParameters and made it a property.
9259
9260         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
9261         version of this method which takes a `PropertyInfo indexer'.
9262         (TypeManager.RegisterIndexer): New method.
9263
9264         * class.cs: Added myself as author of this file :-)
9265
9266 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9267
9268         * class.cs: fixed compilation on windoze.
9269
9270 2002-08-03  Martin Baulig  <martin@gnome.org>
9271
9272         * interface.cs (Interface.GetInterfaceBases): Check whether all
9273         base interfaces are at least as accessible than the current one.
9274
9275         * class.cs (TypeContainer.GetClassBases): Check whether base types
9276         are at least as accessible than the current type.
9277         (TypeContainer.AsAccessible): Implemented and made non-static.
9278         (MemberBase.CheckParameters): Report errors if the accessibility
9279         checks fail.
9280
9281         * delegate.cs (Delegate.Delegate): The default visibility is
9282         internal for top-level types and private for nested types.
9283         (Delegate.Define): Report errors if the accessibility checks fail.
9284
9285         * enum.cs (Enum.Enum): The default visibility is internal for
9286         top-level types and private for nested types.
9287         (Enum.DefineType): Compute the correct visibility.
9288
9289         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
9290         function which takes a `bool is_toplevel' instead of a TypeContainer.
9291
9292         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
9293         builtin type.
9294
9295 2002-08-02  Martin Baulig  <martin@gnome.org>
9296
9297         * expression.cs (LocalVariableReferenc): Added constructor which
9298         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
9299         (LocalVariableReference.IsReadOnly): New property.
9300         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
9301         variable is readonly, use our own readonly flag to do this; you can
9302         use the new constructor to get a writable reference to a read-only
9303         variable.
9304
9305         * cs-parser.jay (foreach_statement, using_statement): Get a writable
9306         reference to the local variable.
9307
9308 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
9309
9310         * rootcontext.cs (ResolveCore): Also include System.Exception
9311
9312         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
9313         we reach an EmptyStatement.
9314
9315         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
9316         is also fine.
9317
9318         * expression.cs (Binary.ResolveOperator): Check error result in
9319         two places.
9320
9321         use brtrue/brfalse directly and avoid compares to null.
9322
9323 2002-08-02  Martin Baulig  <martin@gnome.org>
9324
9325         * class.cs (TypeContainer.Define): Define all nested interfaces here.
9326         Fixes bug #28407, added test-155.cs.
9327
9328 2002-08-01  Martin Baulig  <martin@gnome.org>
9329
9330         * class.cs (Event.EmitDefaultMethod): Make this work with static
9331         events.  Fixes #28311, added verify-3.cs.
9332
9333 2002-08-01  Martin Baulig  <martin@gnome.org>
9334
9335         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
9336         `is_disposable' fields.
9337         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
9338         `hm.is_disposable' if we're using the collection pattern.
9339         (Foreach.EmitCollectionForeach): Use the correct type for the
9340         enumerator's local variable, only emit the try/finally block if
9341         necessary (fixes #27713).
9342
9343 2002-08-01  Martin Baulig  <martin@gnome.org>
9344
9345         * ecore.cs (Expression.report118): Renamed to Error118 and made
9346         it public static.
9347
9348         * statement.cs (Throw.Resolve): Check whether the expression is of
9349         the correct type (CS0118) and whether the type derives from
9350         System.Exception (CS0155).
9351         (Catch.Resolve): New method.  Do the type lookup here and check
9352         whether it derives from System.Exception (CS0155).
9353         (Catch.CatchType, Catch.IsGeneral): New public properties.
9354
9355         * typemanager.cs (TypeManager.exception_type): Added.
9356
9357 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
9358
9359         * driver.cs: Updated About function.
9360
9361 2002-07-31  Martin Baulig  <martin@gnome.org>
9362
9363         Implemented Control Flow Analysis.
9364
9365         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
9366         (EmitContext.CurrentBranching): Added.
9367         (EmitContext.StartFlowBranching): Added.
9368         (EmitContext.EndFlowBranching): Added.
9369         (EmitContext.KillFlowBranching): Added.
9370         (EmitContext.IsVariableAssigned): Added.
9371         (EmitContext.SetVariableAssigned): Added.
9372         (EmitContext.IsParameterAssigned): Added.
9373         (EmitContext.SetParameterAssigned): Added.
9374         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
9375         Added control flow analysis stuff here.
9376
9377         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
9378         resolve the expression as lvalue.
9379         (LocalVariableReference.DoResolve): Check whether the variable has
9380         already been assigned.
9381         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
9382         the parameter as assigned here.
9383         (ParameterReference.DoResolve): Check whether the parameter has already
9384         been assigned.
9385         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
9386         expression as lvalue.
9387
9388         * statement.cs (FlowBranching): New class for the flow analysis code.
9389         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
9390         (LabeledStatement.IsDefined): New public property.
9391         (LabeledStatement.AddUsageVector): New public method to tell flow
9392         analyis that the label may be reached via a forward jump.
9393         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
9394         flow analysis.
9395         (VariableInfo.Number): New public field.  This is used by flow analysis
9396         to number all locals of a block.
9397         (Block.CountVariables): New public property.  This is the number of
9398         local variables in this block (including the locals from all parent
9399         blocks).
9400         (Block.EmitMeta): Number all the variables.
9401
9402         * statement.cs: Added flow analysis support to all classes.
9403
9404 2002-07-31  Martin Baulig  <martin@gnome.org>
9405
9406         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
9407         To get debugging messages, compile mcs with /define:MCS_DEBUG and
9408         then use this argument.
9409
9410         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
9411
9412         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
9413         use this to specify /define options.
9414
9415 2002-07-29  Martin Baulig  <martin@gnome.org>
9416
9417         * statement.cs (Fixed): Moved all code that does variable lookups
9418         and resolvings from Emit to Resolve.
9419
9420         * statement.cs (For): Moved all code that does variable lookups
9421         and resolvings from Emit to Resolve.
9422
9423         * statement.cs (Using): Moved all code that does variable lookups
9424         and resolvings from Emit to Resolve.
9425
9426 2002-07-29  Martin Baulig  <martin@gnome.org>
9427
9428         * attribute.cs (Attribute.Resolve): Explicitly catch a
9429         System.NullReferenceException when creating the
9430         CustromAttributeBuilder and report a different warning message.
9431
9432 2002-07-29  Martin Baulig  <martin@gnome.org>
9433
9434         * support.cs (ParameterData.ParameterName): Added method to
9435         get the name of a parameter.
9436
9437         * typemanager.cs (TypeManager.IsValueType): New public method.
9438
9439 2002-07-29  Martin Baulig  <martin@gnome.org>
9440
9441         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
9442         is a flag which specifies that it's either ref or out.
9443         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
9444         the out parameter to `out Parameter.Modifier mod', also set the
9445         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
9446
9447         * support.cs (InternalParameters.ParameterModifier): Distinguish
9448         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9449         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9450
9451         * expression.cs (Argument.GetParameterModifier): Distinguish
9452         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
9453         Parameter.Modifier.ISBYREF flag if it's either ref or out.
9454
9455 2002-07-29  Martin Baulig  <martin@gnome.org>
9456
9457         * expression.cs (ParameterReference.ParameterReference): Added
9458         `Location loc' argument to the constructor.
9459
9460         * cs-parser.jay: Pass location to ParameterReference.
9461
9462 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
9463
9464         * statement.cs (Try): Initialize the location.
9465
9466         * cs-parser.jay: pass location to Try.
9467
9468         * expression.cs (Unary.Reduce): Change the prototype to return
9469         whether a constant fold could be performed or not.  The result is
9470         returned in an out parameters.  In the case of Indirection and
9471         AddressOf, we want to perform the full tests.
9472
9473 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
9474
9475         * statement.cs (Statement.Emit): Flag dead code.
9476
9477 2002-07-27  Andrew Birkett  <andy@nobugs.org>
9478
9479         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
9480
9481 2002-07-27  Martin Baulig  <martin@gnome.org>
9482
9483         * class.cs (MethodData.Define): Put back call to
9484         TypeManager.AddMethod(), accidentally commented this out.
9485
9486         * report.cs (Debug): New public method to print debugging information,
9487         this is `[Conditional ("DEBUG")]'.
9488
9489 2002-07-26  Martin Baulig  <martin@gnome.org>
9490
9491         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
9492         (switch_statement): Push the current_block to the switch_stack and
9493         pop it again when we're done with the switch.
9494         (switch_section): The new block is a child of the current_block.
9495         Fixes bug #24007, added test-152.cs.
9496
9497 2002-07-27  Martin Baulig  <martin@gnome.org>
9498
9499         * expression.cs (Invocation.EmitArguments): When calling a varargs
9500         function with only its fixed arguments, we need to pass an empty
9501         array.
9502
9503 2002-07-27  Martin Baulig  <martin@gnome.org>
9504
9505         Mono 0.13 has been released.
9506
9507 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
9508
9509         * driver.cs: Rename --resource to --linkres, because that is what
9510         we do currently, we dont support --resource yet.
9511
9512         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
9513
9514 2002-07-25  Martin Baulig  <martin@gnome.org>
9515
9516         * class.cs (MethodData): New public class.  This is a `method builder'
9517         class for a method or one accessor of a Property/Indexer/Event.
9518         (MethodData.GetMethodFlags): Moved here from MemberBase.
9519         (MethodData.ApplyAttributes): Likewise.
9520         (MethodData.ApplyObsoleteAttribute): Likewise.
9521         (MethodData.ApplyConditionalAttribute): Likewise.
9522         (MethodData.ApplyDllImportAttribute): Likewise.
9523         (MethodData.CheckAbstractAndExternal): Likewise.
9524         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
9525         (MethodData.Emit): Formerly known as Method.Emit().
9526         (MemberBase): Moved everything which was specific to a single
9527         accessor/method to MethodData.
9528         (Method): Create a new MethodData and call Define() and Emit() on it.
9529         (Property, Indexer, Event): Create a new MethodData objects for each
9530         accessor and call Define() and Emit() on them.
9531
9532 2002-07-25  Martin Baulig  <martin@gnome.org>
9533
9534         Made MethodCore derive from MemberBase to reuse the code from there.
9535         MemberBase now also checks for attributes.
9536
9537         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
9538         (MemberBase.GetMethodFlags): Moved here from class Method and marked
9539         as virtual.
9540         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
9541         `CallingConventions cc' and `Attributes opt_attrs' arguments.
9542         (MemberBase.ApplyAttributes): New virtual method; applies the
9543         attributes to a method or accessor.
9544         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
9545         (MemberBase.ApplyConditionalAttribute): Likewise.
9546         (MemberBase.ApplyDllImportAttribute): Likewise.
9547         (MemberBase.CheckAbstractAndExternal): Likewise.
9548         (MethodCore.ParameterTypes): This is now a property instead of a
9549         method, it's initialized from DoDefineParameters().
9550         (MethodCore.ParameterInfo): Removed the set accessor.
9551         (MethodCore.DoDefineParameters): New protected virtual method to
9552         initialize ParameterTypes and ParameterInfo.
9553         (Method.GetReturnType): We can now simply return the MemberType.
9554         (Method.GetMethodFlags): Override the MemberBase version and add
9555         the conditional flags.
9556         (Method.CheckBase): Moved some code from Define() here, call
9557         DoDefineParameters() here.
9558         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
9559         here to avoid some larger code duplication.
9560         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
9561         ensure that abstract and external accessors don't declare a body.
9562
9563         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
9564         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
9565         lookup in the attribute's parent classes, so we need to abort as soon
9566         as we found the first match.
9567         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
9568         the attribute has no arguments.
9569
9570         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
9571         of a Method.
9572
9573 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9574
9575         * cs-parser.jay: reverted previous patch.
9576
9577 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9578
9579         * cs-parser.jay: fixed bug #22119.
9580
9581 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9582
9583         * attribute.cs: fixed compilation. The error was:
9584         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
9585         be assigned to before control leaves the current method."
9586         [FIXME:  Filed as bug #28186: MCS must report this error.]
9587
9588 2002-07-25  Martin Baulig  <martin@gnome.org>
9589
9590         * attribute.cs (Attribute.Conditional_GetConditionName): New static
9591         method to pull the condition name ouf of a Conditional attribute.
9592         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
9593         the obsolete message and error flag out of an Obsolete attribute.
9594
9595         * class.cs (Method.GetMethodFlags): New public method to get the
9596         TypeManager.MethodFlags for this method.
9597         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
9598         private methods.
9599         (Method.Define): Get and apply the Obsolete and Conditional attributes;
9600         if we're overriding a virtual function, set the new private variable
9601         `parent_method'; call the new TypeManager.AddMethod().
9602
9603         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
9604         the MethodBuilder and the Method in a PtrHashtable.
9605         (TypeManager.builder_to_method): Added for this purpose.
9606         (TypeManager.MethodFlags): Added IsObsoleteError.
9607         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
9608         Obsolete and Conditional arguments in MethodBuilders.  If we discover
9609         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
9610         the message from the attribute.
9611
9612 2002-07-24  Martin Baulig  <martin@gnome.org>
9613
9614         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
9615         preprocessor directives, ensure that the argument to #define/#undef is
9616         exactly one identifier and that it's actually an identifier.
9617
9618         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
9619         did not work ....
9620
9621 2002-07-24  Martin Baulig  <martin@gnome.org>
9622
9623         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
9624         initialize it to TypeManager.object_type in the constructor.
9625         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
9626         of the `hm.get_current' method if we're using the collection pattern.
9627         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
9628         for the explicit conversion to make it work when we're using the collection
9629         pattern and the `Current' property has a different return type than `object'.
9630         Fixes #27713.
9631
9632 2002-07-24  Martin Baulig  <martin@gnome.org>
9633
9634         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
9635         does not match, but don't report any errors.  This method is called in
9636         order for all methods in a MethodGroupExpr until a matching method is
9637         found, so we don't want to bail out if the first method doesn't match.
9638         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
9639         matches, report the 123.  Fixes #28070.
9640
9641 2002-07-24  Martin Baulig  <martin@gnome.org>
9642
9643         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
9644         TypeManager.TypeToCoreType() to the top of the method so the
9645         following equality checks will work.  Fixes #28107.
9646
9647 2002-07-24  Martin Baulig  <martin@gnome.org>
9648
9649         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
9650         operand is of type uint, and the other operand is of type sbyte,
9651         short or int, the operands are converted to type long." -
9652         Actually do what this comment already told us.  Fixes bug #28106,
9653         added test-150.cs.
9654
9655 2002-07-24  Martin Baulig  <martin@gnome.org>
9656
9657         * class.cs (MethodBase): New abstract class.  This is now a base
9658         class for Property, Indexer and Event to avoid some code duplication
9659         in their Define() and DefineMethods() methods.
9660         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
9661         generic methods for Define() and DefineMethods().
9662         (FieldBase): Derive from MemberBase, not MemberCore.
9663         (Property): Derive from MemberBase, not MemberCore.
9664         (Property.DefineMethod): Moved all the code from this method to the
9665         new MethodBase.DefineAccessor(), just call it with appropriate
9666         argumetnts.
9667         (Property.Define): Call the new Property.DoDefine(), this does some
9668         sanity checks and we don't need to duplicate the code everywhere.
9669         (Event): Derive from MemberBase, not MemberCore.
9670         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
9671         accessors, this will also make them work with interface events.
9672         (Indexer): Derive from MemberBase, not MemberCore.
9673         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
9674         (Indexer.Define): Use the new MethodBase functions.
9675
9676         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
9677         argument to the constructor.
9678         (Interface.FindMembers): Added support for interface events.
9679         (Interface.PopluateEvent): Implemented.
9680
9681         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
9682
9683 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
9684
9685         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
9686         but this is required to check for a method name being the same as
9687         the containing class.  
9688
9689         Handle this now.
9690
9691 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9692
9693         * interface.cs: initialize variable.
9694
9695 2002-07-23  Martin Baulig  <martin@gnome.org>
9696
9697         Implemented the IndexerName attribute in interfaces.
9698
9699         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
9700         name if this is an explicit interface implementation.
9701         (Indexer.InterfaceIndexerName): New public variable.  If we're
9702         implementing an interface indexer, this is the IndexerName in that
9703         interface.  Otherwise, it's the IndexerName.
9704         (Indexer.DefineMethod): If we're implementing interface indexer,
9705         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
9706         and Pending.ImplementIndexer methods.
9707         (Indexer.Define): Also define the PropertyBuilder if we're
9708         implementing an interface indexer and this is neither an explicit
9709         interface implementation nor do the IndexerName match the one in
9710         the interface.
9711
9712         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
9713         If a method is defined here, then we always need to create a proxy
9714         for it.  This is used when implementing interface indexers.
9715         (Pending.IsInterfaceIndexer): New public method.
9716         (Pending.ImplementIndexer): New public method.
9717         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
9718         This is used when implementing interface indexers to define a proxy
9719         if necessary.
9720         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
9721         define a proxy if necessary.
9722
9723         * interface.cs (Interface.IndexerName): New public variable.
9724         (Interface.PopulateIndexer): Set the IndexerName.
9725         (Interface.DefineIndexers): New private method.  Populate all the
9726         indexers and make sure their IndexerNames match.
9727
9728         * typemanager.cs (IndexerPropertyName): Added support for interface
9729         indexers.
9730
9731 2002-07-22  Martin Baulig  <martin@gnome.org>
9732
9733         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
9734         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
9735         ret if HasReturnLabel.
9736         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
9737         variables.
9738
9739         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
9740         and set the ec.LoopBeginTryCatchLevel.
9741         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
9742         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
9743         the current ec.TryCatchLevel, the branch goes out of an exception
9744         block.  In this case, we need to use Leave and not Br.
9745
9746 2002-07-22  Martin Baulig  <martin@gnome.org>
9747
9748         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
9749         block unless the block does not always return or it is contained in
9750         another try { ... } catch { ... } block.  Fixes bug #26506.
9751         Added verify-1.cs to the test suite.
9752
9753 2002-07-22  Martin Baulig  <martin@gnome.org>
9754
9755         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
9756         then we do not always return.  Fixes bug #24985.
9757
9758 2002-07-22  Martin Baulig  <martin@gnome.org>
9759
9760         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
9761         lookup on a per-class level; ie. walk up the class hierarchy until we
9762         found at least one applicable method, then choose the best among them.
9763         Fixes bug #24463 and test-29.cs.
9764
9765 2002-07-22  Martin Baulig  <martin@gnome.org>
9766
9767         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
9768         return types of the methods.  The return type is not part of the
9769         signature and we must not check it to make the `new' modifier work.
9770         Fixes bug #27999, also added test-147.cs.
9771         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
9772
9773         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
9774         on the method's return type.
9775
9776 2002-07-21  Martin Baulig  <martin@gnome.org>
9777
9778         * assign.cs: Make this work if the rightmost source is a constant and
9779         we need to do an implicit type conversion.  Also adding a few more tests
9780         to test-38.cs which should have caught this.
9781
9782         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
9783         target in the makefile for this.  The makefile.gnu is primarily intended
9784         for end-users who don't want to debug the compiler.
9785
9786 2002-07-21  Martin Baulig  <martin@gnome.org>
9787
9788         * assign.cs: Improved the Assign class so it can now handle embedded
9789         assignments (X = Y = Z = something).  As a side-effect this'll now also
9790         consume less local variables.  test-38.cs now passes with MCS, added
9791         a few new test cases to that test.
9792
9793 2002-07-20  Martin Baulig  <martin@gnome.org>
9794
9795         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
9796         instructions.  Fixes bug #27977, also added test-146.cs.
9797
9798 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9799
9800         * cs-tokenizer.cs: fixed getHex ().
9801
9802 2002-07-19  Martin Baulig  <martin@gnome.org>
9803
9804         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
9805         not Type.GetType() to lookup the array type.  This is needed when
9806         we're constructing an array of a user-defined type.
9807         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
9808         single-dimensional arrays, but also for single-dimensial arrays of
9809         type decimal.
9810
9811 2002-07-19  Martin Baulig  <martin@gnome.org>
9812
9813         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
9814         this function is called, it's not allowed to share LocalBuilders
9815         among ILGenerators.
9816
9817 2002-07-19  Martin Baulig  <martin@gnome.org>
9818
9819         * expression.cs (Argument.Resolve): Report an error 118 when trying
9820         to pass a type as argument.
9821
9822 2002-07-18  Martin Baulig  <martin@gnome.org>
9823
9824         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
9825         Conv_R_Un for the signed `long' type.
9826
9827 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
9830         `expr' for the temporary result, as that will fail if we do
9831         multiple resolves on the same expression.
9832
9833 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
9834
9835         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
9836         ec.TypeContainer for looking up aliases. 
9837
9838         * class.cs (TypeContainer): Remove LookupAlias from here.
9839
9840         * decl.cs (DeclSpace); Move here.
9841
9842 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
9843
9844         * class.cs (FindMembers): Only call filter if the constructor
9845         bulider is not null.
9846
9847         Also handle delegates in `NestedTypes' now.  Now we will perform
9848         type lookups using the standard resolution process.  This also
9849         fixes a bug.
9850
9851         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
9852         This uses Expressions (the limited kind that can be parsed by the
9853         tree) instead of strings.
9854
9855         * expression.cs (ComposedCast.ToString): Implement, used to flag
9856         errors since now we have to render expressions.
9857
9858         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
9859         FormArrayType. 
9860
9861         * ecore.cs (SimpleName.ToString): ditto.
9862
9863         * cs-parser.jay: Instead of using strings to assemble types, use
9864         Expressions to assemble the type (using SimpleName, ComposedCast,
9865         MemberAccess).  This should fix the type lookups in declarations,
9866         because we were using a different code path for this.
9867
9868         * statement.cs (Block.Resolve): Continue processing statements
9869         even when there is an error.
9870
9871 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
9872
9873         * class.cs (Event.Define): Also remove the `remove' method from
9874         the list of pending items.
9875
9876         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
9877         generate more compact code. 
9878
9879 2002-07-17  Martin Baulig  <martin@gnome.org>
9880
9881         * const.cs (Const.LookupConstantValue): Add support for constant
9882         `unchecked' and `checked' expressions.
9883         Also adding test case test-140.cs for this.
9884
9885 2002-07-17  Martin Baulig  <martin@gnome.org>
9886
9887         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
9888         check whether mi.ReturnType implements the IEnumerator interface; the
9889         `==' and the IsAssignableFrom() will fail in this situation.
9890
9891 2002-07-16  Ravi Pratap  <ravi@ximian.com>
9892
9893         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
9894         here too.
9895
9896 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9897
9898         * expression.cs: fixed bug #27811.
9899
9900 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
9901
9902         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
9903         Molaro: when we are a ref, the value already contains a pointer
9904         value, do not take the address of it.
9905
9906 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
9907         * removed mb-parser.jay and mb-tokenizer.cs
9908
9909 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9910
9911         * expression.cs: check against the building corlib void type.
9912
9913 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
9914
9915         * ecore.cs: fix for valuetype static readonly fields: when 
9916         initializing them, we need their address, not the address of a copy.
9917
9918 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
9919
9920         * typemanager.cs: register also enum_type in corlib.
9921
9922 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9923
9924         * class.cs: allow calling this (but not base) initializers in structs.
9925
9926 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
9927
9928         * ecore.cs: make sure we compare against the building base types
9929         in GetTypeSize ().
9930
9931 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
9932
9933         * typemanager.cs: fix TypeToCoreType() to handle void and object
9934         (corlib gets no more typerefs after this change).
9935
9936 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
9937
9938         * expression.cs (ArrayCreation.EmitArrayArguments): use
9939         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
9940
9941         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
9942         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
9943         array indexes, the runtime actually forbids them.
9944
9945         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
9946         for array arguments here.
9947
9948         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
9949         instead of the default for ValueTypes.
9950
9951         (New.DoEmit): Use IsValueType instead of
9952         IsSubclassOf (value_type)
9953         (New.DoResolve): ditto.
9954         (Invocation.EmitCall): ditto.
9955
9956         * assign.cs (Assign): ditto.
9957
9958         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
9959         Statements *are* currently doing part of their resolution during
9960         Emit.  
9961
9962         Expressions do always resolve during resolve, but statements are
9963         only required to propagate resolution to their children.
9964
9965 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
9966
9967         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
9968
9969         (LoadAssembly): Do not add the dll if it is already specified
9970
9971         (MainDriver): Add the System directory to the link path at the end,
9972         after all the other -L arguments. 
9973
9974         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
9975         wrong opcode for loading bytes and bools (ldelem.i1 instead of
9976         ldelem.u1) and using the opposite for sbytes.
9977
9978         This fixes Digger, and we can finally run it.
9979
9980         * driver.cs (UnixParseOption): Move the option parsing here.  
9981         (CSCParseOption): Implement CSC-like parsing of options.
9982
9983         We now support both modes of operation, the old Unix way, and the
9984         new CSC-like way.  This should help those who wanted to make cross
9985         platform makefiles.
9986
9987         The only thing broken is that /r:, /reference: and /lib: are not
9988         implemented, because I want to make those have the same semantics
9989         as the CSC compiler has, and kill once and for all the confussion
9990         around this.   Will be doing this tomorrow.
9991
9992         * statement.cs (Unsafe.Resolve): The state is checked during
9993         resolve, not emit, so we have to set the flags for IsUnsfe here.
9994
9995 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
9998         not catch the Error_ObjectRefRequired in SimpleName (as it is
9999         possible to have a class/instance variable name that later gets
10000         deambiguated), we have to check this here.      
10001
10002 2002-07-10  Ravi Pratap  <ravi@ximian.com>
10003
10004         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
10005         make static and put into Expression.
10006
10007         (Event.Define): Register the private field of the event with the 
10008         TypeManager so that GetFieldFromEvent can get at it.
10009
10010         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
10011         keep track of the private field associated with an event which
10012         has no accessors.
10013
10014         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
10015         private field.
10016
10017         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
10018
10019 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
10020
10021         * expression.cs (Binary.EmitBranchable): this routine emits the
10022         Binary expression in a branchable context.  This basically means:
10023         we need to branch somewhere, not just get the value on the stack.
10024
10025         This works together with Statement.EmitBoolExpression.
10026
10027         * statement.cs (Statement.EmitBoolExpression): Use
10028         EmitBranchable. 
10029
10030 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * statement.cs (For): Reduce the number of jumps in loops.
10033
10034         (For): Implement loop inversion for the For statement.
10035
10036         (Break): We can be breaking out of a Try/Catch controlled section
10037         (foreach might have an implicit try/catch clause), so we need to
10038         use Leave instead of Br.
10039
10040         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
10041         now).  If the instace expression supports IMemoryLocation, we use
10042         the AddressOf method from the IMemoryLocation to extract the
10043         address instead of emitting the instance.
10044
10045         This showed up with `This', as we were emitting the instance
10046         always (Emit) instead of the Address of This.  Particularly
10047         interesting when This is a value type, as we dont want the Emit
10048         effect (which was to load the object).
10049
10050 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
10051
10052         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
10053
10054         * statement.cs (Checked): Set the CheckedState during the resolve
10055         process too, as the ConvCast operations track the checked state on
10056         the resolve process, and not emit.
10057
10058         * cs-parser.jay (namespace_member_declaration): Flag that we have
10059         found a declaration when we do.  This is used to flag error 1529
10060
10061         * driver.cs: Report ok when we display the help only.
10062
10063 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
10064
10065         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
10066
10067 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
10068
10069         * cs-tokenizer.cs (define): We also have to track locally the
10070         defines.  AllDefines is just used for the Conditional Attribute,
10071         but we also need the local defines for the current source code. 
10072
10073 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
10074
10075         * statement.cs (While, For, Do): These loops can exit through a
10076         Break statement, use this information to tell whether the
10077         statement is the last piece of code.
10078
10079         (Break): Flag that we break.
10080
10081         * codegen.cs (EmitContexts): New `Breaks' state variable.
10082
10083 2002-07-03  Martin Baulig  <martin@gnome.org>
10084
10085         * class.cs (TypeContainer.MethodModifiersValid): Allow override
10086         modifiers in method declarations in structs.  Otherwise, you won't
10087         be able to override things like Object.Equals().
10088
10089 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
10090
10091         * class.cs (Method, Property, Indexer): Do not allow the public
10092         modifier to be used in explicit interface implementations.
10093
10094         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
10095         override modifiers in method declarations in structs
10096
10097 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
10098
10099         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
10100         integer or real overflow, report an error
10101
10102 2002-07-02  Martin Baulig  <martin@gnome.org>
10103
10104         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
10105         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
10106         to tell the runtime about our newly created System.Object and
10107         System.ValueType types.
10108
10109 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
10110
10111         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
10112         struct instead of Ldarg/Starg.
10113
10114 2002-07-02  Martin Baulig  <martin@gnome.org>
10115
10116         * expression.cs (Indirection.Indirection): Call
10117         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
10118
10119 2002-07-02  Martin Baulig  <martin@gnome.org>
10120
10121         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
10122         ValueType, call TypeManager.TypeToCoreType() on it.
10123         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
10124         the OpCodes.Newarr argument.
10125
10126 2002-07-02  Martin Baulig  <martin@gnome.org>
10127
10128         * expression.cs (Invocation.EmitCall): When compiling corlib,
10129         replace all calls to the system's System.Array type to calls to
10130         the newly created one.
10131
10132         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
10133         System.Array methods.
10134         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
10135         from the system's System.Array type which must be replaced.
10136
10137 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
10138
10139         * typemanager.cs: load unverifiable_code_ctor so we can build
10140         corlib using the correct type. Avoid using GetTypeCode() with
10141         TypeBuilders.
10142         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
10143         TypeManager.object_type to allow building corlib.
10144
10145 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
10146
10147         * ecore.cs: handle System.Enum separately in LoadFromPtr().
10148
10149 2002-07-01  Martin Baulig  <martin@gnome.org>
10150
10151         * class.cs: Make the last change actually work, we need to check
10152         whether `ifaces != null' to avoid a crash.
10153
10154 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
10155
10156         * class.cs: when we build structs without fields that implement
10157         interfaces, we need to add the interfaces separately, since there is
10158         no API to both set the size and add the interfaces at type creation
10159         time.
10160
10161 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
10162
10163         * expression.cs: the dimension arguments to the array constructors
10164         need to be converted if they are a long.
10165
10166 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
10167
10168         * class.cs: don't emit ldarg.0 if there is no parent constructor
10169         (fixes showstopper for corlib).
10170
10171 2002-06-29  Martin Baulig  <martin@gnome.org>
10172
10173         MCS now compiles corlib on GNU/Linux :-)
10174
10175         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
10176         ie. check for MethodImplOptions.InternalCall.
10177
10178         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
10179         and TypeManager.attribute_type are null, so we must explicitly check
10180         whether parent is not null to find out whether it's an attribute type.
10181         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
10182         and SetBuilder, not only if the property is neither abstract nor external.
10183         This is necessary to set the MethodImplOptions on the accessor methods.
10184         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
10185         SetBuilder, see Property.Emit().
10186
10187         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
10188         populate "System.Object", "System.ValueType" and "System.Attribute" since
10189         they've already been populated from BootCorlib_PopulateCoreTypes().
10190
10191 2002-06-29  Martin Baulig  <martin@gnome.org>
10192
10193         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
10194         is the NullLiteral, we also need to make sure that target_type is not
10195         an enum type.   
10196
10197 2002-06-29  Martin Baulig  <martin@gnome.org>
10198
10199         * rootcontext.cs (RootContext.ResolveCore): We must initialize
10200         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
10201         before calling BootstrapCorlib_ResolveDelegate ().
10202
10203 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10204
10205         * statement.cs: fixed build-breaker. All tests passed ok.
10206
10207 2002-06-27  Martin Baulig  <martin@gnome.org>
10208
10209         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
10210         for System.Decimal when compiling corlib.
10211
10212 2002-06-27  Martin Baulig  <martin@gnome.org>
10213
10214         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
10215         switch blocks which contain nothing but a default clause.
10216
10217 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
10218
10219        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
10220
10221 2002-06-27  Martin Baulig  <martin@gnome.org>
10222
10223         * ecore.cs (PropertyExpr.PropertyExpr): Call
10224         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
10225
10226         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
10227         is already a TypeBuilder.
10228
10229 2002-06-27  Martin Baulig  <martin@gnome.org>
10230
10231         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
10232         `target_type == TypeManager.array_type', not IsAssignableFrom() in
10233         the "from an array-type to System.Array" case.  This makes it work
10234         when compiling corlib.
10235
10236 2002-06-27  Martin Baulig  <martin@gnome.org>
10237
10238         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
10239         non-static PropertyExpr, set its InstanceExpression.  This makes
10240         the `ICollection.Count' property work in System/Array.cs.
10241
10242 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
10243
10244         * driver.cs: Made error handling more consistent.  Errors now
10245         tracked by Report class, so many methods which used to return int
10246         now return void.  Main() now prints success/failure and 
10247         errors/warnings message.
10248
10249         Renamed '--probe' compiler argument to '--expect-error'.  Removed
10250         the magic number return values (123 and 124).  Now, if the
10251         expected error occurs, the compiler exits with success (exit value
10252         0).  If the compilation completes without seeing that particular
10253         error, the compiler exits with failure (exit value 1).  The
10254         makefile in mcs/errors has been changed to handle the new behaviour.
10255
10256         * report.cs: Made 'expected error' number a property and renamed
10257         it from 'Probe' to 'ExpectedError'.
10258
10259         * genericparser.cs: Removed error handling support, since it is
10260         now all done by Report class.
10261
10262         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
10263         class, so parse() no longer returns an int.
10264
10265         * namespace.cs: Use Report.Error instead of GenericParser.error
10266
10267 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
10268
10269         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
10270         TypeContainer.AddOperator): At the front of the list put the
10271         explicit implementations, so they get resolved/defined first. 
10272
10273 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
10274
10275         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
10276         interface type is implemented by this TypeContainer.  Used during
10277         explicit interface implementation.
10278
10279         (Property.Define, Indexer.Define, Method.Define): Validate that
10280         the given interface in the explicit implementation is one of the
10281         base classes for the containing type.
10282
10283         Also if we are explicitly implementing an interface, but there is
10284         no match in the pending implementation table, report an error.
10285
10286         (Property.Define): Only define the property if we are
10287         not explicitly implementing a property from an interface.  Use the
10288         correct name also for those properties (the same CSC uses,
10289         although that is really not needed).
10290
10291         (Property.Emit): Do not emit attributes for explicitly implemented
10292         properties, as there is no TypeBuilder.
10293
10294         (Indexer.Emit): ditto.
10295
10296         Hiding then means that we do not really *implement* a pending
10297         implementation, which makes code fail.
10298
10299 2002-06-22  Martin Baulig  <martin@gnome.org>
10300
10301         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
10302         the return value of Object.GetType().  [FIXME: we need to do this whenever
10303         we get a type back from the reflection library].
10304
10305 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
10306
10307         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
10308
10309 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * attribute.cs: Return null if we can not look up the type.
10312
10313         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
10314         the interface types found.
10315
10316         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
10317         interface types found.
10318
10319         * typemanager.cs (GetInterfaces): Make this routine returns alll
10320         the interfaces and work around the lame differences between
10321         System.Type and System.Reflection.Emit.TypeBuilder in the results
10322         result for GetInterfaces.
10323
10324         (ExpandInterfaces): Given an array of interface types, expand and
10325         eliminate repeated ocurrences of an interface.  This expands in
10326         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
10327         be IA, IB, IC.
10328
10329 2002-06-21  Martin Baulig  <martin@gnome.org>
10330
10331         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
10332         on System.Enum.
10333
10334 2002-06-21  Martin Baulig  <martin@gnome.org>
10335
10336         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
10337         and called with one of the core types, return the corresponding typebuilder for
10338         that type.
10339
10340         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
10341         element type.
10342
10343 2002-06-21  Martin Baulig  <martin@gnome.org>
10344
10345         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
10346         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
10347         (Expression.ConvertReferenceExplicit): Likewise.
10348
10349         * expression.cs (ElementAccess.DoResolve): Likewise.
10350         (ElementAccess.DoResolveLValue): Likewise.
10351
10352 2002-06-10  Martin Baulig  <martin@gnome.org>
10353
10354         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
10355         add the "value" parameter to the parameter list.
10356
10357         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
10358         to our caller.
10359
10360 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
10361
10362         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
10363         the argument to an int, uint, long or ulong, per the spec.  Also
10364         catch negative constants in array creation.
10365
10366 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
10367
10368         * class.cs: do not allow the same interface to appear twice in
10369         the definition list.
10370
10371 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
10372
10373         * ecore.cs: don't use ldlen with System.Array.
10374
10375 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
10376
10377         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
10378
10379 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
10380
10381         * modifiers.cs: produce correct field attributes for protected
10382         internal. Easy fix so miguel can work on ther harder stuff:-)
10383
10384 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
10385
10386         * pending.cs: New file.  Move the code from class.cs here.
10387         Support clearning the pending flag for all methods (when not doing
10388         explicit interface implementation).
10389
10390 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
10391
10392         * rootcontext.cs: added a couple more types needed to bootstrap.
10393
10394 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
10395
10396         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
10397         constructor in the type, instead of any constructor in the type
10398         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
10399         a bug in the Mono runtime when applying the params attribute). 
10400
10401 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
10402         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
10403
10404 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
10405
10406         * expression.cs (Unary.ResolveOperator): Use TypeManager
10407         to resolve the type.
10408
10409 2002-06-13  Ravi Pratap  <ravi@ximian.com>
10410
10411         * cs-parser.jay (enum_member_declaration): Pass in the attributes
10412         attached.
10413
10414         * enum.cs (AddEnumMember): Add support to store the attributes associated 
10415         with each member too.
10416
10417         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
10418         field builders too - this takes care of the enum member case.
10419
10420 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
10421
10422         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
10423         address-of operator on both value types and pointers.
10424
10425 2002-06-10  Martin Baulig  <martin@gnome.org>
10426
10427         * interface.cs (Interface.PopulateIndexer): Add the indexer's
10428         PropertyBuilder to the `property_builders' list.
10429
10430         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
10431         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
10432         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
10433         find any indexers which are inherited from an interface.
10434
10435 2002-06-09  Martin Baulig  <martin@gnome.org>
10436
10437         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
10438         the same type as the constant if necessary.  There's also a test-130.cs
10439         for this.
10440
10441         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
10442
10443         * typemanager.cs (TypeManager.ChangeType): Previously known as
10444         Enum.ChangeEnumType().
10445
10446 2002-06-09  Martin Baulig  <martin@gnome.org>
10447
10448         * expression.cs (Cast.TryReduce): Added support for consts.
10449
10450 2002-06-08  Ravi Pratap  <ravi@ximian.com>
10451
10452         * class.cs (Accessor): Hold attributes information so we can pass
10453         it along.
10454
10455         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
10456         Modify to pass in attributes attached to the methods.
10457
10458         (add_accessor_declaration, remove_accessor_declaration): Ditto.
10459
10460         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
10461         to handle the Accessor kind :-)
10462
10463         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
10464
10465 2002-06-08  Martin Baulig  <martin@gnome.org>
10466
10467         * expression.cs (Unary.TryReduceNegative): Added support for
10468         ULongConstants.
10469
10470 2002-06-08  Martin Baulig  <martin@gnome.org>
10471
10472         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
10473         name can't be found in the `defined_names' - the caller will do a
10474         MemberLookup in this case and thus find methods in System.Enum
10475         such as Enum.IsDefined().
10476
10477 2002-06-08  Martin Baulig  <martin@gnome.org>
10478
10479         * enum.cs (Enum.ChangeEnumType): This is a custom version of
10480         Convert.ChangeType() which works with TypeBuilder created types.
10481         (Enum.LookupEnumValue, Enum.Define): Use it here.
10482
10483         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
10484         `TypeBuilder.BaseType != null' check.
10485         (TypeContainer.FindMembers): Only lookup parent members if we
10486         actually have a parent.
10487         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
10488         (ConstructorInitializer.Resolve): Likewise.
10489
10490         * interface.cs (Interface.FindMembers): Added
10491         `TypeBuilder.BaseType != null' check.
10492
10493         * rootcontext.cs (RootContext.ResolveCore): Added
10494         "System.Runtime.CompilerServices.IndexerNameAttribute" to
10495         classes_second_stage.
10496
10497         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
10498         debug_type and trace_type when compiling with --nostdlib.       
10499
10500 2002-06-07  Martin Baulig  <martin@gnome.org>
10501
10502         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
10503         (AddField): Set it to true when adding a non-static field.
10504         (DefineType): Use `have_nonstatic_fields' to find out whether we
10505         have non-static fields, not `Fields != null'.
10506
10507 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
10508
10509         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
10510         dereferencing a null on the static-field code path)
10511
10512 2002-05-30  Martin Baulig  <martin@gnome.org>
10513
10514         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
10515         to take command line arguments.  Use reflection to call the new
10516         custom `Initialize' function on the symbol writer and pass it the
10517         command line arguments.
10518
10519         * driver.cs (--debug-args): New command line argument to pass command
10520         line arguments to the symbol writer.
10521
10522 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * assign.cs (DoResolve): Forgot to do the implicit conversion to
10525         the target type for indexers and properties.  Thanks to Joe for
10526         catching this.
10527
10528 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
10529
10530         * typemanager.cs (MethodFlags): returns the method flags
10531         (Obsolete/ShouldIgnore) that control warning emission and whether
10532         the invocation should be made, or ignored. 
10533
10534         * expression.cs (Invocation.Emit): Remove previous hack, we should
10535         not do this on matching a base type, we should do this based on an attribute
10536
10537         Only emit calls to System.Diagnostics.Debug and
10538         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
10539         on the command line.
10540
10541         * rootcontext.cs: Global settings for tracing and debugging.
10542
10543         * cs-tokenizer.cs (define): New utility function to track
10544         defines.   Set the global settings for TRACE and DEBUG if found.
10545
10546 2002-05-25  Ravi Pratap  <ravi@ximian.com>
10547
10548         * interface.cs (Populate*): Pass in the TypeContainer as well as
10549         the DeclSpace as parameters so that we can create EmitContexts and
10550         then use that to apply attributes etc.
10551
10552         (PopulateMethod, PopulateEvent, PopulateProperty)
10553         (PopulateIndexer): Apply attributes everywhere.
10554
10555         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
10556         etc.
10557
10558         (ApplyAttributes): Update accordingly.
10559
10560         We now apply interface attributes for all members too.
10561
10562 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
10563
10564         * class.cs (Indexer.Define); Correctly check if we are explicit
10565         implementation (instead of checking the Name for a ".", we
10566         directly look up if the InterfaceType was specified).
10567
10568         Delay the creation of the PropertyBuilder.
10569
10570         Only create the PropertyBuilder if we are not an explicit
10571         interface implementation.   This means that explicit interface
10572         implementation members do not participate in regular function
10573         lookups, and hence fixes another major ambiguity problem in
10574         overload resolution (that was the visible effect).
10575
10576         (DefineMethod): Return whether we are doing an interface
10577         implementation. 
10578
10579         * typemanager.cs: Temporary hack until we get attributes in
10580         interfaces (Ravi is working on that) and we get IndexerName
10581         support in interfaces.
10582
10583         * interface.cs: Register the indexers as properties.
10584
10585         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
10586         warning, I have verified that this is a bug in the .NET runtime
10587         (JavaScript suffers of the same problem).
10588
10589         * typemanager.cs (MemberLookup): When looking up members for
10590         interfaces, the parent of an interface is the implicit
10591         System.Object (so we succeed in searches of Object methods in an
10592         interface method invocation.  Example:  IEnumerable x;  x.ToString
10593         ()) 
10594
10595 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
10596
10597         * class.cs (Event): Events should also register if they do
10598         implement the methods that an interface requires.
10599
10600         * typemanager.cs (MemberLookup); use the new GetInterfaces
10601         method. 
10602
10603         (GetInterfaces): The code used to lookup interfaces for a type is
10604         used in more than one place, factor it here. 
10605
10606         * driver.cs: Track the errors at the bottom of the file, we kept
10607         on going.
10608
10609         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
10610         instance if the method we are calling is static!
10611
10612 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
10613
10614         * attribute.cs (ApplyAttributes): Make this function filter out
10615         the IndexerName attribute (as that attribute in reality is never
10616         applied) and return the string constant for the IndexerName
10617         attribute. 
10618
10619         * class.cs (TypeContainer.Emit): Validate that all the indexers
10620         have the same IndexerName attribute, and if so, set the
10621         DefaultName attribute on the class. 
10622
10623         * typemanager.cs: The return value might contain other stuff (not
10624         only methods).  For instance, consider a method with an "Item"
10625         property and an Item method.
10626
10627         * class.cs: If there is a problem with the parameter types,
10628         return. 
10629
10630 2002-05-24  Ravi Pratap  <ravi@ximian.com>
10631
10632         * ecore.cs (ImplicitConversionExists): Wrapper function which also
10633         looks at user defined conversion after making a call to 
10634         StandardConversionExists - we need this for overload resolution.
10635
10636         * expression.cs : Update accordingly the various method calls.
10637
10638         This fixes 2 bugs filed against implicit user defined conversions 
10639
10640 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
10641
10642         * statement.cs: Track the result of the assignment.
10643
10644 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
10645
10646         * expression.cs (MemberAccess): Improved error reporting for
10647         inaccessible members.
10648
10649 2002-05-22  Martin Baulig  <martin@gnome.org>
10650
10651         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
10652         itself with debugging support.
10653
10654 2002-05-22  Martin Baulig  <martin@gnome.org>
10655
10656         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
10657         Removed, this isn't needed anymore.
10658
10659 2002-05-20  Martin Baulig  <martin@gnome.org>
10660
10661         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
10662         be underlying type for an enum.
10663
10664 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
10665
10666         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
10667         that splits out the loading of just the core types.
10668
10669         * rootcontext.cs (ResolveCore): Split the struct resolution in
10670         two, so we can load the enumeration underlying types before any
10671         enums are used.
10672
10673         * expression.cs (Is): Bandaid until we fix properly Switch (see
10674         bug #24985 for details).
10675
10676         * typemanager.cs (ImplementsInterface): The hashtable will contain
10677         a null if there are no interfaces implemented.
10678
10679 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
10680
10681         * cs-parser.jay (indexer_declarator): It is fine to have array
10682         parameters
10683
10684 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10685
10686         * typemanager.cs: (RegisterBuilder): New function used to register
10687         TypeBuilders that implement interfaces.  Since
10688         TypeBuilder.GetInterfaces (as usual) does not work with lame
10689         Reflection.Emit. 
10690         (AddUserType): register interfaces.
10691
10692         (ImplementsInterface): Use the builder_to_ifaces hash if we are
10693         dealing with TypeBuilder.  Also, arrays are showing up as
10694         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
10695         methods can not be invoked on them!
10696
10697         * ecore.cs (ExplicitReferenceConversionExists): Made public.
10698         (ImplicitReferenceConversionExists): Split out from
10699         StandardConversionExists. 
10700
10701         * expression.cs (As): We were only implementing one of the three
10702         cases for the as operator.  We now implement them all.
10703         (Is): Implement the various other cases for Is as well.
10704
10705         * typemanager.cs (CACHE): New define used to control if we want or
10706         not the FindMembers cache.  Seems to have a negative impact on
10707         performance currently
10708
10709         (MemberLookup): Nested types have full acess to
10710         enclosing type members
10711
10712         Remove code that coped with instance/static returns for events, we
10713         now catch this in RealFindMembers.
10714
10715         (RealFindMembers): only perform static lookup if the instance
10716         lookup did not return a type or an event.  
10717
10718 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10719
10720         * assign.cs (CompoundAssign): We pass more semantic information
10721         now to Compound Assignments than we did before: now we have all
10722         the information at hand, and now we resolve the target *before* we
10723         do the expression expansion, which allows the "CacheValue" method
10724         to have the effect we intended (before, a [x] += 1 would generate
10725         two differen ArrayAccess expressions from the ElementAccess,
10726         during the resolution process).
10727
10728         (CompoundAssign.DoResolve): Resolve target and original_source here.
10729
10730 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
10731
10732         * expression.cs (ArrayAccess): dropped debugging information. 
10733
10734         * typemanager.cs: Small bug fix: I was always returning i_members,
10735         instead of one of i_members or s_members (depending on which had
10736         the content).
10737
10738         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
10739         method is invoked before any code generation takes place, and it
10740         is a mechanism to inform that the expression will be invoked more
10741         than once, and that the method should use temporary values to
10742         avoid having side effects
10743
10744         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
10745
10746         * ecore.cs (Expression.CacheTemporaries): Provide empty default
10747         implementation.
10748
10749         * expression.cs (Indirection, ArrayAccess): Add support for
10750         CacheTemporaries in these two bad boys. 
10751
10752         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
10753         ldobj or ldind_ref.  
10754         (StoreFromPtr): Handle stobj as well.
10755
10756         * expression.cs (UnaryMutator): Share more code.
10757
10758         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
10759         down: I was not tracking the Filter function as well, which
10760         was affecting the results of the cache.
10761
10762 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
10763
10764         * attribute.cs: Remove the hack to handle the CharSet property on
10765         StructLayouts. 
10766
10767 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
10768
10769         * attribute.cs (DoResolve): More uglyness, we now only try to
10770         resolve the attribute partially, to extract the CharSet
10771         information (only if we are a StructLayout attribute).  Otherwise 
10772
10773         (GetExtraTypeInfo): Add some code to conditionally kill in the
10774         future this.   I am more and more convinced that the .NET
10775         framework has special code to handle the attribute setting on
10776         certain elements.
10777
10778         * expression.cs (IsParamsMethodApplicable): Revert my previous
10779         foreach change here, it was wrong.
10780
10781 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
10784         (pp_expr): do not abort on unknown input, just return.
10785         (eval): abort if there are pending chars.
10786
10787         * attribute.cs (Attribute.Resolve): Positional parameters are
10788         optional.  Deal with that case.
10789
10790         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
10791         the Ansi/Unicode/Auto information for the type.
10792
10793         (TypeContainer.DefineType): instantiate the EmitContext here, as
10794         we will be using it during the type definition (to resolve
10795         attributes) and during the emit phase.
10796
10797         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
10798         to pull type information out of the attributes
10799
10800         (Attribute.Resolve): track the constructor builder, and allow for
10801         multiple invocations (structs and classes will use this).
10802
10803         * ecore.cs (MemberLookupFinal): new version with all the
10804         parameters customizable.
10805
10806         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
10807         constructors.  Return if the result value is null (as the error
10808         would have been flagged already by MemberLookupFinal)
10809
10810         Do not allow instances of abstract classes or interfaces to be
10811         created.
10812
10813         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
10814         We have to compare the assembly property here when dealing with
10815         FamANDAssem and Assembly access modifiers, because we might be
10816         creating an assembly from *modules* (that means that we are not
10817         getting TypeBuilders for types defined in other modules that are
10818         part of this assembly).
10819
10820         (Method.Emit): If the method is marked abstract and has a body,
10821         emit an error. 
10822
10823         (TypeContainer.DefineMembers): If both the defined member and the
10824         parent name match are methods, then do not emit any warnings: let
10825         the Method.Define routine take care of flagging warnings.  But if
10826         there is a mismatch (method overrides something else, or method is
10827         overriwritten by something, then emit warning).
10828
10829         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
10830         set to null, this means `do not check for the return type on the
10831         signature'. 
10832
10833         (Method.Define): set the return type for the method signature to
10834         null, so that we get methods with the same name and parameters and
10835         different return types.  This is used to flag warning 114 (you are
10836         hiding a method, and you probably want to use the new/override
10837         keywords instead).
10838
10839         * typemanager.cs (MemberLookup): Implemented proper access
10840         control, closing a long standing set of bug reports.  The problem
10841         was that the Framework only has two bits: Public and NonPublic,
10842         and NonPublic includes private and protected methods, but we need
10843         to enforce the FamANDAssem, FamOrAssem and Family. 
10844
10845 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
10846
10847         * statement.cs (GotoCase): Return true: Ammounts to giving up
10848         knowledge on whether we return or not, and letting the other case
10849         be responsible for it.
10850
10851 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
10852
10853         * driver.cs: Do not load directories for each file processed, only
10854         do it if there is a pattern.
10855
10856         * ecore.cs: Report readonly assigns here as well, as we might have
10857         been resolved only by MemberAccess.
10858
10859         (SimpleName.SimpleNameResolve): Also be useful for LValue
10860         resolution.   We need this to propagate assign to local readonly variables
10861
10862         * typemanager.cs: Use a ptrhashtable for the criteria, because we
10863         do not want to reuse potential criteria memory.
10864
10865         * class.cs (MyEventBuilder): Set reflected_type;
10866
10867         * ecore.cs (Constantify): Added support for constifying bools.
10868
10869         (RootContext.LookupType): Added a cache for values looked up in
10870         the declaration space.
10871
10872         * typemanager.cs (FindMembers): Now is a front-end to
10873         RealFindMembers, and provides a two-level hashtable-based cache to
10874         the request.  
10875
10876         15% performance improvement: from 22.5 to 19.2 seconds.
10877
10878         * expression.cs (IsParamsMethodApplicable): use foreach.
10879         (Invocation.DoResolve): ditto.
10880         (New.DoResolve): ditto.
10881         (ArrayCreation.DoResolve): ditto.
10882
10883         * ecore.cs (FindMostEncompassingType): use foreach.
10884
10885         * delegate.cs (NewDelegate.DoResolve): Use foreach
10886
10887         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
10888         (RemoveMethods): use foreach.
10889
10890         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
10891         nested foreach statements instead of for, and also break out of
10892         the inner loop once a match is found.
10893
10894         (Invocation.OverloadResolve): Use foreach, simplify the code. 
10895
10896 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * cfold.cs (BinaryFold): During an enumeration evaluation context,
10899         we actually unwrap the expression to allow for extra information
10900         to be extracted. 
10901
10902         * expression.cs: Use Shr_Un on unsigned operations. 
10903
10904 2002-05-08  Ravi Pratap  <ravi@ximian.com>
10905
10906         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
10907         applicable operators was not being considered correctly. This closes
10908         the bug Miguel reported.
10909
10910 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
10911
10912         * attribute.cs: check that the type derives from System.Attribute
10913         and report the correct error in that case (moved the duplicate code to
10914         its own method, too).
10915
10916 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
10917
10918         * attribute.cs: lookup attribute type name as the spec says: first the
10919         bare attribute name and then name + "Attribute" (nant compiles with
10920         mcs after this fix).
10921
10922 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
10923
10924         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
10925         Because of the way we parse things, we should try to see if a
10926         UIntConstant can fit in an integer.
10927
10928 2002-05-07  Ravi Pratap  <ravi@ximian.com>
10929
10930         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
10931         when we are in an explicit context.
10932
10933         (ConvertReferenceExplicit): When converting from Iface type S to Class
10934         T make sure the rules are implemented as an OR.
10935
10936         * parameter.cs (ParameterType): Make it a property for now although the
10937         purpose really isn't anything immediate.
10938
10939         * expression.cs (Is*Applicable): Do better checking on the parameter type
10940         of a ref/out parameter. The ones from the system assemblies are already 
10941         marked with the correct type so we don't need to do any correction.
10942
10943         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
10944         the object type is standard too so include that.
10945
10946 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * ecore.cs (StandardConversionExists): Augment with missing code:
10949         deal with IntConstant, LongConstants and Enumerations.
10950
10951         * assign.cs: Report the error, instead of failing silently
10952
10953         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
10954         typecontainer that they are declared, because the
10955         typecontainer/namespace will have the list of using clauses that
10956         need to be applied.
10957
10958         Assembly Attributes were escaping the normal registration
10959         mechanism. 
10960
10961         (EmitCode): Apply attributes within an EmitContext that represents
10962         the container they were declared on.
10963
10964         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
10965
10966 2002-05-06  Ravi Pratap  <ravi@ximian.com>
10967
10968         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
10969         Revamp completely - make much cleaner as we now operate only
10970         on a set of Types.
10971
10972         (FindMostSpecificSource, FindMostSpecificTarget): New methods
10973         to implement the logic detailed in the spec more correctly.
10974
10975         (UserDefinedConversion): Update accordingly.
10976
10977 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10978
10979         * statement.cs: Return flow analysis information up.
10980
10981         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
10982         and the default.
10983
10984         (token): Do not consume an extra character before calling
10985         decimal_digits.
10986
10987 2002-05-06  Piers Haken <piersh@friskit.com>
10988
10989         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
10990
10991 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * class.cs (Constructor.Emit): Set the IsStatic flag in the
10994         EmitContext during the instance constructor initializer
10995         resolution, to stop access to instance variables.
10996
10997         This is mandated by the spec, last paragraph of the `constructor
10998         initializers' section. 
10999
11000 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * cs-parser.jay, class.cs (Accessor): new class used to represent
11003         an accessor (get or set).  In the past we used `null' to represent
11004         a missing accessor.  But this is ambiguous because there was no
11005         way to tell in abstract indexers/properties if one of them was
11006         specified.
11007
11008         Now there is a way of addressing that.
11009
11010         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
11011         instead of FindMembers.
11012
11013         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
11014         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
11015
11016         * attribute.cs: Treat indexers and properties as the same in terms
11017         of applying attributes
11018
11019         * ecore.cs (FindMostEncompassedType): Use statically initialized
11020         EmptyExpressions()s like we do elsewhere to avoid creating useless
11021         objects (and we take this out of the tight loop).
11022
11023         (GetConversionOperators): Move the code to extract the actual
11024         operators to a separate routine to clean things up.
11025
11026 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
11027
11028         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
11029         events are always registered FieldBuilders.
11030
11031         * class.cs (FieldBase): New class shared by Fields 
11032
11033         * delegate.cs: If we are a toplevel delegate, use our full name.
11034         If we are a nested delegate, then only use our tail name.
11035
11036 2002-05-02  Ravi Pratap  <ravi@ximian.com>
11037
11038         * expression.cs (IsApplicable): Ensure that we add the "&" to
11039         ref/out types before comparing it with the type of the argument.
11040
11041         (IsParamsMethodApplicable): Ditto.
11042
11043         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
11044         silly me ;-)
11045
11046         * delegate.cs : Handle the case when we have more than one applicable
11047         method. Flag an error only when we finish checking all.
11048
11049 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
11050
11051         * expression.cs: Add support for boolean static initializers.
11052
11053 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
11054
11055         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
11056
11057         * parameter.cs (ComputeParameterTypes,
11058         ComputeAndDefineParameterTypes): Better error handling: now we
11059         clear the `types' cache if we fail during any of the type lookups.
11060         We also return the status code correctly to our caller
11061
11062         * delegate.cs: If we fail to define a delegate, abort the extra
11063         steps. 
11064
11065         * expression.cs (Binary.ResolveOperator): for
11066         operator==(object,object) and operator !=(object, object) we also
11067         have to verify that there is an implicit conversion from one to
11068         the other.
11069
11070         (ArrayAccess.DoResolve): Array Access can operate on
11071         non-variables. 
11072
11073 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
11074
11075         * assign.cs (CompoundAssign): A new class used as a "flag" that
11076         the assignment actually is happening as part of a compound
11077         assignment operator.
11078
11079         During compound assignment, a few new rules exist to enable things
11080         like:
11081
11082         byte b |= 1 + 2
11083
11084         From the spec:
11085
11086         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
11087         to the type of x) if y is implicitly convertible to the type of x,
11088         and the operator is a builtin operator and the return type of the
11089         operator is explicitly convertible to the type of x. 
11090
11091         * rootcontext.cs: Reset warning level to 2.  4 catches various
11092         "interesting" features in mcs, we must clean this up at some
11093         point, but currently am trying to kill other bugs ;-)
11094
11095         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
11096         in container classes as well.  
11097
11098         * expression.cs (Binary.ResolveOperator): Handle string case
11099         before anything else (as operator overloading does emit an error
11100         before doing anything else).
11101
11102         This code could go away when we move to a table driven model, but
11103         i could not come up with a good plan last night.
11104
11105 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
11106
11107         * typemanager.cs (CSharpName): reimplementation using regex.
11108         * class.cs: added null check for fields in Emit
11109         * rootcontext.cs: set warninglevel to 4
11110
11111 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
11112
11113         * typemanager.cs (CSharpName): reimplemented with Lupus
11114         suggestion.
11115
11116 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
11117
11118         * statement.cs (If): correclty implement Resolve, because we were
11119         not catching sem errors in there.  The same process is needed
11120         everywhere else. 
11121         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
11122
11123
11124         (Statement.Warning_DeadCodeFound): Factorize code.
11125         (While): Report dead code here too.
11126
11127         (Statement): Added Resolve virtual method to allow
11128         for resolution split from the emit code.
11129
11130 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
11131
11132         * statement.cs (EmitBoolExpression): No longer try to resolve the
11133         expression here.    
11134         (MakeBoolean): New utility function that resolve, implicitly
11135         converts to boolean and tags the expression. 
11136
11137
11138         (If, Do): Implement dead code elimination.
11139         (While): Implement loop inversion
11140
11141         (Do, While, For, If): Resolve the expression prior to calling our
11142         code generation.
11143
11144 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
11145
11146         * class.cs:
11147           - added method Report28 (warning: program has more than one entry point)
11148           - added method IsEntryPoint, implements paragraph 10.1 of the spec
11149           - modified method Method.Define, the part at the end of the method
11150
11151         * rootcontext.cs: added static public Location EntryPointLocation;
11152           
11153         * ../errors/cs0028.cs : Add test case for the above warning.              
11154
11155         * typemanager.cs:
11156           - modified method CSharpName to allow arrays of primitive type to
11157             be printed nicely (e.g. instead of System.Int32[][] it now prints
11158             int[][])
11159           - added method CSharpSignature: returns the signature of a method
11160             in string format to be used in reporting errors, warnings, etc.
11161
11162         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
11163         with String.Empty.
11164
11165 2002-04-26  Ravi Pratap  <ravi@ximian.com>
11166
11167         * delegate.cs (Define): Fix extremely silly bug where I was
11168         setting the type of the 'object' parameter of the BeginInvoke
11169         method to System.IAsyncResult instead of System.Object ;-)
11170
11171 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
11172
11173         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
11174         here. 
11175
11176         (Constructor.Emit): return if we fail to initialize the
11177         constructor.  Another door closed!  
11178
11179         * expression.cs (New.DoResolve): Improve error message (from -6 to
11180         1501).  Use DeclaredOnly lookup to find the exact constructor.
11181
11182         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
11183         loop.  This is useful.
11184
11185         * cs-parser.jay: Adjust the default parameters so that destructors
11186         have the proper signature.
11187
11188 2002-04-26  Martin Baulig  <martin@gnome.org>
11189
11190         * driver.cs (LoadAssembly): If `assembly' contains any characters
11191         which are only valid in path names and not in assembly names
11192         (currently slash, backslash and point), use Assembly.LoadFrom ()
11193         instead of Assembly.Load () on the `assembly' (before iteration
11194         over the link_paths).
11195
11196 2002-04-26  Martin Baulig  <martin@gnome.org>
11197
11198         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
11199
11200 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
11201
11202         * class.cs (Property): use the new typemanager.MemberLookup
11203
11204         (TypeContainer.MemberLookup): Implement using the
11205         TypeManager.MemberLookup now. 
11206
11207         * typemanager.cs: Make MemberLookup a function of the TypeManager,
11208         and return MemberInfos, so that these can be used without an
11209         EmitContext (what we had before).
11210
11211 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
11212
11213         * expression.cs: Fix the case where the argument to params if the
11214         type of the params.  I omitted handling this before.   Fixed
11215
11216 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
11217
11218         * driver.cs: Call BootCorlib_PopulateCoreType
11219
11220         * class.cs (Property.CheckBase): Check for properties only, not
11221         for all members. 
11222
11223         * interface.cs: Temporary hack: try/catch around the
11224         CustomAttributeBuilder, because I am getting an exception that I
11225         do not understand.
11226
11227         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
11228         types whose definitions are required to be there (attributes are
11229         defined before standard types).
11230
11231         Compute definitions as we boot the various types, as they are used
11232         immediately (value_type class will need object_type, but if we do
11233         not initialize object_type, we will pass a null, which will let
11234         the runtime pick the System.Object from the existing corlib, which
11235         is not what we want).
11236
11237 2002-04-22  Patrik Torstensson <totte@labs2.com>
11238
11239         * cs-tokenizer.cs: fixed a number of trim() issues.
11240
11241 2002-04-22  Ravi Pratap  <ravi@ximian.com>
11242
11243         * expression.cs (Argument.Type): Ensure that we return the correct
11244         type when we have out or ref parameters [in which case we 
11245         append a "&"].
11246
11247 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
11248
11249         * class.cs (Property, Indexer): Allow extern modifier in there. 
11250
11251         * typemanager.cs (InitBaseTypes): Initializes object_type and
11252         value_type, since those will be used early on during the bootstrap
11253         process to compile corlib.
11254
11255         (InitCoreTypes): Move code from here to InitBaseTypes.
11256
11257 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
11258
11259         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
11260         single-dimension arrays as using the ldlen opcode.  
11261
11262         Daniel Lewis discovered this optimization.  
11263
11264         * typemanager.cs: Add signature for System.Array::get_Length
11265
11266 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11267
11268         * statement.cs: report the error when the foreach does not apply to an
11269         array nor a collection.
11270
11271 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * expression.cs: Add implicit conversions to the operator ~.
11274
11275         * constant.cs (DecimalConstant.Emit): Emit decimal value.
11276
11277         * typemanager.cs: Locate the decimal constructor.
11278
11279 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11280
11281         * attribute.cs: use the new property of TypeOf.
11282         * expression.cs: added 'get' property around typearg.
11283
11284         These changes fix a build breaker reported by NickD. Is this the
11285         correct way to fix?  If not, please, revert my changes and make it
11286         work :-).
11287
11288 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
11289
11290         * attribute.cs: Add support for typeof in attribute invocations.
11291         I am not sure that this is right though.
11292
11293 2002-04-14  Duncan Mak  <duncan@ximian.com>
11294
11295         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
11296         Binary.Operator.Division case.
11297
11298 2002-04-13  Ravi Pratap  <ravi@ximian.com>
11299
11300         * class.cs (DefineType): Ensure that we do a proper check on
11301         attribute types and also register it with the TypeManager.
11302
11303         (TypeContainer.Targets): The default for attribute types is
11304         AttributeTargets.All.
11305
11306         * attribute.cs (ApplyAttributes): Registering the attribute type
11307         is done elsewhere, not when we discover we have a Usage attribute.
11308
11309 2002-04-12  Ravi Pratap  <ravi@ximian.com>
11310
11311         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
11312         and get rid of is_delegate parameter.
11313
11314         * everywhere : update.
11315
11316 2002-04-12  Ravi Pratap  <ravi@ximian.com>
11317
11318         * cs-parser.jay (compilation_unit): Revamp completely to use
11319         some new ideas that I got from Rhys' grammar to solve the problems
11320         with assembly level attributes.
11321
11322         (outer_declaration): New grammar production.
11323
11324         (attribute_sections): Add.
11325
11326         (opt_attributes): Base on attribute_sections
11327
11328         (namespace_declaration): Allow opt_attributes to tackle the case
11329         when we have assembly level attributes - we are clever in this
11330         regard now ;-)
11331
11332         * attribute.cs (ApplyAttributes): Do not worry about assembly 
11333         attributes in the non-global context.
11334
11335         * rootcontext.cs (AddGlobalAttributes): Go back to using this
11336         instead of SetGlobalAttributes.
11337
11338         * class.cs, rootcontext.cs : Ensure we define and generate 
11339         attribute types before anything else.
11340
11341         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
11342         and flag the new error -20 for the case when the attribute type
11343         does not have valid targets specified. csc does not catch this.
11344
11345         * ../errors/errors.txt : update for error # -20
11346
11347 2002-04-11  Ravi Pratap  <ravi@ximian.com>
11348
11349         * support.cs (InternalParameters.ParameterModifier): Do some null
11350         checking and return sane values.
11351
11352         * class.cs (Method.Define): If we are a PInvoke method, ensure
11353         that we are static and extern. Report error # 601
11354
11355         * ../errors/cs0601.cs : Add test case for the above error.
11356
11357 2002-04-07  Ravi Pratap  <ravi@ximian.com>
11358
11359         * rootcontext.cs (attribute_types): We need to keep type of
11360         all attribute types separately and emit code for them first.
11361
11362         (RegisterAttribute) : Implement.
11363
11364         * class.cs (DefineType): Check if the current Type is a custom
11365         attribute type and register it accordingly.
11366
11367         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
11368         adding the first attribute twice and rename to
11369
11370         (SetGlobalAttributes): this.
11371
11372         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
11373         lookups.
11374
11375         * attribute.cs (ApplyAttributes): Take an additional argument telling us
11376         if we are processing global arguments. Hmm, I am unsure of this.
11377
11378 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11379
11380         * expression.cs: added static array of strings to avoid calling
11381         Enum.ToString () for Operator in Binary. Significant recover of
11382         performance.
11383
11384 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
11385
11386         * class.cs (FindMembers): Allow the Builders of the various
11387         members to be null.  If they are skip them.  This only happens
11388         during the PInvoke declaration.
11389
11390 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
11391
11392         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
11393         failure, so we do not keep going afterwards.
11394
11395         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
11396         wanted to pass `false' as the `is_delegate' argument.  If this is
11397         the case, why not use delegate_type == null to mean `is_delegate =
11398         false' and anything else as is_delegate = true.
11399
11400 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
11401
11402         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
11403         code for the section, not the beginning of the tests.
11404
11405 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
11406
11407         * cfold.cs: Handle operator + (Enum x, Underlying x) 
11408
11409         * expression.cs (Binary): same.  Warn about errors where we have
11410         Enum/Enum in operator + as well.
11411
11412 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
11413
11414         * statement.cs:
11415                 - added support for switch(bool)
11416                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
11417                 - add TableSwitchEmit() to handle table-based switch statements
11418
11419 2002-04-05  Ravi Pratap  <ravi@ximian.com>
11420
11421         * expression.cs (Invocation.OverloadResolve): Factor out code which
11422         does parameter compatibility checking with arguments so that we can 
11423         re-use the code even from Delegate.VerifyApplicability
11424
11425         (VerifyArgumentsCompat): Move above code here.
11426
11427         * delegate.cs (VerifyApplicability): Get rid of duplicate code
11428         and instead make a call to the above method.
11429
11430 2002-03-31  Ravi Pratap  <ravi@ximian.com>
11431
11432         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
11433         We use it to keep track of classes which are attribute types.
11434
11435 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
11436
11437         * delegate.cs (Delegate.Define): Correctly define the types in the
11438         presence of fixed and array parameters.
11439
11440         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
11441         doing FindMembers.
11442
11443         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
11444         include NonPublic after the first iteration.
11445
11446         * class.cs (Indexer.CheckBase): Only check if both parents are
11447         non-null. 
11448
11449         * cs-parser.jay (accessor_body): If empty, set to null.
11450
11451         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
11452         same code path here to resolve constants names that we did have in
11453         MemberAccess.DoResolve.  There is too much code duplicated here.
11454
11455 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
11456
11457         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
11458
11459         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
11460         to MakeUnionSet.
11461
11462         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
11463         tokens, numbers and strings.
11464
11465         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
11466         parenthesis.
11467
11468         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
11469         asyncronous parameters and the regular parameters.  
11470
11471         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
11472         specify the target directory.
11473
11474         * expression.cs: (This.DoResolve): Simplify
11475         (As.Emit): Optimize, do not generate IsInst if the expression is
11476         always of the given type.
11477
11478         (Is.DoResolve): Bug fix, we were reporting both always/never for
11479         the is expression.
11480
11481         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
11482         creating too many unnecessary arrays.
11483
11484 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
11485
11486         * class.cs (EmitFieldInitializer): Use Assign expression to assign
11487         fields instead of rolling our own initializer.   Takes care of all
11488         implicit conversions, and drops unnecessary static checks/argument.
11489
11490 2002-03-31  Dick Porter  <dick@ximian.com>
11491
11492         * driver.cs: use the GetDirectories() return values properly, and
11493         use "/" as path separator.
11494
11495 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
11496
11497         * expression.cs (Unary): Optimize - - expr into expr.
11498         (Binary): Optimize a + (-b) into a -b.
11499
11500         * codegen.cs (CodeGen): Made all methods static.
11501
11502 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * rootcontext.cs: 
11505
11506         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
11507         TypeBuilder property.
11508
11509         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
11510         instead. 
11511
11512         * tree.cs: Removed the various RecordXXXX, and replaced with a
11513         single RecordDecl.  Removed all the accessor methods, and just
11514         left a single access point Type 
11515
11516         * enum.cs: Rename DefineEnum to DefineType.
11517
11518         * decl.cs: New abstract method `DefineType' used to unify the
11519         Defines for Enumerations, Interfaces, TypeContainers and
11520         Delegates.
11521
11522         (FindType): Moved LookupInterfaceOrClass here.  Moved the
11523         LookupBaseClasses method that used to live in class.cs and
11524         interface.cs here, and renamed to FindType.
11525
11526         * delegate.cs: Implement DefineType.  Take advantage of the
11527         refactored pattern for locating the parent builder without taking
11528         the parent_builder argument (which we know does not work if we are
11529         nested, and triggering a toplevel definition).
11530
11531 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11532
11533         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
11534         accessibility of a member has changed during override and report
11535         an error if so.
11536
11537         * class.cs (Method.Define, Property.Define): Only complain on
11538         overrides if the method is private, any other accessibility is
11539         fine (and since we just checked the permission is the same, we are
11540         good to go).
11541
11542         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
11543         and elif are processed always.  The other pre-processing
11544         directives are only processed if we are "taking" the path
11545
11546 2002-03-29  Martin Baulig  <martin@gnome.org>
11547
11548         * class.cs (Method.Emit): Only emit symbolic debugging info if the
11549         current location is not Null.
11550
11551         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
11552         a separate method so we can profile it.
11553
11554         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
11555         `span.Seconds' are just seconds, but no minutes or hours.
11556         (MainDriver): Profile the CodeGen.SaveSymbols calls.
11557
11558 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11559
11560         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
11561         Remove the gratuitous set of Final:
11562
11563                                 // If an interface implementation, then we can set Final.
11564                                 if (((flags & MethodAttributes.Abstract) == 0) &&
11565                                     implementing.DeclaringType.IsInterface)
11566                                         flags |= MethodAttributes.Final;
11567
11568         I do not know what I was smoking when I used that.
11569
11570
11571         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
11572         step into fixing the name resolution issues for delegates and
11573         unifying the toplevel name resolution.
11574
11575 2002-03-28  Martin Baulig  <martin@gnome.org>
11576
11577         * class.cs (Method.Emit): If we have a symbol writer, call its
11578         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
11579         tell it about the current method.
11580
11581         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
11582         writer that we're going to emit the first byte of IL code for a new
11583         statement (a new source line).
11584         (EmitContext.EmitTopBlock): If we have a symbol writer, call
11585         EmitContext.Mark() before emitting any code.
11586
11587         * location.cs (SymbolDocument): Return null when we're Null.
11588
11589         * statement.cs (Statement): Moved the `Location loc' variable here.
11590         (Statement.EmitBoolExpression): If we have a symbol writer, call
11591         ec.Mark() before emitting any code to tell it that we're at the
11592         beginning of a new statement.
11593         (StatementExpression): Added `Location' argument to the constructor.
11594         (Block): Added public readonly variable `StartLocation' and public
11595         variable `EndLocation'.  The latter is to be set using SetEndLocation().
11596         (Block): Added constructor which takes a start and end location.
11597         (Block.SetEndLocation): New method. This sets the end location.
11598         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
11599         local variables we create.
11600         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
11601         each statement and do also mark the begin and end of the block.
11602
11603         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
11604         tell it the current lexer.Location, use Location.Null for the end of the
11605         block.
11606         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
11607         current block, set its end location using SetEndLocation().
11608         (statement_expression): StatementExpression constructor now takes the
11609         lexer.Location as additional argument.
11610         (for_statement, declare_local_variables): Likewise.
11611         (declare_local_variables): When creating a new implicit block, use the
11612         new Block constructor and pass it the lexer.Location.
11613
11614 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
11615
11616         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
11617         members also on the parent interfaces recursively.
11618
11619 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
11620
11621         * report.cs: Use new formats, since Gonzalo finished the missing
11622         bits. 
11623
11624         * expression.cs (Binary.ResolveOperator): added missing operator|
11625         operator& and operator^ for bool/bool.
11626
11627         * cs-parser.jay: CheckDef now takes a Location argument that is
11628         used to report errors more precisly (instead of reporting the end
11629         of a definition, we try to track something which is a lot closer
11630         to the source of the problem).
11631
11632         * cs-tokenizer.cs: Track global token use, so we can properly flag
11633         the use of #define/#undef after the first token has been seen.
11634
11635         Also, rename the reportXXXX to Error_DescriptiveName
11636
11637         * decl.cs (DeclSpace.IsTopLevel): Move property here from
11638         TypeContainer, so that Enum and Interface can use this too.
11639
11640         * class.cs (TypeContainer.LookupInterfaceOrClass,
11641         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
11642         `builder' argument.  Typically this was used to pass the parent
11643         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
11644         the definition).  
11645
11646         The problem is that a nested class could trigger the definition of
11647         a toplevel class, and the builder would be obviously wrong in that
11648         case. 
11649
11650         So we drop this argument, and we compute dynamically the
11651         TypeBuilder/ModuleBuilder (the correct information was available
11652         to us anyways from DeclSpace.Parent)
11653
11654         * interface.cs (Interface.DefineInterface): Drop builder
11655         parameter cleanup like class.cs
11656
11657         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
11658         like class.cs
11659
11660         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
11661         values. 
11662
11663         (Try.Emit): Propagate the returns value from the statement.
11664
11665         (Return.Emit): Even if we are leavning 
11666
11667         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
11668
11669         * modifiers.cs: Fix the computation of MethodAttributes flags.
11670
11671 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
11672
11673         * driver.cs: allow compilation of files that start with '/'.
11674         Add a default case when checking the argument of --target.
11675
11676 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
11677
11678         * interface.cs: Implement the same search algorithm for types in
11679         the interface code.
11680
11681         * delegate.cs: Do not allow multiple definition.
11682
11683         * Recovered ChangeLog that got accidentally amputated
11684
11685         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
11686
11687         * rootcontext.cs: Load manually enum to allow core classes to
11688         contain enumerations.
11689
11690         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
11691         Update to new static methods in TypeManager.
11692
11693         * typemanager.cs (GetMethod, GetConstructor): Use our
11694         implementation of FindMembers to find the members, since during
11695         corlib compilation, the types are TypeBuilders and GetMethod and
11696         GetConstructor do not work.
11697
11698         Make all methods in TypeManager static.
11699
11700         (InitCodeHelpers): Split the functionality from
11701         the InitCodeTypes function.
11702
11703         * driver.cs: Call InitCodeHelpers after we have populated the
11704         types. 
11705
11706         * cs-parser.jay (delegate_declaration): we did not used to compute
11707         the delegate name correctly for void delegates.
11708
11709 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
11710
11711         * rootcontext.cs (RootContext): Init the interface_resolve_order
11712         and type_container_resolve_order always.
11713
11714         (ResolveCore, BootstrapCorlib_ResolveClass,
11715         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
11716         compiler when compiling with --nostdlib
11717
11718         * class.cs (TypeContainer.DefineType): Check that our parent is
11719         not null.  This test is most important when we are bootstraping
11720         the core types.
11721
11722         * codegen.cs: Split out the symbol writing code.
11723
11724 2002-03-25  Martin Baulig  <martin@gnome.org>
11725
11726         * driver.cs (-g): Made -g an alias for --debug.
11727
11728 2002-03-24  Martin Baulig  <martin@gnome.org>
11729
11730         * codegen.cs (SymbolWriter): New public variable. Returns the
11731         current symbol writer.
11732         (CodeGen): Added `bool want_debugging_support' argument to the
11733          constructor. If true, tell the ModuleBuild that we want debugging
11734         support and ask it for the ISymbolWriter.
11735         (Save): If we have a symbol writer, call it's Close() method after
11736         saving the assembly.
11737
11738         * driver.c (--debug): New command line argument to create a
11739         debugger information file.
11740
11741         * location.cs (SymbolDocument): New public property. Returns an
11742         ISymbolDocumentWriter object for the current source file or null
11743         if we don't have a symbol writer.
11744
11745 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
11746
11747         * driver.cs (LoadAssembly): Correctly return when all the paths
11748         have been tried and not before.
11749
11750         * statement.cs (Switch.Emit): return the actual coverage for this
11751         statement (returns/not-returns)
11752
11753         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
11754         switch of the statement if we are the last switch section.  That
11755         kills two problems: try/catch problems (we used to emit an empty
11756         nop at the end) and switch statements where all branches would
11757         return. 
11758
11759 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
11760
11761         * driver.cs: Add default assemblies (the equivalent to the
11762         Microsoft CSC.RSP file)
11763
11764         * cs-tokenizer.cs: When updating `cols and setting it to zero,
11765         also update tokens_seen and set it to false.
11766
11767         * driver.cs: Implement --recurse for Mike.
11768
11769         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
11770         correctly splitting out the paths.
11771
11772 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * interface.cs (Interface.PopulateProperty): Instead of using
11775         `parent' as the declaration space for the set parameters, use
11776         `this' 
11777
11778         * support.cs (InternalParameters): InternalParameters constructor
11779         takes a DeclSpace instead of a TypeContainer.
11780
11781         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
11782         types are being initialized, load the address of it before calling
11783         the function.  
11784
11785         (New): Provide a mechanism to disable the generation of local
11786         value type temporaries when the caller will be providing us with
11787         an address to store it.
11788
11789         (ArrayCreation.EmitDynamicInitializers): Use it.
11790
11791 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * expression.cs (Invocation.EmitArguments): Only probe for array
11794         property if there is more than one argument.  Sorry about that.
11795
11796         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
11797         empty param arrays.
11798
11799         * class.cs (Method.LabelParameters): Fix incorrect code path that
11800         prevented the `ParamArrayAttribute' from being applied to the
11801         params attribute.
11802
11803 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
11804
11805         * support.cs (ReflectionParameters): Correctly compute whether the
11806         last argument is a params array.  Fixes the problem with
11807         string.Split ('a')
11808
11809         * typemanager.cs: Make the assemblies array always be non-null
11810         (empty, but non-null)
11811
11812         * tree.cs (RecordDecl): New function that abstracts the recording
11813         of names.  This reports error 101, and provides a pointer to the
11814         previous declaration.  Fixes a crash in the compiler.
11815
11816         * cs-parser.jay (constructor_declaration): Update to new grammar,
11817         and provide a constructor_body that can be empty.
11818
11819 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
11820
11821         * driver.cs: Add support for --resources.
11822
11823         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
11824         Make all types for the various array helper methods be integer.
11825
11826         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
11827         CheckState to ConvCast.
11828
11829         (ConvCast): Now it takes a `checked' state argument, to avoid
11830         depending on the emit context for the conversion, and just using
11831         the resolve time setting.
11832
11833         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
11834         instead of Invocation.EmitArguments.  We do not emit the original
11835         arguments, instead we emit those which have been converted to
11836         unsigned int expressions.
11837
11838         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
11839
11840         * codegen.cs: ditto.
11841
11842         * expression.cs (LocalVariableReference): Drop the use of the
11843         Store function that depended on the variable index.
11844
11845         * statement.cs (VariableInfo): Drop the `Idx' property from this
11846         class, as this is not taking into account the indexes for
11847         temporaries tat we generate during the execution, getting the
11848         indexes wrong.
11849
11850         * class.cs: First emit class initializers, then call the parent
11851         constructor. 
11852
11853         * expression.cs (Binary): Fix opcode emision.
11854         (UnaryMutator.EmitCode): Support checked code generation
11855
11856         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
11857         matches for events for both the Static and Instance scans,
11858         pointing to the same element.   Fix that.
11859
11860 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
11861
11862         * rootcontext.cs (ResolveTree): Always set the
11863         interface_resolve_order, because nested interfaces will be calling
11864         into us.
11865
11866         * class.cs (GetInterfaceOrClass): Track the same resolution
11867         process used by TypeManager.LookupType.  This fixes the nested
11868         type lookups in class declarations (separate path from
11869         LookupType). 
11870
11871         (TypeContainer.DefineType): Also define nested interfaces.
11872         (TypeContainer.RegisterOrder): New public function used to
11873         register the order in which child interfaces need to be closed.
11874
11875         Nested interfaces need to be closed after their parents have been
11876         created. 
11877
11878         * interface.cs (InterfaceAttr): Put all the logic for computing
11879         the interface attribute here. 
11880
11881         (DefineInterface): Register our interface order with the
11882         RootContext or with the TypeContainer depending on the case.
11883
11884 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11885
11886         * cs-parser.jay: rework foreach statement to work with the new
11887         changes to the policy on SimpleNames.
11888
11889         * report.cs: support Stacktrace on warnings as well.
11890
11891         * makefile: drop --unsafe and /unsafe from the compile.
11892
11893 2002-03-13  Ravi Pratap  <ravi@ximian.com>
11894
11895         * ecore.cs (StandardConversionExists): Modify to take an Expression
11896         as the first parameter. Ensure we do null -> reference type conversion
11897         checking.
11898
11899         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
11900         temporary Expression objects.
11901
11902 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
11903
11904         * interface.cs: workaround bug in method overloading resolution
11905         (there is already a bugzilla bug for it).
11906
11907 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11908
11909         We could also solve this problem by having a separate path for
11910         performing type lookups, instead of DoResolve, we could have a
11911         ResolveType entry point, and only participating pieces of the
11912         production (simplename, deref, array) would implement this. 
11913
11914         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
11915         signal SimpleName to only resolve type names and not attempt to
11916         resolve anything else.
11917
11918         * expression.cs (Cast): Set the flag.
11919
11920         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
11921
11922         * class.cs: Only report 108 if there is no `new' modifier.
11923
11924         * cs-parser.jay: rework foreach statement to work with the new
11925         changes to the policy on SimpleNames.
11926         
11927         * report.cs: support Stacktrace on warnings as well.
11928
11929         * makefile: drop --unsafe and /unsafe from the compile.
11930
11931 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
11932
11933         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11934         lookups here, instead of doing that at parse time.  This means
11935         that our grammar will not introduce `LocalVariableReferences' as
11936         expressions at this point.  That solves the problem of code like
11937         this:
11938
11939         class X {
11940            static void Main ()
11941            { int X = 1;
11942             { X x = null }}}
11943
11944         This is only half the fix.  The full fix requires parameters to
11945         also be handled in this way.
11946
11947         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
11948         makes the use more obvious of the DeclSpace.  The
11949         ec.TypeContainer.TypeBuilder is now only used to pull the
11950         TypeBuilder for it.
11951
11952         My theory is that I can get rid of the TypeBuilder completely from
11953         the EmitContext, and have typecasts where it is used (from
11954         DeclSpace to where it matters).  
11955
11956         The only pending problem is that the code that implements Aliases
11957         is on TypeContainer, and probably should go in DeclSpace.
11958
11959         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11960         lookups here, instead of doing that at parse time.  This means
11961         that our grammar will not introduce `LocalVariableReferences' as
11962         expressions at this point.  That solves the problem of code like
11963         this:
11964
11965         class X {
11966            static void Main ()
11967            { int X = 1;
11968             { X x = null }}}
11969
11970         This is only half the fix.  The full fix requires parameters to
11971         also be handled in this way.
11972
11973         * class.cs (Property.DefineMethod): When implementing an interface
11974         method, set newslot, when implementing an abstract method, do not
11975         set the flag (before we tried never setting it, or always setting
11976         it, which is the difference).
11977         (Indexer.DefineMethod): same.
11978         (Method.DefineMethod): same.
11979
11980         * ecore.cs: Only set the status used flag if we get back a Field.
11981
11982         * attribute.cs: Temporary hack, so Paolo can keep working.
11983
11984 2002-03-08  Ravi Pratap  <ravi@ximian.com>
11985
11986         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
11987         the unmanaged type in the case we have a MarshalAs attribute.
11988
11989         (Resolve): Handle the case when we are parsing the special MarshalAs
11990         attribute [we need to store the unmanaged type to use later]
11991
11992         * typemanager.cs (marshal_as_attr_type): Built in type for the 
11993         MarshalAs Attribute.
11994
11995         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
11996         on parameters and accordingly set the marshalling info.
11997
11998 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
11999
12000         * class.cs: Optimizing slightly by removing redundant code after
12001         we switched to the `NoTypes' return value.
12002         (Property.DefineMethod): use NoTypes here too.
12003
12004         This fixes the bug I introduced in my last batch of changes.
12005
12006 2002-03-05  Ravi Pratap  <ravi@ximian.com>
12007
12008         * tree.cs (RecordEnum): Add. We now keep track of enums too.
12009
12010         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
12011         Enums since those are types too. 
12012
12013         * cs-parser.jay (enum_declaration): Record enums as we parse them.
12014
12015         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
12016         thanks to a call during the lookup process.
12017
12018 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * statement.cs (Foreach): Lots of work to accomodate a particular
12021         kind of foreach statement that I had not kept in mind.  It is
12022         possible to have foreachs on classes that provide a GetEnumerator
12023         method that return objects that implement the "pattern" for using
12024         a foreach, there is no need to support GetEnumerator
12025         specifically. 
12026
12027         This is needed to compile nant.
12028
12029         * decl.cs: Only report 114 if the member is not `Finalize' and if
12030         the warning level is at least 2.
12031
12032         * class.cs: Moved the compare function from Method to
12033         MethodSignature. 
12034
12035         (MethodSignature.InheritableMemberSignatureCompare): Add new
12036         filter function that is used to extract inheritable methods from a
12037         class. 
12038
12039         (Method.Define): Use the new `inheritable_method_signature_filter'
12040         delegate
12041
12042         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
12043         command. 
12044
12045 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
12046
12047         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
12048
12049         * cs-parser.jay: Add opt_semicolon to the interface declaration.
12050
12051         * expression.cs: Pass location information to
12052         ConvertImplicitStandard. 
12053
12054         * class.cs: Added debugging code to track return values from
12055         interfaces. 
12056
12057 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
12058
12059         * expression.cs (Is.DoResolve): If either side of the `is' is an
12060         interface, do not flag the warning.
12061
12062         * ecore.cs (ImplicitReferenceConversion): We need a separate test
12063         for interfaces
12064
12065         * report.cs: Allow for --fatal to be used with --probe.
12066
12067         * typemanager.cs (NoTypes): Move the definition for the empty Type
12068         array here. 
12069
12070         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
12071         properties. 
12072         (TypeContainer.DefineProxy): New function used to proxy to parent
12073         implementations when implementing interfaces.
12074         (TypeContainer.ParentImplements): used to lookup if our parent
12075         implements a public function that is required by an interface.
12076         (TypeContainer.VerifyPendingMethods): Hook this up.
12077
12078         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
12079         `modules' and `assemblies' arraylists into arrays.  We only grow
12080         these are the very early start up of the program, so this improves
12081         the speedof LookupType (nicely measured).
12082
12083         * expression.cs (MakeByteBlob): Replaced unsafe code with
12084         BitConverter, as suggested by Paolo.
12085
12086         * cfold.cs (ConstantFold.Binary): Special case: perform constant
12087         folding of string concatenation, but if either side is a string,
12088         and the other is not, then return null, and let the runtime use
12089         the concatenation on the string plus the object (using
12090         `Object.ToString'). 
12091
12092 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
12093
12094         Constant Folding has been implemented now.
12095
12096         * expression.cs (Unary.Reduce): Do not throw an exception, catch
12097         the error instead on types that are not supported in one's
12098         complement. 
12099
12100         * constant.cs (Constant and all children): New set of functions to
12101         perform implict and explicit conversions.
12102
12103         * ecore.cs (EnumConstant): Implement the new functions to perform
12104         conversion by proxying to the child expression.
12105
12106         * codegen.cs: (ConstantCheckState): Constant evaluation has its
12107         own separate setting that can not be turned off from the command
12108         line using --unchecked or --checked and is only controlled using
12109         the checked/unchecked statements and expressions.  This setting is
12110         used by the constant folder to flag errors.
12111
12112         * expression.cs (CheckedExpr, UncheckedExpr): Set the
12113         ConstantCheckState as well.   
12114
12115         During Resolve, they also have to flag the state, because the
12116         constant folder runs completely in the Resolve phase.
12117
12118         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
12119         well.
12120
12121 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
12122
12123         * cfold.cs: New file, this file contains the constant folder.
12124
12125         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
12126         argument to track whether we are using the resulting address to
12127         load or store a value and provide better error messages. 
12128
12129         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
12130         new AddressOf arguments.
12131
12132         * statement.cs (Foreach.EmitCollectionForeach): Update
12133
12134         * expression.cs (Argument.Emit): Call AddressOf with proper
12135         arguments to track usage.
12136
12137         (New.DoEmit): Call AddressOf with new arguments.
12138
12139         (Unary.Emit): Adjust AddressOf call.
12140
12141 2002-03-01  Ravi Pratap  <ravi@ximian.com>
12142
12143         * cs-parser.jay (member_access): Change the case for pre-defined types
12144         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
12145         this suggestion.
12146
12147         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
12148         a method body.
12149
12150         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
12151         essentially like methods and apply attributes like MethodImplOptions to them too.
12152
12153         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
12154         not being null.
12155
12156         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
12157         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
12158         is the DeclSpace.
12159
12160         * Update code everywhere accordingly.
12161
12162         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
12163
12164         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
12165
12166 2002-02-28  Ravi Pratap  <ravi@ximian.com>
12167
12168         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
12169         try performing lookups against those instead of jumping straight into using
12170         the 'using' clauses.
12171
12172         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
12173
12174         (LookupType): Perform lookups in implicit parents too.
12175
12176         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
12177         sequence as RootContext.LookupType. 
12178
12179         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
12180         the various cases of namespace lookups into this method.
12181
12182 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
12185         in positional arguments)
12186
12187         * class.cs (Operator): Update the AllowedModifiers to contain
12188         extern. 
12189
12190         * cs-parser.jay: Update operator declaration to allow for the
12191         operator body to be empty.
12192
12193         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
12194         values. 
12195
12196 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
12197
12198         * class.cs (Method.Emit): Label parameters.
12199
12200         * driver.cs: Return 1 or 0 as the program exit code.
12201
12202 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * expression.cs: Special case the `null' object when trying to
12205         auto-compute the type, as anything can be explicitly converted to
12206         that. 
12207
12208         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
12209         spotting this Paolo.
12210
12211         (Expression.ImplicitNumericConversion): Perform comparissions of
12212         the type using the underlying type in the case of an enumeration
12213         rather than using the enumeration type for the compare.
12214
12215         Cope with the underlying == type case, which is not possible to
12216         catch before. 
12217
12218         (Expression.ConvertNumericExplicit): Perform comparissions of
12219         the type using the underlying type in the case of an enumeration
12220         rather than using the enumeration type for the compare.
12221
12222         * driver.cs: If the user does not supply an extension, assume .exe
12223
12224         * cs-parser.jay (if_statement): Rewrote so that we can track the
12225         location for the if statement.
12226
12227         * expression.cs (Binary.ConstantFold): Only concat strings when
12228         the operation is "+", not everything ;-)
12229
12230         * statement.cs (Statement.EmitBoolExpression): Take a location
12231         argument. 
12232         (If, While, Do): Track location.
12233
12234         * expression.cs (Binary.ResolveOperator): In the object + string
12235         case, I was missing a call to ConvertImplicit
12236
12237 2002-02-25  Ravi Pratap  <ravi@ximian.com>
12238
12239         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
12240         Location arguments. Ensure we use RootContext.LookupType to do our work
12241         and not try to do a direct Type.GetType and ModuleBuilder.GetType
12242
12243         * interface.cs (PopulateMethod): Handle the type of the parameter being
12244         null gracefully.
12245
12246         * expression.cs (Invocation.BetterFunction): Handle the case when we 
12247         have a params method with no fixed arguments and a call is made with no
12248         arguments.
12249
12250 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
12251
12252         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
12253         the verbatim-string-literal
12254
12255         * support.cs (InternalParameters.ParameterModifier): handle null
12256         fixed parameters.
12257         (InternalParameters.ParameterType): ditto.
12258
12259         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
12260         duplicating the name of the variable parameter.
12261         (GetParameterByName): Fix bug where we were not looking up array
12262         paramters if they were the only present (thanks Paolo!).
12263         (GetParameterInfo): We only have an empty set of types if both
12264         fixed and array are set to null.
12265         (GetParameterInfo-idx): Handle FixedParameter == null
12266
12267         * cs-parser.jay: Handle the case where there is no catch
12268         statements (missing null test).
12269
12270 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
12271
12272         * driver.cs (MainDriver): Be conservative on our command line
12273         handling.
12274
12275         Catch DirectoryNotFoundException when calling GetFiles.
12276
12277         (SplitPathAndPattern): Used to split the input specification into
12278         a path and a pattern that we can feed to Directory.GetFiles.
12279
12280 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
12281
12282         * statement.cs (Fixed): Implement the last case of the Fixed
12283         statement (string handling).
12284
12285         * expression.cs (StringPtr): New class used to return a char * to
12286         a string;  Used by the Fixed statement.
12287
12288         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
12289
12290         * expression.cs (Binary.ResolveOperator): Remove redundant
12291         MemberLookup pn parent type.
12292         Optimize union call, we do not need a union if the types are the same.
12293         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
12294         type.
12295
12296         Specialize the use of MemberLookup everywhere, instead of using
12297         the default settings. 
12298
12299         (StackAlloc): Implement stackalloc keyword.
12300
12301         * cs-parser.jay: Add rule to parse stackalloc.
12302
12303         * driver.cs: Handle /h, /help, /?
12304
12305         * expression.cs (MakeByteBlob): Removed the hacks we had in place
12306         before we supported unsafe code.
12307
12308         * makefile: add --unsafe to the self compilation of mcs.
12309
12310 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
12311
12312         * expression.cs (PointerArithmetic): New class that is used to
12313         perform pointer arithmetic.
12314         (Binary.Resolve): Handle pointer arithmetic
12315         Handle pointer comparission.
12316         (ArrayPtr): Utility expression class that is used to take the
12317         address of an array.
12318
12319         (ElementAccess): Implement array access for pointers
12320
12321         * statement.cs (Fixed): Implement fixed statement for arrays, we
12322         are missing one more case before we are done.
12323
12324         * expression.cs (Indirection): Implement EmitAssign and set the
12325         ExprClass to Variable.  This allows pointer dereferences to be
12326         treated as variables, and to have values assigned to them.
12327
12328         * ecore.cs (Expression.StoreFromPtr): New utility function to
12329         store values dereferencing.
12330
12331 2002-02-20  Ravi Pratap  <ravi@ximian.com>
12332
12333         * expression.cs (Binary.ResolveOperator): Ensure that we are
12334         not trying to operate on a void type - this fixes the reported
12335         bug.
12336
12337         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
12338         the parent implementation is sealed.
12339
12340         * ../errors/cs0239.cs : Add.
12341
12342         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
12343
12344         * typemanager.cs (unverifiable_code_type): Corresponds to 
12345         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
12346         which have unsafe code in them.
12347
12348         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
12349         unsafe context.
12350
12351 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
12352
12353         * cs-tokenizer.cs: Add support for @"litreal strings"
12354
12355         Make tokenizer accept pre-processor directives
12356         on any column (remove the old C-like limitation). 
12357
12358         * rootcontext.cs (EmitCode): Emit any global attributes.
12359         (AddGlobalAttributes): Used to keep track of assembly attributes. 
12360
12361         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
12362
12363         * cs-parser.jay: Add support for global attributes.  
12364
12365 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
12366
12367         * expression.cs (Indirection): New helper class.  Unary will
12368         create Indirection classes to be able to implement the
12369         IMemoryLocation interface on it.
12370
12371 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * cs-parser.jay (fixed_statement): reference the right statement.
12374
12375         * statement.cs (Fixed.Emit): Finish implementing the fixed
12376         statement for the &x case.
12377
12378 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
12379
12380         * class.cs (Property.Define, Method.Define): Remove newslot when
12381         `implementing'.  
12382
12383         * modifiers.cs: My use of NewSlot when `Abstract' was set was
12384         wrong.  NewSlot should only be used if the `new' keyword is present.
12385
12386         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
12387         locating our system dir.  Sorry about this.
12388
12389 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12390
12391         * driver.cs (GetSystemDir): Compute correctly the location of our
12392         system assemblies.  I was using the compiler directory instead of
12393         the library directory.
12394
12395 2002-02-13  Ravi Pratap  <ravi@ximian.com>
12396
12397         * expression.cs (BetterFunction): Put back in what Miguel commented out
12398         since it is the correct fix. The problem is elsewhere ;-)
12399
12400         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
12401         parameters of the parms method are themselves compatible or not !
12402
12403         (StandardConversionExists): Fix very dangerous bug where we were forgetting
12404         to check that a class implements an interface before saying that an implicit
12405         conversion was allowed. Use ImplementsInterface to do the checking.
12406
12407 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
12408
12409         * class.cs (Method.Define): Track whether we are an explicit
12410         implementation or not.  And only call DefineMethodOverride if we
12411         are an explicit implementation.
12412
12413         (Property.DefineMethod): Ditto.
12414
12415 2002-02-11  Ravi Pratap  <ravi@ximian.com>
12416
12417         * expression.cs (BetterFunction): Catch hideous bug which was
12418          preventing us from detecting ambiguous calls due to implicit casts i.e
12419         cs0121.
12420
12421 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
12422
12423         * support.cs (Pair): Remove un-needed method.  I figured why I was
12424         getting the error in cs-parser.jay, the variable in a foreach loop
12425         is readonly, and the compiler does not really treat this as a variable.
12426
12427         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
12428         instead of EQUALS in grammar.  
12429
12430         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
12431
12432         * expression.cs (Unary.DoResolve): Check whether the argument is
12433         managed or not.
12434
12435 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
12436
12437         * support.cs: Api for Pair to set a value.  Despite the fact that
12438         the variables are public the MS C# compiler refuses to compile
12439         code that accesses the field if the variable is part of a foreach
12440         statement. 
12441
12442         * statement.cs (Fixed): Begin implementation of the fixed
12443         statement.
12444
12445         (Block.AddVariable): Return the VariableInfo on success and null
12446         on failure instead of true/false. 
12447
12448         * cs-parser.jay (foreach): Catch errors on variables already
12449         defined (we were ignoring this value before) and properly unwind
12450         the block hierarchy
12451
12452         (fixed_statement): grammar for the fixed statement.
12453
12454 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
12455
12456         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
12457         pointer types to be incretemented.
12458
12459         (SizeOf): Implement.
12460
12461         * cs-parser.jay (pointer_member_access): Implement
12462         expr->IDENTIFIER production.
12463
12464         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
12465         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
12466         on safe contexts.
12467
12468         (Unary): Implement indirection.
12469
12470         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
12471         use in non-unsafe context).
12472
12473         (SimpleName.DoResolve): Check for pointers in field access on safe
12474         contexts. 
12475
12476         (Expression.LoadFromPtr): Factor the load-indirect code in this
12477         function.  This was duplicated in UnboxCast and ParameterReference
12478
12479 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
12480
12481         * expression.cs (ComposedCast): report an error if a pointer cast
12482         is used in a safe region.
12483
12484         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
12485         pointer type casts in unsafe context.
12486
12487         * codegen.cs (EmitContext): Set up IsUnsafe.
12488
12489         * cs-parser.jay (non_expression_type): Add productions for pointer
12490         casts. 
12491
12492         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
12493         code.  We should not use force into static mode if the method is
12494         not virtual.  Fixes bug in MIS
12495
12496         * statement.cs (Do.Emit, While.Emit, For.Emit,
12497         Statement.EmitBoolExpression): Add support to Do and While to
12498         propagate infinite loop as `I do return' semantics.
12499
12500         Improve the For case to also test for boolean constants.
12501
12502         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
12503         to the list of attributes we can add.
12504
12505         Remove `EmitContext' argument.
12506
12507         * class.cs (Method.Define): Apply parameter attributes.
12508         (Constructor.Define): Apply parameter attributes.
12509         (MethodCore.LabelParameters): Move here the core of labeling
12510         parameters. 
12511
12512         * support.cs (ReflectionParameters.ParameterModifier,
12513         InternalParameters.ParameterModifier): Use IsByRef on the type and
12514         only return the OUT bit for these parameters instead of in/out/ref
12515         flags.
12516
12517         This is because I miss-understood things.  The ParameterInfo.IsIn
12518         and IsOut represent whether the parameter has the [In] and [Out]
12519         attributes set.  
12520
12521 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
12522
12523         * ecore.cs (FieldExpr.Emit): Release temporaries.
12524
12525         * assign.cs (LocalTemporary.Release): new function.
12526
12527         * codegen.cs (EmitContext.GetTemporaryStorage,
12528         EmitContext.FreeTemporaryStorage): Rework the way we deal with
12529         temporary storage.  Now we can "put back" localbuilders when we
12530         are done with them
12531
12532 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
12533
12534         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
12535         need to make a copy of the variable to generate verifiable code.
12536
12537 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
12538
12539         * driver.cs: Compute dynamically the system directory.
12540
12541         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
12542         Slower, but more generally useful.  Used by the abstract
12543         registering implementation. 
12544
12545         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
12546         the rules for the special rule on Type/instances.  First check if
12547         we have the same name, and if so, try that special static path
12548         rather than the instance path.
12549
12550 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
12551
12552         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
12553         for, while and if.
12554
12555         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
12556         Enum, ValueType, Delegate or Array for non-corlib compiles.
12557
12558         * cs-tokenizer.cs: Catch long identifiers (645)
12559
12560         * typemanager.cs (IndexerPropetyName): Ravi never tested this
12561         piece of code.
12562
12563         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
12564         fix, we were returning too early, so we were not registering
12565         pending methods from abstract classes.
12566
12567         Do not register pending methods if the class is abstract.
12568
12569         * expression.cs (Conditional.DoResolve): Report circular implicit
12570         conversions when we neecd to compute it for conditional
12571         expressions. 
12572
12573         (Is.DoResolve): If the expression is always of the provided type,
12574         flag warning 183.  If the expression can not ever be of the
12575         provided type flag warning 184.
12576
12577         * class.cs: Catch 169 as well.
12578
12579         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
12580         read. 
12581
12582 2002-01-18  Nick Drochak  <ndrochak@gol.com>
12583
12584         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
12585
12586 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
12587
12588         * interface.cs: (PopulateMethod): Check for pointers being defined
12589         only if the unsafe context is active.
12590         (PopulateProperty): ditto.
12591         (PopulateIndexer): ditto.
12592
12593         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
12594         specified.  If pointers are present, make sure that they are
12595         present in an unsafe context.
12596         (Constructor, Constructor.Define): ditto.
12597         (Field, Field.Define): ditto.
12598         (Property, Property.Define): ditto.
12599         (Event, Event.Define): ditto.
12600
12601         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
12602         hashtable if there are classes or structs defined.
12603
12604         * expression.cs (LocalVariableReference.DoResolve): Simplify this
12605         code, as the constant resolution moved.
12606
12607         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
12608         the metadata, so we can flag error 133. 
12609
12610         * decl.cs (MemberCore.UnsafeOK): New function to test that a
12611         pointer is being declared in an unsafe context.
12612
12613 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
12614
12615         * modifiers.cs (Modifiers.Check): Require a Location argument.
12616         Report error 227 for Unsafe use.
12617
12618         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
12619
12620         * statement.cs (For.Emit): If the test is null, then report that
12621         we do `return', as we wont reach anything afterwards.
12622
12623         (Switch.SwitchGoverningType): Track the expression that matched
12624         the conversion.
12625
12626         * driver.cs: Allow negative numbers as an error code to flag.
12627
12628         * cs-parser.jay: Handle 1551.
12629
12630         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
12631
12632 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12633
12634         * cs-parser.jay: Report 1518 (type declaration can only contain
12635         class, struct, interface, enum or delegate)
12636
12637         (switch_label): Report 1523 (keywords `case' or `default' must
12638         preced code)
12639
12640         (opt_switch_sections): Report 1522 (empty switch)
12641
12642         * driver.cs: Report 1515 (response file specified multiple times)
12643         Report 1516 (Source file specified multiple times).
12644
12645         * expression.cs (Argument.Resolve): Signal 1510
12646
12647         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
12648         access not allowed in static code)
12649
12650 2002-01-11  Ravi Pratap  <ravi@ximian.com>
12651
12652         * typemanager.cs (IsPointerType): Utility method which we are going
12653         to need a lot.
12654
12655         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
12656         the object type, so we take care of that.
12657
12658         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
12659
12660         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
12661         added to non-params parameters :-)
12662
12663         * typemanager.cs (CSharpName): Include 'void' type too. 
12664
12665         (void_ptr_type): Include in the set of core types.
12666
12667         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
12668         duplicating code.
12669
12670         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
12671         an unsafe context.
12672
12673         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
12674         completely forgotten about it.
12675
12676 2002-01-10  Ravi Pratap  <ravi@ximian.com>
12677
12678         * cs-parser.jay (pointer_type): Add. This begins our implementation
12679         of parsing rules for unsafe code.
12680
12681         (unsafe_statement): Implement.
12682
12683         (embedded_statement): Modify to include the above.
12684
12685         * statement.cs (Unsafe): Implement new class for unsafe blocks.
12686
12687         * codegen.cs (EmitContext.InUnsafe): Add. This determines
12688         if the current context is an unsafe one.
12689
12690         * cs-parser.jay (local_variable_pointer_type): Since local variable types
12691         are handled differently, we need separate rules for them.
12692
12693         (local_variable_declaration): Update to use local_variable_pointer_type
12694         to allow variable declarations of unmanaged pointer types.
12695
12696         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
12697         in unsafe contexts.
12698
12699         * ../errors/cs0214.cs : Add.
12700
12701 2002-01-16  Nick Drochak  <ndrochak@gol.com>
12702
12703         * makefile: remove 'response' file when cleaning.
12704
12705 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12706
12707         * cs-parser.jay: Report 1524.
12708
12709 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
12710
12711         * typemanager.cs (RegisterMethod): drop checking if we have
12712         registered this from here
12713
12714 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
12715
12716         * class.cs (Method.EmitDestructor): Implement calling our base
12717         destructor. 
12718
12719         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
12720         value of InFinally.
12721
12722         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
12723         this routine and will wrap the call in a try/catch block.  Deal
12724         with the case.
12725
12726 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * ecore.cs (Expression.MemberLookup): instead of taking a
12729         parameter `same_type' that was used to tell whether we could
12730         access private members we compute our containing type from the
12731         EmitContext.
12732
12733         (FieldExpr): Added partial support for volatile fields.  This does
12734         not work for volatile fields exposed from assemblies, as I can not
12735         figure out how to extract the modreq from it.
12736
12737         Updated all the source files to use this.
12738
12739         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
12740         because it is referenced by MemberLookup very often. 
12741
12742 2002-01-09  Ravi Pratap  <ravi@ximian.com>
12743
12744         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
12745         TypeBuilder.GetCustomAttributes to retrieve what we need.
12746
12747         Get rid of redundant default_member_attr_type as this is the same as
12748         default_member_type which already exists.
12749
12750         * interface.cs, attribute.cs : Update accordingly.
12751
12752 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
12753
12754         * typemanager.cs: Enable IndexerPropertyName again.  It does not
12755         work for TYpeBuilders though.  Ravi, can you please fix this?
12756
12757         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
12758
12759         * expression.cs (Argument.Emit): Handle the case of ref objects
12760         being passed to ref functions;  
12761
12762         (ParameterReference.EmitLoad): Loads the content of the pointer
12763         without dereferencing.
12764
12765 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12766
12767         * cs-tokenizer.cs: Implemented the pre-processing expressions.
12768
12769 2002-01-08  Ravi Pratap  <ravi@ximian.com>
12770
12771         * class.cs (Indexer.DefineMethod): Incorporate the interface
12772         type in the name of the method if we are doing explicit interface
12773         implementation.
12774
12775         * expression.cs (ConversionExists): Remove as it is completely obsolete.
12776
12777         (BetterConversion): Fix extremely trivial bug where we were referring to
12778         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
12779         again !
12780
12781         * ../errors/bug16.cs : Add although we have fixed it.
12782
12783 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12784
12785         * expression.cs (BaseIndexer): Begin implementation.
12786
12787         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
12788
12789         * cs-parser.jay (indexer_declarator): Use qualified_identifier
12790         production directly to remove a shift/reduce, and implement
12791         explicit interface implementation.
12792
12793         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
12794         after a floating point suffix.
12795
12796         * expression.cs (DoNumericPromotions): Improved the conversion for
12797         uint/uint.  If we have a constant, we avoid doing a typecast to a
12798         larger type.
12799
12800         * class.cs (Indexer): Implement explicit interface implementation
12801         for indexers.
12802
12803 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
12804
12805         * class.cs: make the default instance constructor public and hidebysig.
12806
12807 2001-01-03  Ravi Pratap  <ravi@ximian.com>
12808
12809         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
12810         so we can call it from elsewhere.
12811
12812         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
12813         we emit it internally if the class has a defined indexer; otherwise the user
12814         emits it by decorating the class definition with the DefaultMemberAttribute.
12815
12816         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
12817         attribute is not used on a type which defines an indexer.
12818
12819         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
12820         character when we skip whitespace.
12821
12822         * ../errors/cs0646.cs : Add.
12823
12824 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
12825
12826         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
12827         again. 
12828
12829         * makefile: Add practical target `mcs3.exe' which builds the third
12830         generation compiler. 
12831
12832         * expression.cs (New): Fix structures constructor calling.
12833
12834         * class.cs (Property, Method, Indexer): Emit Final flag on the
12835         method if we are an interface implementation and we are not
12836         abstract. 
12837
12838         * ecore.cs (PropertyExpr): New public field `IsBase', tells
12839         whether this property is referencing a `base' method.
12840
12841         * expression.cs (Invocation.EmitCall): take an extra argument:
12842         is_base, this is used to determine whether the `call' or
12843         `callvirt' opcode should be used.
12844
12845
12846         * delegate.cs: update EmitCall.
12847
12848         * class.cs (Method.Define): Set NewSlot for the cases where we are
12849         not implementing an interface method.
12850
12851         (Property.Define): ditto.
12852
12853 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
12854
12855         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
12856         'r'.  Allows mcs to parse itself fully.
12857
12858 2002-01-02  Ravi Pratap  <ravi@ximian.com>
12859
12860         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
12861         of the number of initializers that require the InitializeArray method.
12862
12863         (CheckIndices): Store the Expression in all cases - not the plain value. Also
12864         update the above field where necessary.
12865
12866         (MakeByteBlob): Update accordingly.
12867
12868         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
12869         greater than 2.
12870
12871         (EmitDynamicInitializers): Update in accordance with the new optimization.
12872
12873         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
12874         same OpCode applies.
12875
12876         * cs-parser.jay : Fix some glaring errors I introduced.
12877
12878 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
12879
12880         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
12881         so that we can check for name clashes there too.
12882
12883         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
12884         for interface indexers.
12885
12886         * interfaces.cs (Define): Emit the default member attribute.
12887
12888         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
12889         variable was being referred to while setting the value ;-)
12890
12891 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
12892
12893         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
12894         byte-by-byte information when we know the data is zero.
12895
12896         Make the block always a multiple of 4, because
12897         DefineInitializedData has a bug.
12898
12899         * assign.cs: Fix, we should assign from the temporary, not from
12900         the source. 
12901
12902         * expression.cs (MakeByteBlob): Fix my incorrect code.
12903
12904 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
12905
12906         * typemanager.cs (EnumToUnderlying): This function is used to get
12907         the underlying type from an enumeration, because it does not
12908         always work. 
12909
12910         * constant.cs: Use the I4_S form for values between -128 and 127.
12911
12912         * statement.cs (Block.LookupLabel): Looks up a label.
12913         (Block): Drop support for labeled blocks.
12914
12915         (LabeledStatement): New kind of statement that represents a label
12916         only.
12917
12918         (Goto): Finally implement this bad boy.
12919
12920         * cs-parser.jay: Update to reflect new mechanism to implement
12921         labels.
12922
12923 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
12924
12925         * codegen.cs (EmitContext.This): a codegen property that keeps the
12926         a single instance of this instead of creating many different this
12927         instances. 
12928
12929         * delegate.cs (Delegate.DoResolve): Update to use the property;
12930
12931         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
12932
12933         * expression.cs (BaseAccess.DoResolve): Ditto.
12934
12935 2001-12-29  Ravi Pratap  <ravi@ximian.com>
12936
12937         * typemanager.cs (methodimpl_attr_type): Add to hold the type
12938         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
12939
12940         (InitCoreTypes): Update accordingly.
12941
12942         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
12943         so we can quickly store the state.
12944
12945         (ApplyAttributes): Set the correct implementation flags
12946         for InternalCall methods.
12947
12948 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
12949
12950         * expression.cs (EmitCall): if a method is not virtual, then do
12951         not use callvirt on it.
12952
12953         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
12954         user defined stuff) requires the use of stobj, which takes an
12955         address on the stack instead of an array and an index.  So emit
12956         the Ldelema operation for it.
12957
12958         (EmitStoreOpcode): Use stobj for valuetypes.
12959
12960         (UnaryMutator.EmitCode): Use the right 1 value depending on
12961         whether we are dealing with int64/uint64, float or doubles.
12962
12963         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
12964         constructors that I implemented last night.
12965
12966         (Constructor.IsDefault): Fix to work properly for static
12967         constructors.
12968
12969         * cs-parser.jay (CheckDef): report method signature errors.
12970         Update error number 103 to be 132.
12971
12972         * decl.cs: New AdditionResult enumeration value: MethodExists.
12973         Although we do this check for methods later on in the semantic
12974         analysis, catching repeated default constructors is so easy that
12975         we catch these here. 
12976
12977         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
12978         promotions code.
12979
12980         (ParameterReference.EmitAssign, Emit): handle
12981         bools as bytes.
12982
12983         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
12984         (ArrayAccess.EmitStoreOpcode): ditto.
12985
12986         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
12987
12988         * expression.cs (MakeByteBlob): Complete all the missing types
12989         (uint, short, ushort, byte, sbyte)
12990
12991         * class.cs: Only init instance field initializers on instance
12992         constructors. 
12993
12994         Rename `constructors' to instance_constructors. 
12995
12996         (TypeContainer.AddConstructor): Only add constructors to the list
12997         if it is not static.
12998
12999         Make sure that we handle default_static_constructor independently
13000         everywhere where we handle instance_constructors
13001
13002 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
13003
13004         * class.cs: Do not lookup or create a base initializer for a
13005         static constructor.
13006
13007         (ConstructorInitializer.Resolve): use the proper type to lookup
13008         for constructors.
13009
13010         * cs-parser.jay: Report error 1585 (modifiers between type and name).
13011
13012         * enum.cs, interface.cs: Remove CloseType, this is taken care by
13013         in DeclSpace. 
13014
13015         * decl.cs: CloseType is now an virtual method, the default
13016         implementation just closes this type.
13017
13018 2001-12-28  Ravi Pratap  <ravi@ximian.com>
13019
13020         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
13021         to PreserveSig by default. Also emit HideBySig on such methods.
13022
13023         Basically, set the defaults to standard values.
13024
13025         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
13026         argument, if candidate is better, it can't be worse than the best !
13027
13028         (Invocation): Re-write bits to differentiate between methods being
13029         applicable in their expanded form and their normal form - for params
13030         methods of course.
13031
13032         Get rid of use_standard everywhere as only standard conversions are allowed
13033         in overload resolution. 
13034
13035         More spec conformance.
13036
13037 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
13038
13039         * driver.cs: Add --timestamp, to see where the compiler spends
13040         most of its time.
13041
13042         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
13043         `this' in static code.
13044
13045         (SimpleName.DoResolve): Implement in terms of a helper function
13046         that allows static-references to be passed upstream to
13047         MemberAccess.
13048
13049         (Expression.ResolveWithSimpleName): Resolve specially simple
13050         names when called by MemberAccess to implement the special
13051         semantics. 
13052
13053         (Expression.ImplicitReferenceConversion): Handle conversions from
13054         Null to reference types before others, as Null's type is
13055         System.Object. 
13056
13057         * expression.cs (Invocation.EmitCall): Handle the special case of
13058         calling methods declared on a reference type from a ValueType
13059         (Base classes System.Object and System.Enum)
13060
13061         (MemberAccess.Resolve): Only perform lookups on Enumerations if
13062         the left hand side is a TypeExpr, not on every enumeration. 
13063
13064         (Binary.Resolve): If types are reference types, then do a cast to
13065         object on operators != and == of both arguments.
13066
13067         * typemanager.cs (FindMembers): Extract instance and static
13068         members if requested.
13069
13070         * interface.cs (PopulateProperty): Use void_type instead of null
13071         as the return type for the setter method.
13072
13073         (PopulateIndexer): ditto.
13074
13075 2001-12-27  Ravi Pratap  <ravi@ximian.com>
13076
13077         * support.cs (ReflectionParameters): Fix minor bug where we
13078         were examining the wrong parameter for the ParamArray attribute.
13079
13080         Cope with requests for the type of the parameter at position
13081         greater than the params parameter's. We now return the element
13082         type of the params array as that makes more sense.
13083
13084         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
13085         accordingly as we no longer have to extract the element type
13086         ourselves.
13087
13088         (Invocation.OverloadResolve): Update.
13089
13090 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
13091
13092         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
13093         against IEnumerator, test whether the return value is a descendant
13094         of the IEnumerator interface.
13095
13096         * class.cs (Indexer.Define): Use an auxiliary method to implement
13097         the other bits of the method definition.  Begin support for
13098         explicit interface implementation.
13099
13100         (Property.DefineMethod): Use TypeManager.void_type instead of null
13101         for an empty return value.
13102
13103 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
13106         dealing with a FieldExpr which is composed of a FieldBuilder, in
13107         the code path we did extract the constant, but we should have
13108         obtained the underlying value to be able to cast it (otherwise we
13109         end up in an infinite loop, this is what Ravi was running into).
13110
13111         (ArrayCreation.UpdateIndices): Arrays might be empty.
13112
13113         (MemberAccess.ResolveMemberAccess): Add support for section
13114         14.5.4.1 that deals with the special case of E.I when E is a type
13115         and something else, that I can be a reference to a static member.
13116
13117         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
13118         handle a particular array type to create byte blobs, it is just
13119         something we dont generate byteblobs for.
13120
13121         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
13122         arguments. 
13123
13124         * location.cs (Push): remove the key from the hashtable that we
13125         are about to add.   This happens for empty files.
13126
13127         * driver.cs: Dispose files after we have parsed them.
13128
13129         (tokenize): new function that only runs the tokenizer on its
13130         input, for speed testing.
13131
13132 2001-12-26  Ravi Pratap  <ravi@ximian.com>
13133
13134         * class.cs (Event.Define): Define the private field only if there
13135         are no accessors defined.
13136
13137         * expression.cs (ResolveMemberAccess): If there is no associated
13138         field with the event, that means we have an event defined with its
13139         own accessors and we should flag error cs0070 since transforming
13140         ourselves into a field is not valid in that case.
13141
13142         * ecore.cs (SimpleName.DoResolve): Same as above.
13143
13144         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
13145         and charset to sane values.
13146
13147 2001-12-25  Ravi Pratap  <ravi@ximian.com>
13148
13149         * assign.cs (DoResolve): Perform check on events only if they 
13150         are being accessed outside the declaring type.
13151
13152         * cs-parser.jay (event_declarations): Update rules to correctly
13153         set the type of the implicit parameter etc.
13154
13155         (add_accessor, remove_accessor): Set current local parameters.
13156
13157         * expression.cs (Binary): For delegate addition and subtraction,
13158         cast the return value from the method into the appropriate delegate
13159         type.
13160
13161 2001-12-24  Ravi Pratap  <ravi@ximian.com>
13162
13163         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
13164         of these as the workaround is unnecessary.
13165
13166         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
13167         delegate data - none of that is needed at all.
13168
13169         Re-write bits to extract the instance expression and the delegate method
13170         correctly.
13171
13172         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
13173         on delegates too.
13174
13175         * attribute.cs (ApplyAttributes): New method to take care of common tasks
13176         of attaching attributes instead of duplicating code everywhere.
13177
13178         * everywhere : Update code to do attribute emission using the above method.
13179
13180 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
13181
13182         * expression.cs (IsParamsMethodApplicable): if there are not
13183         parameters, return immediately.
13184
13185         * ecore.cs: The 0 literal can be implicity converted to an enum
13186         type. 
13187
13188         (SimpleName.DoResolve): First lookup the type, then lookup the
13189         members. 
13190
13191         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
13192         want to get its address.  If the InstanceExpression is not
13193         addressable, store the result in a temporary variable, then get
13194         the address of it.
13195
13196         * codegen.cs: Only display 219 errors on warning level or above. 
13197
13198         * expression.cs (ArrayAccess): Make it implement the
13199         IMemoryLocation interface.
13200
13201         (Binary.DoResolve): handle the operator == (object a, object b)
13202         and operator != (object a, object b) without incurring into a
13203         BoxedCast (because 5 != o should never be performed).
13204
13205         Handle binary enumerator operators.
13206
13207         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
13208         value type, otherwise use Ldelem_ref.
13209
13210         Use precomputed names;
13211
13212         (AddressOf): Implement address of
13213
13214         * cs-parser.jay (labeled_statement): Fix recursive block
13215         addition by reworking the production.
13216
13217         * expression.cs (New.DoEmit): New has a special case:
13218                 
13219                  If we are dealing with a ValueType, we have a few
13220                  situations to deal with:
13221                 
13222                     * The target of New is a ValueType variable, that is
13223                       easy, we just pass this as the variable reference
13224                 
13225                     * The target of New is being passed as an argument,
13226                       to a boxing operation or a function that takes a
13227                       ValueType.
13228                 
13229                       In this case, we need to create a temporary variable
13230                       that is the argument of New.
13231
13232
13233 2001-12-23  Ravi Pratap  <ravi@ximian.com>
13234
13235         * rootcontext.cs (LookupType): Check that current_type is not null before
13236         going about looking at nested types.
13237
13238         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
13239         not implement the IAssignMethod interface any more.
13240
13241         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
13242         where we tranform them into FieldExprs if they are being resolved from within
13243         the declaring type.
13244
13245         * ecore.cs (SimpleName.DoResolve): Do the same here.
13246
13247         * assign.cs (DoResolve, Emit): Clean up code considerably. 
13248
13249         * ../errors/bug10.cs : Add.
13250
13251         * ../errors/cs0070.cs : Add.
13252
13253         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
13254
13255         * assign.cs : Get rid of EventIsLocal everywhere.
13256
13257 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
13258
13259         * ecore.cs (ConvertIntLiteral): finished the implementation.
13260
13261         * statement.cs (SwitchLabel): Convert the value we are using as a
13262         key before looking up the table.
13263
13264 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13265
13266         * codegen.cs (EmitTopBlock): Require a Location argument now.
13267
13268         * cs-parser.jay (constructor_declarator): We need to setup
13269         current_local_parameters before we parse the
13270         opt_constructor_initializer, to allow the variables to be bound
13271         to the constructor arguments.
13272
13273         * rootcontext.cs (LookupType): First lookup nested classes in our
13274         class and our parents before we go looking outside our class.
13275
13276         * expression.cs (ConstantFold): Extract/debox the values at the
13277         beginnning. 
13278
13279         * rootcontext.cs (EmitCode): Resolve the constants first before we
13280         resolve the types.  This is not really needed, but it helps debugging.
13281
13282         * statement.cs: report location.
13283
13284         * cs-parser.jay: pass location to throw statement.
13285
13286         * driver.cs: Small bug fix.
13287
13288         * report.cs: Updated format to be 4-zero filled digits.
13289
13290 2001-12-22  Ravi Pratap  <ravi@ximian.com>
13291
13292         * expression.cs (CheckIndices): Fix minor bug where the wrong
13293         variable was being referred to ;-)
13294
13295         (DoEmit): Do not call EmitStaticInitializers when the 
13296         underlying type is System.Object.
13297
13298 2001-12-21  Ravi Pratap  <ravi@ximian.com>
13299
13300         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
13301         and do the usual workaround for SRE.
13302
13303         * class.cs (MyEventBuilder.EventType): New member to get at the type
13304         of the event, quickly.
13305
13306         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
13307
13308         * assign.cs (Assign.DoResolve): Handle the case when the target
13309         is an EventExpr and perform the necessary checks.
13310
13311         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
13312         interface.
13313
13314         (SimpleName.MemberStaticCheck): Include check for EventExpr.
13315
13316         (EventExpr): Set the type in the constructor itself since we 
13317         are meant to be born fully resolved.
13318
13319         (EventExpr.Define): Revert code I wrote earlier.
13320                 
13321         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
13322         instance expression is null. The instance expression is a This in that case
13323         or a null, depending on whether it is a static method or not.
13324
13325         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
13326         refers to more than one method.
13327
13328         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
13329         and accordingly flag errors.
13330
13331 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13332
13333         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
13334
13335 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
13336
13337         * location.cs (ToString): Provide useful rutine.
13338
13339 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
13340
13341         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
13342         objects, return the actual integral boxed.
13343
13344         * statement.cs (SwitchLabel): define an ILLabel for each
13345         SwitchLabel. 
13346
13347         (Switch.CheckSwitch): If the value is a Literal, extract
13348         the underlying literal.
13349
13350         Also in the unused hashtable we had, add the SwitchLabel so we can
13351         quickly look this value up.
13352
13353         * constant.cs: Implement a bunch of new constants.  Rewrite
13354         Literal based on this.  Made changes everywhere to adapt to this.
13355
13356         * expression.cs (Expression.MakeByteBlob): Optimize routine by
13357         dereferencing array only once, and also copes with enumrations.
13358
13359         bytes are two bytes wide, not one.
13360
13361         (Cast): Perform constant conversions.
13362
13363         * ecore.cs (TryImplicitIntConversion): Return literals instead of
13364         wrappers to the literals here.
13365
13366         * expression.cs (DoNumericPromotions): long literals can converted
13367         to ulong implicity (this is taken care of elsewhere, but I was
13368         missing this spot).
13369
13370         * ecore.cs (Expression.Literalize): Make the return type Literal,
13371         to improve type checking.
13372
13373         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
13374
13375 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * literal.cs: Revert code from ravi that checked the bounds.  The
13378         bounds are sane by the definition of the type itself. 
13379
13380         * typemanager.cs: Fix implementation of ImplementsInterface.  We
13381         need to actually look up in our parent hierarchy for interfaces
13382         implemented. 
13383
13384         * const.cs: Use the underlying type for enumerations
13385
13386         * delegate.cs: Compute the basename for the delegate creation,
13387         that should fix the delegate test case, and restore the correct
13388         Type Lookup semantics in rootcontext
13389
13390         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
13391         referencing a nested type with the Reflection API is using the "+"
13392         sign. 
13393
13394         * cs-parser.jay: Do not require EOF token at the end.
13395
13396 2001-12-20  Ravi Pratap  <ravi@ximian.com>
13397
13398         * rootcontext.cs (LookupType): Concatenate type names with
13399         a '.' instead of a '+' The test suite passes again.
13400
13401         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
13402         field of the enumeration.
13403
13404         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
13405         the case when the member is an EventExpr.
13406
13407         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
13408         static has an associated instance expression.
13409
13410         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
13411
13412         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
13413
13414         * class.cs (Event.Define): Register event and perform appropriate checks
13415         for error #111.
13416
13417         We define the Add and Remove methods even if the use provides none because
13418         in that case, we provide default implementations ourselves.
13419
13420         Define a private field of the type of the event. This is done by the CSC compiler
13421         and we should be doing it too ;-)
13422
13423         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
13424         More methods we use in code we generate.
13425
13426         (multicast_delegate_type, delegate_type): Two separate types since the distinction
13427         is important.
13428
13429         (InitCoreTypes): Update accordingly for the above.
13430
13431         * class.cs (Event.Emit): Generate code for default accessors that we provide
13432
13433         (EmitDefaultMethod): Do the job in the above.
13434
13435         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
13436         appropriate place.
13437
13438 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
13441         builders even if we were missing one.
13442
13443         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
13444         pass the Basename as our class name instead of the Name.  The
13445         basename will be correctly composed for us.
13446
13447         * parameter.cs (Paramters): Now takes a Location argument.
13448
13449         * decl.cs (DeclSpace.LookupType): Removed convenience function and
13450         make all the code call directly LookupType in RootContext and take
13451         this chance to pass the Location information everywhere.
13452
13453         * Everywhere: pass Location information.
13454
13455 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * class.cs (Constructor.Define): Updated way of detecting the
13458         length of the parameters.
13459
13460         (TypeContainer.DefineType): Use basename as the type name for
13461         nested types.
13462
13463         (TypeContainer.Define): Do not recursively define types here, as
13464         definition is taken care in order by the RootContext.
13465
13466         * tree.cs: Keep track of namespaces in a per-file basis.
13467
13468         * parameter.cs (Parameter.ComputeSignature): Update to use
13469         DeclSpace. 
13470
13471         (Parameters.GetSignature): ditto.
13472
13473         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
13474         instead of a TypeContainer.
13475
13476         (Interface.SemanticAnalysis): Use `this' instead of our parent to
13477         resolve names.  Because we need to be resolve in our context, not
13478         our parents.
13479
13480         * driver.cs: Implement response files.
13481
13482         * class.cs (TypeContainer.DefineType): If we are defined, do not
13483         redefine ourselves.
13484
13485         (Event.Emit): Emit the code for add/remove handlers.
13486         (Event.Define): Save the MethodBuilders for add/remove.
13487
13488         * typemanager.cs: Use pair here too.
13489
13490         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
13491         DictionaryEntry requires the first argument to be non-null.  
13492
13493         (enum_declaration): Compute full name for registering the
13494         enumeration.
13495
13496         (delegate_declaration): Instead of using
13497         formal_parameter_list, use opt_formal_parameter_list as the list
13498         can be empty.
13499
13500         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
13501         (EventParsing): New property that controls whether `add' and
13502         `remove' are returned as tokens or identifiers (for events);
13503
13504 2001-12-19  Ravi Pratap  <ravi@ximian.com>
13505
13506         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
13507         use MyEventBuilder only and let it wrap the real builder for us.
13508
13509         (MyEventBuilder): Revamp constructor etc.
13510
13511         Implement all operations that we perform on EventBuilder in precisely the same
13512         way here too.
13513
13514         (FindMembers): Update to use the EventBuilder member.
13515
13516         (Event.Emit): Update accordingly.
13517
13518 2001-12-18  Ravi Pratap  <ravi@ximian.com>
13519
13520         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
13521         by calling the appropriate methods.
13522
13523         (GetCustomAttributes): Make stubs as they cannot possibly do anything
13524         useful.
13525
13526         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
13527
13528 2001-12-17  Ravi Pratap  <ravi@ximian.com>
13529
13530         * delegate.cs (Delegate.Populate): Check that the return type
13531         and various parameters types are indeed accessible.
13532
13533         * class.cs (Constructor.Define): Same here.
13534
13535         (Field.Define): Ditto.
13536
13537         (Event.Define): Ditto.
13538
13539         (Operator.Define): Check that the underlying Method defined itself
13540         correctly - so it's MethodBuilder should not be null.
13541
13542         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
13543         expression happens to be null.
13544
13545         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
13546         members but as of now we don't seem to be able to do anything really useful with it.
13547
13548         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
13549         not the EventBuilder.
13550
13551 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * cs-tokenizer.cs: Add support for defines.
13554         Add support for #if, #elif, #else, #endif
13555
13556         (eval_var): evaluates a variable.
13557         (eval): stubbed for evaluating functions.
13558
13559         * cs-parser.jay: Pass the defines information
13560
13561         * driver.cs: Add --define command line option.
13562
13563         * decl.cs: Move MemberCore here.
13564
13565         Make it the base class for DeclSpace.  This allows us to catch and
13566         report 108 and 109 for everything now.
13567
13568         * class.cs (TypeContainer.Define): Extract all the members
13569         before populating and emit the warning 108 (new keyword required
13570         to override) instead of having each member implement this.
13571
13572         (MemberCore.Define): New abstract method, we will be using this in
13573         the warning reporting engine in Populate.
13574
13575         (Operator.Define): Adjust to new MemberCore protocol. 
13576
13577         * const.cs (Const): This does not derive from Expression, it is a
13578         temporary object we use to create fields, it is a MemberCore. 
13579
13580         * class.cs (Method.Define): Allow the entry point to be in a
13581         specific class.
13582
13583         * driver.cs: Rewrite the argument handler to clean it up a bit.
13584
13585         * rootcontext.cs: Made it just an auxiliary namespace feature by
13586         making everything static.
13587
13588         * driver.cs: Adapt code to use RootContext type name instead of
13589         instance variable.
13590
13591         * delegate.cs: Remove RootContext argument.
13592
13593         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
13594         argument. 
13595
13596         * class.cs (Event.Define): The lookup can fail.
13597
13598         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
13599
13600         * expression.cs: Resolve the this instance before invoking the code.
13601
13602 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
13603
13604         * cs-parser.jay: Add a production in element_access that allows
13605         the thing to become a "type" reference.  This way we can parse
13606         things like "(string [])" as a type.
13607
13608         Note that this still does not handle the more complex rules of
13609         casts. 
13610
13611
13612         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
13613
13614         * ecore.cs: (CopyNewMethods): new utility function used to
13615         assemble the list of methods from running FindMembers.
13616
13617         (MemberLookup): Rework FindMembers so that 
13618
13619 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * class.cs (TypeContainer): Remove Delegates who fail to be
13622         defined.
13623
13624         * delegate.cs (Populate): Verify that we dont get null return
13625         values.   TODO: Check for AsAccessible.
13626
13627         * cs-parser.jay: Use basename to emit error 574 (destructor should
13628         have the same name as container class), not the full name.
13629
13630         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
13631         possible representation.  
13632
13633         Also implements integer type suffixes U and L.
13634
13635 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
13636
13637         * expression.cs (ArrayCreation.DoResolve): We need to do the
13638         argument resolution *always*.
13639
13640         * decl.cs: Make this hold the namespace.  Hold the root context as
13641         well.
13642         (LookupType): Move here.
13643
13644         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
13645
13646         * location.cs (Row, Name): Fixed the code, it was always returning
13647         references to the first file.
13648
13649         * interface.cs: Register properties defined through interfaces.
13650
13651         * driver.cs: Add support for globbing on the command line
13652
13653         * class.cs (Field): Make it derive from MemberCore as well.
13654         (Event): ditto.
13655
13656 2001-12-15  Ravi Pratap  <ravi@ximian.com>
13657
13658         * class.cs (Event::Define): Check that the type of the event is a delegate
13659         type else flag error #66.
13660
13661         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
13662         same.
13663
13664         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
13665         values of EntryPoint, CharSet etc etc.
13666
13667         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
13668
13669         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
13670         be null and we should ignore this. I am not sure if this is really clean. Apparently,
13671         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
13672         which needs this to do its work.
13673
13674         * ../errors/cs0066.cs : Add.
13675
13676 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
13679         helper functions.
13680
13681         * class.cs: (MethodSignature.MethodSignature): Removed hack that
13682         clears out the parameters field.
13683         (MemberSignatureCompare): Cleanup
13684
13685         (MemberCore): New base class used to share code between MethodCore
13686         and Property.
13687
13688         (RegisterRequiredImplementations) BindingFlags.Public requires
13689         either BindingFlags.Instace or Static.  Use instance here.
13690
13691         (Property): Refactored code to cope better with the full spec.
13692
13693         * parameter.cs (GetParameterInfo): Return an empty array instead
13694         of null on error.
13695
13696         * class.cs (Property): Abstract or extern properties have no bodies.
13697
13698         * parameter.cs (GetParameterInfo): return a zero-sized array.
13699
13700         * class.cs (TypeContainer.MethodModifiersValid): Move all the
13701         method modifier validation to the typecontainer so we can reuse
13702         this on properties.
13703
13704         (MethodCore.ParameterTypes): return an empty sized array of types.
13705
13706         (Property.Define): Test property modifier validity.
13707
13708         Add tests for sealed/override too.
13709
13710         (Method.Emit): abstract or extern methods have no bodies.
13711
13712 2001-12-14  Ravi Pratap  <ravi@ximian.com>
13713
13714         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
13715         thing.
13716
13717         (Method::Define, ::Emit): Modify accordingly.
13718
13719         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
13720
13721         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
13722
13723         * makefile: Pass in /unsafe.
13724
13725 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
13726
13727         * class.cs (MakeKey): Kill routine.
13728
13729         * class.cs (TypeContainer.Define): Correctly define explicit
13730         method implementations (they require the full interface name plus
13731         the method name).
13732
13733         * typemanager.cs: Deply the PtrHashtable here and stop using the
13734         lame keys.  Things work so much better.
13735
13736         This of course broke everyone who depended on `RegisterMethod' to
13737         do the `test for existance' test.  This has to be done elsewhere.
13738
13739         * support.cs (PtrHashtable): A hashtable that avoid comparing with
13740         the object stupid Equals method (because, that like fails all over
13741         the place).  We still do not use it.
13742
13743         * class.cs (TypeContainer.SetRequiredInterface,
13744         TypeContainer.RequireMethods): Killed these two routines and moved
13745         all the functionality to RegisterRequiredImplementations.
13746
13747         (TypeContainer.RegisterRequiredImplementations): This routine now
13748         registers all the implementations required in an array for the
13749         interfaces and abstract methods.  We use an array of structures
13750         which can be computed ahead of time to reduce memory usage and we
13751         also assume that lookups are cheap as most classes will not
13752         implement too many interfaces.
13753
13754         We also avoid creating too many MethodSignatures.
13755
13756         (TypeContainer.IsInterfaceMethod): Update and optionally does not
13757         clear the "pending" bit if we find that there are problems with
13758         the declaration.
13759
13760         (TypeContainer.VerifyPendingMethods): Update to report errors of
13761         methods that look like implementations but are not.
13762
13763         (TypeContainer.Define): Add support for explicit interface method
13764         implementation. 
13765
13766 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
13767
13768         * typemanager.cs: Keep track of the parameters here instead of
13769         being a feature of the TypeContainer.
13770
13771         * class.cs: Drop the registration of parameters here, as
13772         InterfaceMethods are also interface declarations.
13773
13774         * delegate.cs: Register methods with the TypeManager not only with
13775         the TypeContainer.  This code was buggy.
13776
13777         * interface.cs: Full registation here.
13778
13779 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * expression.cs: Remove reducer for binary expressions, it can not
13782         be done this way.
13783
13784         * const.cs: Put here the code that used to go into constant.cs
13785
13786         * constant.cs: Put here the code for constants, this is a new base
13787         class for Literals.
13788
13789         * literal.cs: Make Literal derive from Constant.
13790
13791 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
13792
13793         * statement.cs (Return.Emit): Report error 157 if the user
13794         attempts to return from a finally block.
13795
13796         (Return.Emit): Instead of emitting a return, jump to the end of
13797         the function.
13798
13799         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
13800         LocalBuilder to store the result of the function.  ReturnLabel is
13801         the target where we jump.
13802
13803
13804 2001-12-09  Radek Doulik  <rodo@ximian.com>
13805
13806         * cs-parser.jay: remember alias in current namespace
13807
13808         * ecore.cs (SimpleName::DoResolve): use aliases for types or
13809         namespaces
13810
13811         * class.cs (LookupAlias): lookup alias in my_namespace
13812
13813         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
13814         aliases hashtable
13815         (LookupAlias): lookup alias in this and if needed in parent
13816         namespaces
13817
13818 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
13819
13820         * support.cs: 
13821
13822         * rootcontext.cs: (ModuleBuilder) Made static, first step into
13823         making things static.  I need this to avoid passing the
13824         TypeContainer when calling ParameterType.
13825
13826         * support.cs (InternalParameters.ParameterType): Remove ugly hack
13827         that did string manipulation to compute the type and then call
13828         GetType.  Use Parameter.ParameterType instead.
13829
13830         * cs-tokenizer.cs: Consume the suffix for floating values.
13831
13832         * expression.cs (ParameterReference): figure out whether this is a
13833         reference parameter or not.  Kill an extra variable by computing
13834         the arg_idx during emission.
13835
13836         * parameter.cs (Parameters.GetParameterInfo): New overloaded
13837         function that returns whether a parameter is an out/ref value or not.
13838
13839         (Parameter.ParameterType): The type of the parameter (base,
13840         without ref/out applied).
13841
13842         (Parameter.Resolve): Perform resolution here.
13843         (Parameter.ExternalType): The full type (with ref/out applied).
13844
13845         * statement.cs (Using.Emit, Using.EmitExpression): Implement
13846         support for expressions on the using statement.
13847
13848 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
13849
13850         * statement.cs (Using.EmitLocalVariableDecls): Split the
13851         localvariable handling of the using statement.
13852
13853         (Block.EmitMeta): Keep track of variable count across blocks.  We
13854         were reusing slots on separate branches of blocks.
13855
13856         (Try.Emit): Emit the general code block, we were not emitting it. 
13857
13858         Check the type of the declaration to be an IDisposable or
13859         something that can be implicity converted to it. 
13860
13861         Emit conversions if required.
13862
13863         * ecore.cs (EmptyExpression): New utility class.
13864         (Expression.ImplicitConversionExists): New utility function.
13865
13866 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
13867
13868         * statement.cs (Using): Implement.
13869
13870         * expression.cs (LocalVariableReference): Support read only variables.
13871
13872         * statement.cs: Remove the explicit emit for the Leave opcode.
13873         (VariableInfo): Add a readonly field.
13874
13875 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
13876
13877         * ecore.cs (ConvCast): new class used to encapsulate the various
13878         explicit integer conversions that works in both checked and
13879         unchecked contexts.
13880
13881         (Expression.ConvertNumericExplicit): Use new ConvCast class to
13882         properly generate the overflow opcodes.
13883
13884 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13885
13886         * statement.cs: The correct type for the EmptyExpression is the
13887         element_type, not the variable type.  Ravi pointed this out.
13888
13889 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13890
13891         * class.cs (Method::Define): Handle PInvoke methods specially
13892         by using DefinePInvokeMethod instead of the usual one.
13893
13894         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
13895         above to do the task of extracting information and defining the method.
13896
13897 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13898
13899         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
13900         of the condition for string type.
13901
13902         (Emit): Move that here. 
13903
13904         (ArrayCreation::CheckIndices): Keep string literals in their expression
13905         form.
13906
13907         (EmitDynamicInitializers): Handle strings appropriately.
13908
13909 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * codegen.cs (EmitContext): Replace multiple variables with a
13912         single pointer to the current Switch statement.
13913
13914         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
13915         EmitContext.
13916
13917 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13918
13919         * statement.cs 
13920
13921         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
13922         default'.
13923
13924         (Foreach.Emit): Foreach on arrays was not setting
13925         up the loop variables (for break/continue).
13926
13927         (GotoCase): Semi-implented.
13928
13929 2001-12-03  Ravi Pratap  <ravi@ximian.com>
13930
13931         * attribute.cs (CheckAttribute): Handle system attributes by using
13932         Attribute.GetAttributes to examine information we need.
13933
13934         (GetValidPlaces): Same here.
13935
13936         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
13937
13938         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
13939
13940         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
13941
13942         (Method::Define): Set appropriate flags if we have a DllImport attribute.
13943
13944         (Method::Emit): Handle the case when we are a PInvoke method.
13945
13946 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * expression.cs: Use ResolveWithSimpleName on compound names.
13949
13950 2001-12-02  Ravi Pratap  <ravi@ximian.com>
13951
13952         * constant.cs (EmitConstant): Make sure we resolve the associated expression
13953         before trying to reduce it.
13954
13955         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
13956
13957         * constant.cs (LookupConstantValue): Implement.
13958
13959         (EmitConstant): Use the above in emitting the constant.
13960
13961         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
13962         that are user-defined by doing a LookupConstantValue on them.
13963
13964         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
13965         too, like above.
13966
13967 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
13970
13971         (BaseAccess.DoResolve): Implement.
13972
13973         (MemberAccess.DoResolve): Split this routine into a
13974         ResolveMemberAccess routine that can be used independently
13975
13976 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
13977
13978         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
13979         As that share bits of the implementation.  Is returns a boolean,
13980         while As returns the Type that is being probed.
13981
13982 2001-12-01  Ravi Pratap  <ravi@ximian.com>
13983
13984         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
13985         instead of a Literal - much easier.
13986
13987         (EnumInTransit): Remove - utterly useless :-)
13988
13989         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
13990
13991         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
13992
13993         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
13994         chain when we have no associated expression.
13995
13996 2001-11-30  Ravi Pratap  <ravi@ximian.com>
13997
13998         * constant.cs (Define): Use Location while reporting the errror.
13999
14000         Also emit a warning when 'new' is used and there is no inherited
14001         member to hide.
14002
14003         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
14004         populated.
14005
14006         (LookupEnumValue): Implement to lookup an enum member's value and define it
14007         if necessary.
14008
14009         (Populate): Re-write accordingly to use the above routine.
14010
14011 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * expression.cs (This): Fix prototype for DoResolveLValue to
14014         override the base class DoResolveLValue.
14015
14016         * cs-parser.cs: Report errors cs574 and cs575 (destructor
14017         declarations) 
14018
14019         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
14020         (we need to load the address of the field here).  This fixes
14021         test-22. 
14022
14023         (FieldExpr.DoResolveLValue): Call the DoResolve
14024         function to initialize the Instance expression.
14025
14026         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
14027         correctly the GetEnumerator operation on a value type.
14028
14029         * cs-parser.jay: Add more simple parsing error catches.
14030
14031         * statement.cs (Switch): Add support for string switches.
14032         Handle null specially.
14033
14034         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
14035
14036 2001-11-28  Ravi Pratap  <ravi@ximian.com>
14037
14038         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
14039
14040         (declare_local_constant): New helper function.
14041
14042         * statement.cs (AddConstant): Keep a separate record of constants
14043
14044         (IsConstant): Implement to determine if a variable is a constant.
14045
14046         (GetConstantExpression): Implement.
14047
14048         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
14049
14050         * statement.cs (IsVariableDefined): Re-write.
14051
14052 2001-11-27  Ravi Pratap  <ravi@ximian.com>
14053
14054         * class.cs (TypeContainer::FindMembers): Look for constants
14055         in the case when we are looking for MemberTypes.Field
14056
14057         * expression.cs (MemberAccess::DoResolve): Check that in the
14058         case we are a FieldExpr and a Literal, we are not being accessed
14059         by an instance reference.
14060
14061         * cs-parser.jay (local_constant_declaration): Implement.
14062
14063         (declaration_statement): Implement for constant declarations.
14064
14065 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
14066
14067         * statement.cs (Switch): Catch double defaults.
14068
14069         (Switch): More work on the switch() statement
14070         implementation.  It works for integral values now, need to finish
14071         string support.
14072
14073
14074 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
14075
14076         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
14077         integer literals into other integer literals.  To be used by
14078         switch. 
14079
14080 2001-11-24  Ravi Pratap  <ravi@ximian.com>
14081
14082         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
14083         some memory.
14084
14085         (EmitDynamicInitializers): Cope with the above since we extract data
14086         directly from ArrayData now.
14087
14088         (ExpectInitializers): Keep track of whether initializers are mandatory
14089         or not.
14090
14091         (Bounds): Make it a hashtable to prevent the same dimension being 
14092         recorded for every element in that dimension.
14093
14094         (EmitDynamicInitializers): Fix bug which prevented the Set array method
14095         from being found.
14096
14097         Also fix bug which was causing the indices to be emitted in the reverse
14098         order.
14099
14100 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
14101
14102         * expression.cs (ArrayCreation): Implement the bits that Ravi left
14103         unfinished.  They do not work, because the underlying code is
14104         sloppy.
14105
14106 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * cs-parser.jay: Remove bogus fixme.
14109
14110         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
14111         on Switch statement.
14112
14113 2001-11-23  Ravi Pratap  <ravi@ximian.com>
14114
14115         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
14116         the same. 
14117
14118         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
14119         parameter. Apparently, any expression is allowed. 
14120
14121         (ValidateInitializers): Update accordingly.
14122
14123         (CheckIndices): Fix some tricky bugs thanks to recursion.
14124
14125         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
14126         I was being completely brain-dead.
14127
14128         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
14129         and re-write acordingly.
14130
14131         (DelegateInvocation): Re-write accordingly.
14132
14133         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
14134
14135         (MakeByteBlob): Handle types more correctly.
14136
14137         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
14138         initialization from expressions but it is incomplete because I am a complete
14139         Dodo :-|
14140
14141 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
14142
14143         * statement.cs (If.Emit): Fix a bug that generated incorrect code
14144         on If.  Basically, we have to return `true' (ie, we do return to
14145         our caller) only if both branches of the if return.
14146
14147         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
14148         short-circuit operators, handle them as short circuit operators. 
14149
14150         (Cast.DoResolve): Resolve type.
14151         (Cast.Cast): Take an expression as the target type.
14152
14153         * cs-parser.jay (cast_expression): Remove old hack that only
14154         allowed a limited set of types to be handled.  Now we take a
14155         unary_expression and we resolve to a type during semantic
14156         analysis.
14157
14158         Use the grammar productions from Rhys to handle casts (this is
14159         not complete like Rhys syntax yet, we fail to handle that corner
14160         case that C# has regarding (-x), but we will get there.
14161
14162 2001-11-22  Ravi Pratap  <ravi@ximian.com>
14163
14164         * class.cs (EmitFieldInitializer): Take care of the case when we have a
14165         field which is an array type.
14166
14167         * cs-parser.jay (declare_local_variables): Support array initialization too.
14168
14169         * typemanager.cs (MakeKey): Implement.
14170
14171         (everywhere): Use the above appropriately.
14172
14173         * cs-parser.jay (for_statement): Update for array initialization while
14174         declaring variables.
14175
14176         * ecore.cs : The error message was correct, it's the variable's names that
14177         were misleading ;-) Make the code more readable.
14178
14179         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
14180         the correct type etc.
14181
14182         (ConvertExplicit): Handle Enum types by examining the underlying type.
14183
14184 2001-11-21  Ravi Pratap  <ravi@ximian.com>
14185
14186         * parameter.cs (GetCallingConvention): Always return
14187         CallingConventions.Standard for now.
14188
14189 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
14190
14191         * expression.cs (Binary.ResolveOperator): Update the values of `l'
14192         and `r' after calling DoNumericPromotions.
14193
14194         * ecore.cs: Fix error message (the types were in the wrong order).
14195
14196         * statement.cs (Foreach.ProbeCollectionType): Need to pass
14197         BindingFlags.Instance as well 
14198
14199         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
14200         implicit int literal conversion in an empty cast so that we
14201         propagate the right type upstream.
14202
14203         (UnboxCast): new class used to unbox value types.
14204         (Expression.ConvertExplicit): Add explicit type conversions done
14205         by unboxing.
14206
14207         (Expression.ImplicitNumericConversion): Oops, forgot to test for
14208         the target type before applying the implicit LongLiterals to ULong
14209         literal cast.
14210
14211 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
14212
14213         * cs-parser.jay (for_statement): Reworked the way For works: now
14214         we declare manually any variables that are introduced in
14215         for_initializer to solve the problem of having out-of-band code
14216         emition (that is what got for broken).
14217
14218         (declaration_statement): Perform the actual variable declaration
14219         that used to be done in local_variable_declaration here.
14220
14221         (local_variable_declaration): Do not declare anything, just pass
14222         the information on a DictionaryEntry
14223
14224 2001-11-20  Ravi Pratap  <ravi@ximian.com>
14225
14226         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
14227         re-write of the logic to now make it recursive.
14228
14229         (UpdateIndices): Re-write accordingly.
14230
14231         Store element data in a separate ArrayData list in the above methods.
14232
14233         (MakeByteBlob): Implement to dump the array data into a byte array.
14234
14235 2001-11-19  Ravi Pratap  <ravi@ximian.com>
14236
14237         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
14238         into CheckIndices.
14239
14240         * constant.cs (Define): Implement.
14241
14242         (EmitConstant): Re-write fully.
14243
14244         Pass in location info.
14245
14246         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
14247         respectively.
14248
14249         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
14250         DictionaryEntry since we need location info too.
14251
14252         (constant_declaration): Update accordingly.
14253
14254         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
14255         code into another method : UpdateIndices.
14256
14257 2001-11-18  Ravi Pratap  <ravi@ximian.com>
14258
14259         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
14260         some type checking etc.
14261
14262 2001-11-17  Ravi Pratap  <ravi@ximian.com>
14263
14264         * expression.cs (ArrayCreation::ValidateInitializers): Implement
14265         bits to provide dimension info if the user skips doing that.
14266
14267         Update second constructor to store the rank correctly.
14268
14269 2001-11-16  Ravi Pratap  <ravi@ximian.com>
14270
14271         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
14272         and try to implement.
14273
14274         * ../errors/cs0150.cs : Add.
14275
14276         * ../errors/cs0178.cs : Add.
14277
14278 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
14279
14280         * statement.cs: Implement foreach on multi-dimensional arrays. 
14281
14282         * parameter.cs (Parameters.GetParameterByName): Also lookup the
14283         name of the params argument.
14284
14285         * expression.cs: Use EmitStoreOpcode to get the right opcode while
14286         initializing the array.
14287
14288         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
14289         we can use this elsewhere.
14290
14291         * statement.cs: Finish implementation of foreach for single
14292         dimension arrays.
14293
14294         * cs-parser.jay: Use an out-of-band stack to pass information
14295         around, I wonder why I need this.
14296
14297         foreach_block: Make the new foreach_block the current_block.
14298
14299         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
14300         function used to return a static Parameters structure.  Used for
14301         empty parameters, as those are created very frequently.
14302
14303         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
14304
14305 2001-11-15  Ravi Pratap  <ravi@ximian.com>
14306
14307         * interface.cs : Default modifier is private, not public. The
14308         make verify test passes again.
14309
14310 2001-11-15  Ravi Pratap  <ravi@ximian.com>
14311
14312         * support.cs (ReflectionParameters): Fix logic to determine
14313         whether the last parameter is a params one. Test 9 passes again.
14314
14315         * delegate.cs (Populate): Register the builders we define with
14316         RegisterParameterForBuilder. Test 19 passes again.
14317
14318         * cs-parser.jay (property_declaration): Reference $6 instead
14319         of $$ to get at the location.
14320
14321         (indexer_declaration): Similar stuff.
14322
14323         (attribute): Ditto.
14324
14325         * class.cs (Property): Register parameters for the Get and Set methods
14326         if they exist. Test 23 passes again.
14327
14328         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
14329         call to EmitArguments as we are sure there aren't any params arguments. 
14330         Test 32 passes again.
14331
14332         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
14333         IndexOutOfRangeException. 
14334
14335         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
14336         Test 33 now passes again.
14337
14338 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
14339
14340         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
14341         broke a bunch of things.  Will have to come up with a better way
14342         of tracking locations.
14343
14344         * statement.cs: Implemented foreach for single dimension arrays.
14345
14346 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14347
14348         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
14349         an error.  This removes the lookup from the critical path.
14350
14351         * cs-parser.jay: Removed use of temporary_loc, which is completely
14352         broken. 
14353
14354 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
14355
14356         * support.cs (ReflectionParameters.ParameterModifier): Report
14357         whether the argument is a PARAMS argument or not.
14358
14359         * class.cs: Set the attribute `ParamArrayAttribute' on the
14360         parameter argument.
14361
14362         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
14363         and cons_param_array_attribute (ConstructorInfo for
14364         ParamArrayAttribute)., 
14365
14366         * codegen.cs: Emit the return using the `Return' statement, that
14367         way we can report the error correctly for missing return values. 
14368
14369         * class.cs (Method.Emit): Clean up.
14370
14371         * expression.cs (Argument.Resolve): Take another argument: the
14372         location where this argument is used.  Notice that this is not
14373         part of the "Argument" class as to reduce the size of the
14374         structure (we know the approximate location anyways).
14375
14376         Test if the argument is a variable-reference, if not, then
14377         complain with a 206.
14378
14379         (Argument.Emit): Emit addresses of variables.
14380
14381         (Argument.FullDesc): Simplify.
14382
14383         (Invocation.DoResolve): Update for Argument.Resolve.
14384
14385         (ElementAccess.DoResolve): ditto.
14386
14387         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
14388         method should be virtual, as this method is always virtual.
14389
14390         (NewDelegate.DoResolve): Update for Argument.Resolve.
14391
14392         * class.cs (ConstructorInitializer.DoResolve): ditto.
14393
14394         * attribute.cs (Attribute.Resolve): ditto.
14395
14396 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
14397
14398         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
14399
14400         * expression.cs (ParameterReference): Drop IStackStorage and implement
14401         IAssignMethod instead. 
14402
14403         (LocalVariableReference): ditto.
14404
14405         * ecore.cs (FieldExpr): Drop IStackStorage and implement
14406         IAssignMethod instead. 
14407
14408 2001-11-13  Miguel de Icaza <miguel@ximian.com>
14409
14410         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
14411         enumerations that are used in heavily used structures derive from
14412         byte in a laughable and pathetic attempt to reduce memory usage.
14413         This is the kind of pre-optimzations that you should not do at
14414         home without adult supervision.
14415
14416         * expression.cs (UnaryMutator): New class, used to handle ++ and
14417         -- separatedly from the other unary operators.  Cleans up the
14418         code, and kills the ExpressionStatement dependency in Unary.
14419
14420         (Unary): Removed `method' and `Arguments' from this class, making
14421         it smaller, and moving it all to SimpleCall, so I can reuse this
14422         code in other locations and avoid creating a lot of transient data
14423         strucutres when not required.
14424
14425         * cs-parser.jay: Adjust for new changes.
14426
14427 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
14428
14429         * enum.cs (Enum.Populate): If there is a failure during
14430         definition, return
14431
14432         * cs-parser.jay (opt_enum_base): we used to catch type errors
14433         here, but this is really incorrect.  The type error should be
14434         catched during semantic analysis.
14435
14436 2001-12-11  Ravi Pratap  <ravi@ximian.com>
14437
14438         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
14439         current_local_parameters as expected since I, in my stupidity, had forgotten
14440         to do this :-)
14441
14442         * attribute.cs (GetValidPlaces): Fix stupid bug.
14443
14444         * class.cs (Method::Emit): Perform check on applicability of attributes.
14445
14446         (Constructor::Emit): Ditto.
14447
14448         (Field::Emit): Ditto.
14449
14450         (Field.Location): Store location information.
14451
14452         (Property, Event, Indexer, Operator): Ditto.
14453
14454         * cs-parser.jay (field_declaration): Pass in location for each field.
14455
14456         * ../errors/cs0592.cs : Add.
14457
14458 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14459
14460         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
14461
14462         (InitCoreTypes): Update accordingly.
14463
14464         (RegisterAttrType, LookupAttr): Implement.
14465
14466         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
14467         info about the same.
14468
14469         (Resolve): Update to populate the above as necessary.
14470
14471         (Error592): Helper.
14472
14473         (GetValidPlaces): Helper to the above.
14474
14475         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
14476
14477         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
14478
14479 2001-11-12  Ravi Pratap  <ravi@ximian.com>
14480
14481         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
14482
14483         * ../errors/cs0617.cs : Add.
14484
14485 2001-11-11  Ravi Pratap  <ravi@ximian.com>
14486
14487         * enum.cs (Emit): Rename to Populate to be more consistent with what
14488         we expect it to do and when exactly it is called.
14489
14490         * class.cs, rootcontext.cs : Update accordingly.
14491
14492         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
14493         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
14494
14495         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
14496
14497         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
14498         of a fieldinfo using the above, when dealing with a FieldBuilder.
14499
14500 2001-11-10  Ravi Pratap  <ravi@ximian.com>
14501
14502         * ../errors/cs0031.cs : Add.
14503
14504         * ../errors/cs1008.cs : Add.
14505
14506         * ../errrors/cs0543.cs : Add.
14507
14508         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
14509         enum type.
14510
14511         (FindMembers): Implement.
14512
14513         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
14514         enums and delegates too.
14515
14516         (enum_types): Rename to builder_to_enum.
14517
14518         (delegate_types): Rename to builder_to_delegate.
14519
14520         * delegate.cs (FindMembers): Implement.
14521
14522 2001-11-09  Ravi Pratap  <ravi@ximian.com>
14523
14524         * typemanager.cs (IsEnumType): Implement.
14525
14526         * enum.cs (Emit): Re-write parts to account for the underlying type
14527         better and perform checking etc.
14528
14529         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
14530         of the underlying type.
14531
14532         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
14533         value
14534
14535         * enum.cs (error31): Helper to report error #31.
14536
14537         * cs-parser.jay (enum_declaration): Store location of each member too.
14538
14539         * enum.cs (member_to_location): New hashtable. 
14540
14541         (AddEnumMember): Update location hashtable.
14542
14543         (Emit): Use the location of each member while reporting errors.
14544
14545 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * cs-parser.jay: A for_initializer if is a
14548         local_variable_declaration really ammount to have an implicit
14549         block with the variable declaration and no initializer for for.
14550
14551         * statement.cs (For.Emit): Cope with null initializers.
14552
14553         This fixes the infinite loop on for initializers.
14554
14555 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * enum.cs: More cleanup.
14558
14559         * ecore.cs: Remove dead code.
14560
14561         * class.cs (Property.Emit): More simplification.
14562         (Event.Emit): ditto.
14563
14564         Reworked to have less levels of indentation.
14565
14566 2001-11-08  Ravi Pratap  <ravi@ximian.com>
14567
14568         * class.cs (Property): Emit attributes.
14569
14570         (Field): Ditto.
14571
14572         (Event): Ditto.
14573
14574         (Indexer): Ditto.
14575
14576         (Operator): Ditto.
14577
14578         * enum.cs (Emit): Ditto.
14579
14580         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
14581         Enums too.
14582
14583         * class.cs (Field, Event, etc.): Move attribute generation into the
14584         Emit method everywhere.
14585
14586         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
14587         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
14588         as we had no way of defining nested enums !
14589
14590         * rootcontext.cs : Adjust code accordingly.
14591
14592         * typemanager.cs (AddEnumType): To keep track of enum types separately.
14593
14594 2001-11-07  Ravi Pratap  <ravi@ximian.com>
14595
14596         * expression.cs (EvalConstantExpression): Move into ecore.cs
14597
14598         * enum.cs (Enum): Rename some members and make them public and readonly
14599         according to our convention.
14600
14601         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
14602         nothing else.
14603
14604         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
14605
14606         (Enum::Emit): Write a simple version for now which doesn't try to compute
14607         expressions. I shall modify this to be more robust in just a while.
14608
14609         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
14610
14611         (TypeContainer::CloseType): Create the Enum types too.
14612
14613         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
14614
14615         * expression.cs (EvalConstantExpression): Get rid of completely.
14616
14617         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
14618         user-defined values and other cases.
14619
14620         (IsValidEnumLiteral): Helper function.
14621
14622         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
14623         out there in the case we had a literal FieldExpr.
14624
14625         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
14626
14627         (Literalize): Revamp a bit to take two arguments.
14628
14629         (EnumLiteral): New class which derives from Literal to wrap enum literals.
14630
14631 2001-11-06  Ravi Pratap  <ravi@ximian.com>
14632
14633         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
14634
14635         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
14636
14637         (Resolve): Use the above to ensure we have proper initializers.
14638
14639 2001-11-05  Ravi Pratap  <ravi@ximian.com>
14640
14641         * expression.cs (Expression::EvalConstantExpression): New method to 
14642         evaluate constant expressions.
14643
14644         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
14645
14646 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
14647
14648         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
14649         in an array.
14650
14651         (Binary.ResolveOperator): Handle operator != (object a, object b)
14652         and operator == (object a, object b);
14653
14654         (Binary.DoNumericPromotions): Indicate whether the numeric
14655         promotion was possible.
14656
14657         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
14658         Implement.  
14659
14660         Made the ArrayAccess implement interface IAssignMethod instead of
14661         IStackStore as the order in which arguments are passed reflects
14662         this.
14663
14664         * assign.cs: Instead of using expr.ExprClass to select the way of
14665         assinging, probe for the IStackStore/IAssignMethod interfaces.
14666
14667         * typemanager.cs: Load InitializeArray definition.
14668
14669         * rootcontext.cs (RootContext.MakeStaticData): Used to define
14670         static data that can be used to initialize arrays. 
14671
14672 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
14673
14674         * expression.cs: Handle operator== and operator!= for booleans.
14675
14676         (Conditioal.Reduce): Implement reducer for the ?: operator.
14677
14678         (Conditional.Resolve): Implement dead code elimination.
14679
14680         (Binary.Resolve): Catch string literals and return a new
14681         concatenated string.
14682
14683         (Unary.Reduce): Implement reduction of unary expressions.
14684
14685         * ecore.cs: Split out the expression core handling here.
14686
14687         (Expression.Reduce): New method used to perform constant folding
14688         and CSE.  This is needed to support constant-expressions. 
14689
14690         * statement.cs (Statement.EmitBoolExpression): Pass true and false
14691         targets, and optimize for !x.
14692
14693 2001-11-04  Ravi Pratap  <ravi@ximian.com>
14694
14695         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
14696         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
14697         set custom atttributes.
14698
14699         * literal.cs (Literal::GetValue): New abstract method to return the actual
14700         value of the literal, cast as an object.
14701
14702         (*Literal): Implement GetValue method.
14703
14704         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
14705         expressions to the arraylist but objects of type Argument.
14706
14707         * class.cs (TypeContainer::Emit): Emit our attributes too.
14708
14709         (Method::Emit, Constructor::Emit): Ditto.
14710
14711         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
14712         to be ignoring earlier.
14713
14714 2001-11-03  Ravi Pratap  <ravi@ximian.com>
14715
14716         * attribute.cs (AttributeSection::Define): Implement to do the business
14717         of constructing a CustomAttributeBuilder.
14718
14719         (Attribute): New trivial class. Increases readability of code.  
14720
14721         * cs-parser.jay : Update accordingly.
14722
14723         (positional_argument_list, named_argument_list, named_argument): New rules
14724
14725         (attribute_arguments): Use the above so that we are more correct.
14726
14727 2001-11-02  Ravi Pratap  <ravi@ximian.com>
14728
14729         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
14730         to perform all checks for a method with a params parameter.
14731
14732         (Invocation::OverloadResolve): Update to use the above method and therefore
14733         cope correctly with params method invocations.
14734
14735         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
14736         params too.
14737
14738         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
14739         constructors in our parent too because we can't afford to miss out on 
14740         protected ones ;-)
14741
14742         * attribute.cs (AttributeSection): New name for the class Attribute
14743
14744         Other trivial changes to improve readability.
14745
14746         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
14747         use the new class names.
14748
14749 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14750
14751         * class.cs (Method::Define): Complete definition for params types too
14752
14753         (Indexer::Define): Ditto.
14754
14755         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
14756         Cope everywhere with a request for info about the array parameter.
14757
14758 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14759
14760         * tree.cs (RecordNamespace): Fix up to check for the correct key.
14761
14762         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
14763         local_variable_type to extract the string corresponding to the type.
14764
14765         (local_variable_type): Fixup the action to use the new helper method.
14766
14767         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
14768         go.
14769
14770         * expression.cs : Clean out code which uses the above.
14771
14772 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14773
14774         * typemanager.cs (RegisterMethod): Check if we already have an existing key
14775         and bale out if necessary by returning a false.
14776
14777         (RegisterProperty): Ditto.
14778
14779         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
14780         and print out appropriate error messages.
14781
14782         * interface.cs (everywhere): Ditto.
14783
14784         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
14785         location to constructor.
14786
14787         * class.cs (Property, Event, Indexer): Update accordingly.
14788
14789         * ../errors/cs111.cs : Added.
14790
14791         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
14792         of a method, as laid down by the spec.
14793
14794         (Invocation::OverloadResolve): Use the above method.
14795
14796 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14797
14798         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
14799         now take a TypeContainer and a Parameters object.
14800
14801         (ParameterData): Modify return type of ParameterModifier method to be 
14802         Parameter.Modifier and not a string.
14803
14804         (ReflectionParameters, InternalParameters): Update accordingly.
14805
14806         * expression.cs (Argument::GetParameterModifier): Same here.
14807
14808         * support.cs (InternalParameters::ParameterType): Find a better way of determining
14809         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
14810         symbol in it at all so maybe this is only for now.
14811
14812 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14813
14814         * support.cs (InternalParameters): Constructor now takes an extra argument 
14815         which is the actual Parameters class.
14816
14817         (ParameterDesc): Update to provide info on ref/out modifiers.
14818
14819         * class.cs (everywhere): Update call to InternalParameters to pass in
14820         the second argument too.
14821
14822         * support.cs (ParameterData): Add ParameterModifier, which is a method 
14823         to return the modifier info [ref/out etc]
14824
14825         (InternalParameters, ReflectionParameters): Implement the above.
14826
14827         * expression.cs (Argument::ParameterModifier): Similar function to return
14828         info about the argument's modifiers.
14829
14830         (Invocation::OverloadResolve): Update to take into account matching modifiers 
14831         too.
14832
14833         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
14834         a new SetFormalParameters object which we pass to InternalParameters.
14835
14836 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14837
14838         * expression.cs (NewArray): Merge into the ArrayCreation class.
14839
14840 2001-10-29  Ravi Pratap  <ravi@ximian.com>
14841
14842         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
14843         NewUserdefinedArray into one as there wasn't much of a use in having
14844         two separate ones.
14845
14846         * expression.cs (Argument): Change field's name to ArgType from Type.
14847
14848         (Type): New readonly property which returns the proper type, taking into 
14849         account ref/out modifiers.
14850
14851         (everywhere): Adjust code accordingly for the above.
14852
14853         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
14854         whether we are emitting for a ref or out parameter.
14855
14856         * expression.cs (Argument::Emit): Use the above field to set the state.
14857
14858         (LocalVariableReference::Emit): Update to honour the flag and emit the
14859         right stuff.
14860
14861         * parameter.cs (Attributes): Set the correct flags for ref parameters.
14862
14863         * expression.cs (Argument::FullDesc): New function to provide a full desc.
14864
14865         * support.cs (ParameterData): Add method ParameterDesc to the interface.
14866
14867         (ReflectionParameters, InternalParameters): Implement the above method.
14868
14869         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
14870         reporting errors.
14871
14872         (Invocation::FullMethodDesc): Ditto. 
14873
14874 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
14875
14876         * cs-parser.jay: Add extra production for the second form of array
14877         creation. 
14878
14879         * expression.cs (ArrayCreation): Update to reflect the above
14880         change. 
14881
14882         * Small changes to prepare for Array initialization.
14883
14884 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
14885
14886         * typemanager.cs (ImplementsInterface): interface might be null;
14887         Deal with this problem;
14888
14889         Also, we do store negative hits on the cache (null values), so use
14890         this instead of calling t.GetInterfaces on the type everytime.
14891
14892 2001-10-28  Ravi Pratap  <ravi@ximian.com>
14893
14894         * typemanager.cs (IsBuiltinType): New method to help determine the same.
14895
14896         * expression.cs (New::DoResolve): Get rid of array creation code and instead
14897         split functionality out into different classes.
14898
14899         (New::FormArrayType): Move into NewBuiltinArray.
14900
14901         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
14902         quite useless.
14903
14904         (NewBuiltinArray): New class to handle creation of built-in arrays.
14905
14906         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
14907         account creation of one-dimensional arrays.
14908
14909         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
14910
14911         (NewUserdefinedArray::DoResolve): Implement.
14912
14913         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
14914
14915         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
14916         we maintain inside the TypeManager. This is necessary to perform lookups on the
14917         module builder.
14918
14919         (LookupType): Update to perform GetType on the module builders too.     
14920
14921         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
14922
14923         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
14924
14925 2001-10-23  Ravi Pratap  <ravi@ximian.com>
14926
14927         * expression.cs (New::DoResolve): Implement guts of array creation.
14928
14929         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
14930
14931 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * expression.cs: Fix bug I introduced lsat night that broke
14934         Delegates. 
14935
14936         (Expression.Resolve): Report a 246 error (can not resolve name)
14937         if we find a SimpleName in the stream.
14938
14939         (Expression.ResolveLValue): Ditto.
14940
14941         (Expression.ResolveWithSimpleName): This function is a variant of
14942         ResolveName, this one allows SimpleNames to be returned without a
14943         warning.  The only consumer of SimpleNames is MemberAccess
14944
14945 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
14948         might arrive here.  I have my doubts that this is correct.
14949
14950         * statement.cs (Lock): Implement lock statement.
14951
14952         * cs-parser.jay: Small fixes to support `lock' and `using'
14953
14954         * cs-tokenizer.cs: Remove extra space
14955
14956         * driver.cs: New flag --checked, allows to turn on integer math
14957         checking. 
14958
14959         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
14960         Threading.Monitor.Exit 
14961
14962 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
14963
14964         * expression.cs (IndexerAccess::DoResolveLValue): Set the
14965         Expression Class to be IndexerAccess.
14966
14967         Notice that Indexer::DoResolve sets the eclass to Value.
14968
14969 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
14970
14971         * class.cs (TypeContainer::Emit): Emit code for indexers.
14972
14973         * assign.cs (IAssignMethod): New interface implemented by Indexers
14974         and Properties for handling assignment.
14975
14976         (Assign::Emit): Simplify and reuse code. 
14977
14978         * expression.cs (IndexerAccess, PropertyExpr): Implement
14979         IAssignMethod, clean up old code. 
14980
14981 2001-10-22  Ravi Pratap  <ravi@ximian.com>
14982
14983         * typemanager.cs (ImplementsInterface): New method to determine if a type
14984         implements a given interface. Provides a nice cache too.
14985
14986         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
14987         method.
14988
14989         (ConvertReferenceExplicit): Ditto.
14990
14991         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
14992         various methods, with correct names etc.
14993
14994         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
14995         Operator.UnaryNegation.
14996
14997         * cs-parser.jay (operator_declarator): Be a little clever in the case where
14998         we have a unary plus or minus operator.
14999
15000         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
15001         UnaryMinus.
15002
15003         * everywhere : update accordingly.
15004
15005         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
15006         respectively.
15007
15008         * class.cs (Method::Define): For the case where we are implementing a method
15009         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
15010         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
15011
15012 2001-10-21  Ravi Pratap  <ravi@ximian.com>
15013
15014         * interface.cs (FindMembers): Implement to work around S.R.E
15015         lameness.
15016
15017         * typemanager.cs (IsInterfaceType): Implement.
15018
15019         (FindMembers): Update to handle interface types too.
15020
15021         * expression.cs (ImplicitReferenceConversion): Re-write bits which
15022         use IsAssignableFrom as that is not correct - it doesn't work.
15023
15024         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
15025         and accordingly override EmitStatement.
15026
15027         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
15028         using the correct logic :-)
15029
15030 2001-10-19  Ravi Pratap  <ravi@ximian.com>
15031
15032         * ../errors/cs-11.cs : Add to demonstrate error -11 
15033
15034 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
15035
15036         * assign.cs (Assign::Resolve): Resolve right hand side first, and
15037         then pass this as a hint to ResolveLValue.
15038
15039         * expression.cs (FieldExpr): Add Location information
15040
15041         (FieldExpr::LValueResolve): Report assignment to readonly
15042         variable. 
15043
15044         (Expression::ExprClassFromMemberInfo): Pass location information.
15045
15046         (Expression::ResolveLValue): Add new method that resolves an
15047         LValue. 
15048
15049         (Expression::DoResolveLValue): Default invocation calls
15050         DoResolve. 
15051
15052         (Indexers): New class used to keep track of indexers in a given
15053         Type. 
15054
15055         (IStackStore): Renamed from LValue, as it did not really describe
15056         what this did.  Also ResolveLValue is gone from this interface and
15057         now is part of Expression.
15058
15059         (ElementAccess): Depending on the element access type
15060
15061         * typemanager.cs: Add `indexer_name_type' as a Core type
15062         (System.Runtime.CompilerServices.IndexerNameAttribute)
15063
15064         * statement.cs (Goto): Take a location.
15065
15066 2001-10-18  Ravi Pratap  <ravi@ximian.com>
15067
15068         * delegate.cs (Delegate::VerifyDelegate): New method to verify
15069         if two delegates are compatible.
15070
15071         (NewDelegate::DoResolve): Update to take care of the case when
15072         we instantiate a delegate from another delegate.
15073
15074         * typemanager.cs (FindMembers): Don't even try to look up members
15075         of Delegate types for now.
15076
15077 2001-10-18  Ravi Pratap  <ravi@ximian.com>
15078
15079         * delegate.cs (NewDelegate): New class to take care of delegate
15080         instantiation.
15081
15082         * expression.cs (New): Split the delegate related code out into 
15083         the NewDelegate class.
15084
15085         * delegate.cs (DelegateInvocation): New class to handle delegate 
15086         invocation.
15087
15088         * expression.cs (Invocation): Split out delegate related code into
15089         the DelegateInvocation class.
15090
15091 2001-10-17  Ravi Pratap  <ravi@ximian.com>
15092
15093         * expression.cs (New::DoResolve): Implement delegate creation fully
15094         and according to the spec.
15095
15096         (New::DoEmit): Update to handle delegates differently.
15097
15098         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
15099         because of which we were printing out arguments in reverse order !
15100
15101         * delegate.cs (VerifyMethod): Implement to check if the given method
15102         matches the delegate.
15103
15104         (FullDelegateDesc): Implement.
15105
15106         (VerifyApplicability): Implement.
15107
15108         * expression.cs (Invocation::DoResolve): Update to accordingly handle
15109         delegate invocations too.
15110
15111         (Invocation::Emit): Ditto.
15112
15113         * ../errors/cs1593.cs : Added.
15114
15115         * ../errors/cs1594.cs : Added.
15116
15117         * delegate.cs (InstanceExpression, TargetMethod): New properties.
15118
15119 2001-10-16  Ravi Pratap  <ravi@ximian.com>
15120
15121         * typemanager.cs (intptr_type): Core type for System.IntPtr
15122
15123         (InitCoreTypes): Update for the same.
15124
15125         (iasyncresult_type, asynccallback_type): Ditto.
15126
15127         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
15128         correct.
15129
15130         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
15131         too.
15132
15133         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
15134         the builders for the 4 members of a delegate type :-)
15135
15136         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
15137         type.
15138
15139         * expression.cs (New::DoResolve): Implement guts for delegate creation.
15140
15141         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
15142
15143 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
15144
15145         * statement.cs (Break::Emit): Implement.   
15146         (Continue::Emit): Implement.
15147
15148         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
15149         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
15150         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
15151         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
15152         end loop
15153
15154         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
15155         properties that track the label for the current loop (begin of the
15156         loop and end of the loop).
15157
15158 2001-10-15  Ravi Pratap  <ravi@ximian.com>
15159
15160         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
15161         use of emitting anything at all.
15162
15163         * class.cs, rootcontext.cs : Get rid of calls to the same.
15164
15165         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
15166
15167         (Populate): Define the constructor correctly and set the implementation
15168         attributes.
15169
15170         * typemanager.cs (delegate_types): New hashtable to hold delegates that
15171         have been defined.
15172
15173         (AddDelegateType): Implement.
15174
15175         (IsDelegateType): Implement helper method.
15176
15177         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
15178
15179         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
15180         and accordingly handle it.
15181
15182         * delegate.cs (Populate): Take TypeContainer argument.
15183         Implement bits to define the Invoke method. However, I still haven't figured out
15184         how to take care of the native int bit :-(
15185
15186         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
15187         Qualify the name of the delegate, not its return type !
15188
15189         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
15190         conversion.
15191
15192         (StandardConversionExists): Checking for array types turns out to be recursive.
15193
15194         (ConvertReferenceExplicit): Implement array conversion.
15195
15196         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
15197
15198 2001-10-12  Ravi Pratap  <ravi@ximian.com>
15199
15200         * cs-parser.jay (delegate_declaration): Store the fully qualified
15201         name as it is a type declaration.
15202
15203         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
15204         readonly.
15205
15206         (DefineDelegate): Renamed from Define. Does the same thing essentially,
15207         as TypeContainer::DefineType.
15208
15209         (Populate): Method in which all the definition of the various methods (Invoke)
15210         etc is done.
15211
15212         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
15213         see.
15214
15215         (CloseDelegate): Finally creates the delegate.
15216
15217         * class.cs (TypeContainer::DefineType): Update to define delegates.
15218         (Populate, Emit and CloseType): Do the same thing here too.
15219
15220         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
15221         delegates in all these operations.
15222
15223 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
15224
15225         * expression.cs: LocalTemporary: a new expression used to
15226         reference a temporary that has been created.
15227
15228         * assign.cs: Handle PropertyAccess back here, so that we can
15229         provide the proper semantic access to properties.
15230
15231         * expression.cs (Expression::ConvertReferenceExplicit): Implement
15232         a few more explicit conversions. 
15233
15234         * modifiers.cs: `NEW' modifier maps to HideBySig.
15235
15236         * expression.cs (PropertyExpr): Make this into an
15237         ExpressionStatement, and support the EmitStatement code path. 
15238
15239         Perform get/set error checking, clean up the interface.
15240
15241         * assign.cs: recognize PropertyExprs as targets, and if so, turn
15242         them into toplevel access objects.
15243
15244 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
15245
15246         * expression.cs: PropertyExpr::PropertyExpr: use work around the
15247         SRE.
15248
15249         * typemanager.cs: Keep track here of our PropertyBuilders again to
15250         work around lameness in SRE.
15251
15252 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
15253
15254         * expression.cs (LValue::LValueResolve): New method in the
15255         interface, used to perform a second resolution pass for LValues. 
15256
15257         (This::DoResolve): Catch the use of this in static methods.
15258
15259         (This::LValueResolve): Implement.
15260
15261         (This::Store): Remove warning, assigning to `this' in structures
15262         is 
15263
15264         (Invocation::Emit): Deal with invocation of
15265         methods on value types.  We need to pass the address to structure
15266         methods rather than the object itself.  (The equivalent code to
15267         emit "this" for structures leaves the entire structure on the
15268         stack instead of a pointer to it). 
15269
15270         (ParameterReference::DoResolve): Compute the real index for the
15271         argument based on whether the method takes or not a `this' pointer
15272         (ie, the method is static).
15273
15274         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
15275         value types returned from functions when we need to invoke a
15276         method on the sturcture.
15277
15278
15279 2001-10-11  Ravi Pratap  <ravi@ximian.com>
15280
15281         * class.cs (TypeContainer::DefineType): Method to actually do the business of
15282         defining the type in the Modulebuilder or Typebuilder. This is to take
15283         care of nested types which need to be defined on the TypeBuilder using
15284         DefineNestedMethod.
15285
15286         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
15287         methods in RootContext, only ported to be part of TypeContainer.
15288
15289         (TypeContainer::GetInterfaceOrClass): Ditto.
15290
15291         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
15292
15293         * interface.cs (Interface::DefineInterface): New method. Does exactly
15294         what RootContext.CreateInterface did earlier, only it takes care of nested types 
15295         too.
15296
15297         (Interface::GetInterfaces): Move from RootContext here and port.
15298
15299         (Interface::GetInterfaceByName): Same here.
15300
15301         * rootcontext.cs (ResolveTree): Re-write.
15302
15303         (PopulateTypes): Re-write.
15304
15305         * class.cs (TypeContainer::Populate): Populate nested types too.
15306         (TypeContainer::Emit): Emit nested members too.
15307
15308         * typemanager.cs (AddUserType): Do not make use of the FullName property,
15309         instead just use the name argument passed in as it is already fully
15310         qualified.
15311
15312         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
15313         to TypeContainer mapping to see if a type is user-defined.
15314
15315         * class.cs (TypeContainer::CloseType): Implement. 
15316
15317         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
15318         the default constructor.
15319
15320         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
15321         twice.
15322
15323         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
15324
15325         * interface.cs (CloseType): Create the type here.
15326
15327         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
15328         the hierarchy.
15329
15330         Remove all the methods which are now in TypeContainer.
15331
15332 2001-10-10  Ravi Pratap  <ravi@ximian.com>
15333
15334         * delegate.cs (Define): Re-write bits to define the delegate
15335         correctly.
15336
15337 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
15340
15341         * expression.cs (ImplicitReferenceConversion): handle null as well
15342         as a source to convert to any reference type.
15343
15344         * statement.cs (Return): Perform any implicit conversions to
15345         expected return type.  
15346
15347         Validate use of return statement.  
15348
15349         * codegen.cs (EmitContext): Pass the expected return type here.
15350
15351         * class.cs (Method, Constructor, Property): Pass expected return
15352         type to EmitContext.
15353
15354 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
15355
15356         * expression.cs: Make DoResolve take an EmitContext instead of a
15357         TypeContainer.
15358
15359         Replaced `l' and `location' for `loc', for consistency.
15360
15361         (Error, Warning): Remove unneeded Tc argument.
15362
15363         * assign.cs, literal.cs, constant.cs: Update to new calling
15364         convention. 
15365
15366         * codegen.cs: EmitContext now contains a flag indicating whether
15367         code is being generated in a static method or not.
15368
15369         * cs-parser.jay: DecomposeQI, new function that replaces the old
15370         QualifiedIdentifier.  Now we always decompose the assembled
15371         strings from qualified_identifier productions into a group of
15372         memberaccesses.
15373
15374 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * rootcontext.cs: Deal with field-less struct types correctly now
15377         by passing the size option to Define Type.
15378
15379         * class.cs: Removed hack that created one static field. 
15380
15381 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * statement.cs: Moved most of the code generation here. 
15384
15385 2001-10-09  Ravi Pratap  <ravi@ximian.com>
15386
15387         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
15388         seem very right.
15389
15390         (ElementAccess): Remove useless bits for now - keep checks as the spec
15391         says.
15392
15393 2001-10-08  Ravi Pratap  <ravi@ximian.com>
15394
15395         * expression.cs (ElementAccess::DoResolve): Remove my crap code
15396         and start performing checks according to the spec.
15397
15398 2001-10-07  Ravi Pratap  <ravi@ximian.com>
15399
15400         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
15401         rank_specifiers instead.
15402
15403         (rank_specifiers): Change the order in which the rank specifiers are stored
15404
15405         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
15406
15407         * expression.cs (ElementAccess): Implement the LValue interface too.
15408
15409 2001-10-06  Ravi Pratap  <ravi@ximian.com>
15410
15411         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
15412         except that user defined conversions are not included.
15413
15414         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
15415         perform the conversion of the return type, if necessary.
15416
15417         (New::DoResolve): Check whether we are creating an array or an object
15418         and accordingly do the needful.
15419
15420         (New::Emit): Same here.
15421
15422         (New::DoResolve): Implement guts of array creation.
15423
15424         (New::FormLookupType): Helper function.
15425
15426 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
15427
15428         * codegen.cs: Removed most of the code generation here, and move the
15429         corresponding code generation bits to the statement classes. 
15430
15431         Added support for try/catch/finalize and throw.
15432
15433         * cs-parser.jay: Added support for try/catch/finalize.
15434
15435         * class.cs: Catch static methods having the flags override,
15436         virtual or abstract.
15437
15438         * expression.cs (UserCast): This user cast was not really doing
15439         what it was supposed to do.  Which is to be born in fully resolved
15440         state.  Parts of the resolution were being performed at Emit time! 
15441
15442         Fixed this code.
15443
15444 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * expression.cs: Implicity convert the result from UserCast.
15447
15448 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15449
15450         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
15451         prevented it from working correctly. 
15452
15453         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
15454         merely ConvertImplicit.
15455
15456 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
15457
15458         * typemanager.cs: Make the LookupTypeContainer function static,
15459         and not per-instance.  
15460
15461         * class.cs: Make static FindMembers (the one that takes a Type
15462         argument). 
15463
15464         * codegen.cs: Add EmitForeach here.
15465
15466         * cs-parser.jay: Make foreach a toplevel object instead of the
15467         inline expansion, as we need to perform semantic analysis on it. 
15468
15469 2001-10-05  Ravi Pratap  <ravi@ximian.com>
15470
15471         * expression.cs (Expression::ImplicitUserConversion): Rename to
15472         UserDefinedConversion.
15473
15474         (Expression::UserDefinedConversion): Take an extra argument specifying 
15475         whether we look for explicit user conversions too.
15476
15477         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
15478
15479         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
15480
15481         (ExplicitUserConversion): Make it a call to UserDefinedConversion
15482         with the appropriate arguments.
15483
15484         * cs-parser.jay (cast_expression): Record location too.
15485
15486         * expression.cs (Cast): Record location info.
15487
15488         (Expression::ConvertExplicit): Take location argument.
15489
15490         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
15491         to determine if we are doing explicit conversions.
15492
15493         (UserCast::Emit): Update accordingly.
15494
15495         (Expression::ConvertExplicit): Report an error if everything fails.
15496
15497         * ../errors/cs0030.cs : Add.
15498
15499 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * modifiers.cs: If the ABSTRACT keyword is present, also set the
15502         virtual and newslot bits. 
15503
15504         * class.cs (TypeContainer::RegisterRequiredImplementations):
15505         Record methods we need.
15506
15507         (TypeContainer::MakeKey): Helper function to make keys for
15508         MethodBases, since the Methodbase key is useless.
15509
15510         (TypeContainer::Populate): Call RegisterRequiredImplementations
15511         before defining the methods.   
15512
15513         Create a mapping for method_builders_to_methods ahead of time
15514         instead of inside a tight loop.
15515
15516         (::RequireMethods):  Accept an object as the data to set into the
15517         hashtable so we can report interface vs abstract method mismatch.
15518
15519 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15520
15521         * report.cs: Make all of it static.
15522
15523         * rootcontext.cs: Drop object_type and value_type computations, as
15524         we have those in the TypeManager anyways.
15525
15526         Drop report instance variable too, now it is a global.
15527
15528         * driver.cs: Use try/catch on command line handling.
15529
15530         Add --probe option to debug the error reporting system with a test
15531         suite. 
15532
15533         * report.cs: Add support for exiting program when a probe
15534         condition is reached.
15535
15536 2001-10-03  Ravi Pratap  <ravi@ximian.com>
15537
15538         * expression.cs (Binary::DoNumericPromotions): Fix the case when
15539         we do a forcible conversion regardless of type, to check if 
15540         ForceConversion returns a null.
15541
15542         (Binary::error19): Use location to report error.
15543
15544         (Unary::error23): Use location here too.
15545
15546         * ../errors/cs0019.cs : Check in.
15547
15548         * ../errors/cs0023.cs : Check in.
15549
15550         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
15551         case of a non-null MethodInfo object with a length of 0 !
15552
15553         (Binary::ResolveOperator): Flag error if overload resolution fails to find
15554         an applicable member - according to the spec :-)
15555         Also fix logic to find members in base types.
15556
15557         (Unary::ResolveOperator): Same here.
15558
15559         (Unary::report23): Change name to error23 and make first argument a TypeContainer
15560         as I was getting thoroughly confused between this and error19 :-)
15561
15562         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
15563         (::FindMostEncompassedType): Implement.
15564         (::FindMostEncompassingType): Implement.
15565         (::StandardConversionExists): Implement.
15566
15567         (UserImplicitCast): Re-vamp. We now need info about most specific
15568         source and target types so that we can do the necessary conversions.
15569
15570         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
15571         mathematical union with no duplicates.
15572
15573 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
15574
15575         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
15576         in order from base classes to child classes, so that we can in
15577         child classes look up in our parent for method names and
15578         attributes (required for handling abstract, virtual, new, override
15579         constructs: we need to instrospect our base class, and if we dont
15580         populate the classes in order, the introspection might be
15581         incorrect.  For example, a method could query its parent before
15582         the parent has any methods and would determine that the parent has
15583         no abstract methods (while it could have had them)).
15584
15585         (RootContext::CreateType): Record the order in which we define the
15586         classes.
15587
15588 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
15589
15590         * class.cs (TypeContainer::Populate): Also method definitions can
15591         fail now, keep track of this.
15592
15593         (TypeContainer::FindMembers): Implement support for
15594         DeclaredOnly/noDeclaredOnly flag.
15595
15596         (Constructor::Emit) Return the ConstructorBuilder.
15597
15598         (Method::Emit) Return the MethodBuilder. 
15599         Check for abstract or virtual methods to be public.
15600
15601         * rootcontext.cs (RootContext::CreateType): Register all the
15602         abstract methods required for the class to be complete and the
15603         interface methods that must be implemented. 
15604
15605         * cs-parser.jay: Report error 501 (method requires body if it is
15606         not marked abstract or extern).
15607
15608         * expression.cs (TypeOf::Emit): Implement.
15609
15610         * typemanager.cs: runtime_handle_type, new global type.
15611
15612         * class.cs (Property::Emit): Generate code for properties.
15613
15614 2001-10-02  Ravi Pratap  <ravi@ximian.com>
15615
15616         * expression.cs (Unary::ResolveOperator): Find operators on base type
15617         too - we now conform exactly to the spec.
15618
15619         (Binary::ResolveOperator): Same here.
15620
15621         * class.cs (Operator::Define): Fix minor quirk in the tests.
15622
15623         * ../errors/cs0215.cs : Added.
15624
15625         * ../errors/cs0556.cs : Added.
15626
15627         * ../errors/cs0555.cs : Added.
15628
15629 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15630
15631         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
15632         single integer which is really efficient
15633
15634 2001-10-01  Ravi Pratap  <ravi@ximian.com>
15635
15636         *  expression.cs (Expression::ImplicitUserConversion): Use location
15637         even in the case when we are examining True operators.
15638  
15639         * class.cs (Operator::Define): Perform extensive checks to conform
15640         with the rules for operator overloading in the spec.
15641
15642         * expression.cs (Expression::ImplicitReferenceConversion): Implement
15643         some of the other conversions mentioned in the spec.
15644
15645         * typemanager.cs (array_type): New static member for the System.Array built-in
15646         type.
15647
15648         (cloneable_interface): For System.ICloneable interface.
15649
15650         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
15651         we start resolving the tree and populating types.
15652
15653         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
15654  
15655 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
15656
15657         * expression.cs (Expression::ExprClassFromMemberInfo,
15658         Expression::Literalize): Create literal expressions from
15659         FieldInfos which are literals.
15660
15661         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
15662         type casts, because they were wrong.  The test suite in tests
15663         caught these ones.
15664
15665         (ImplicitNumericConversion): ushort to ulong requires a widening
15666         cast. 
15667
15668         Int32 constant to long requires widening cast as well.
15669
15670         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
15671         for integers because the type on the stack is not i4.
15672
15673 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
15674
15675         * expression.cs (report118): require location argument. 
15676
15677         * parameter.cs: Do not dereference potential null value.
15678
15679         * class.cs: Catch methods that lack the `new' keyword when
15680         overriding a name.  Report warnings when `new' is used without
15681         anything being there to override.
15682
15683         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
15684
15685         * class.cs: Only add constructor to hashtable if it is non-null
15686         (as now constructors can fail on define).
15687
15688         (TypeManager, Class, Struct): Take location arguments.
15689
15690         Catch field instance initialization in structs as errors.
15691
15692         accepting_filter: a new filter for FindMembers that is static so
15693         that we dont create an instance per invocation.
15694
15695         (Constructor::Define): Catch errors where a struct constructor is
15696         parameterless 
15697
15698         * cs-parser.jay: Pass location information for various new
15699         constructs. 
15700
15701         * delegate.cs (Delegate): take a location argument.
15702
15703         * driver.cs: Do not call EmitCode if there were problesm in the
15704         Definition of the types, as many Builders wont be there. 
15705
15706         * decl.cs (Decl::Decl): Require a location argument.
15707
15708         * cs-tokenizer.cs: Handle properly hex constants that can not fit
15709         into integers, and find the most appropiate integer for it.
15710
15711         * literal.cs: Implement ULongLiteral.
15712
15713         * rootcontext.cs: Provide better information about the location of
15714         failure when CreateType fails.
15715
15716 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
15719         as well.
15720
15721         * expression.cs (Binary::CheckShiftArguments): Add missing type
15722         computation.
15723         (Binary::ResolveOperator): Add type to the logical and and logical
15724         or, Bitwise And/Or and Exclusive Or code paths, it was missing
15725         before.
15726
15727         (Binary::DoNumericPromotions): In the case where either argument
15728         is ulong (and most signed types combined with ulong cause an
15729         error) perform implicit integer constant conversions as well.
15730
15731 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15732
15733         * expression.cs (UserImplicitCast): Method should always be
15734         non-null. 
15735         (Invocation::BetterConversion): Simplified test for IntLiteral.
15736
15737         (Expression::ImplicitNumericConversion): Split this routine out.
15738         Put the code that performs implicit constant integer conversions
15739         here. 
15740
15741         (Expression::Resolve): Become a wrapper around DoResolve so we can
15742         check eclass and type being set after resolve.
15743
15744         (Invocation::Badness): Remove this dead function
15745
15746         (Binary::ResolveOperator): Do not compute the expensive argumnets
15747         unless we have a union for it.
15748
15749         (Probe::Emit): Is needs to do an isinst and then
15750         compare against null.
15751
15752         (::CanConvert): Added Location argument.  If the Location argument
15753         is null (Location.Null), then we do not report errors.  This is
15754         used by the `probe' mechanism of the Explicit conversion.  We do
15755         not want to generate an error for something that the user
15756         explicitly requested to be casted.  But the pipeline for an
15757         explicit cast first tests for potential implicit casts.
15758
15759         So for now, if the Location is null, it means `Probe only' to
15760         avoid adding another argument.   Might have to revise this
15761         strategy later.
15762
15763         (ClassCast): New class used to type cast objects into arbitrary
15764         classes (used in Explicit Reference Conversions).
15765
15766         Implement `as' as well.
15767
15768         Reverted all the patches from Ravi below: they were broken:
15769
15770                 * The use of `level' as a mechanism to stop recursive
15771                   invocations is wrong.  That was there just to catch the
15772                   bug with a strack trace but not as a way of addressing
15773                   the problem.
15774
15775                   To fix the problem we have to *understand* what is going
15776                   on and the interactions and come up with a plan, not
15777                   just get things going.
15778
15779                 * The use of the type conversion cache that I proposed
15780                   last night had an open topic: How does this work across
15781                   protection domains.  A user defined conversion might not
15782                   be public in the location where we are applying the
15783                   conversion, a different conversion might be selected
15784                   (ie, private A->B (better) but public B->A (worse),
15785                   inside A, A->B applies, but outside it, B->A will
15786                   apply).
15787
15788                 * On top of that (ie, even if the above is solved),
15789                   conversions in a cache need to be abstract.  Ie, `To
15790                   convert from an Int to a Short use an OpcodeCast', not
15791                   `To convert from an Int to a Short use the OpcodeCast on
15792                   the variable 5' (which is what this patch was doing).
15793
15794 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15795
15796         * expression.cs (Invocation::ConversionExists): Re-write to use
15797         the conversion cache
15798
15799         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
15800         cache all conversions done, not just user-defined ones.
15801
15802         (Invocation::BetterConversion): The real culprit. Use ConversionExists
15803         to determine if a conversion exists instead of acutually trying to 
15804         perform the conversion. It's faster too.
15805
15806         (Expression::ConvertExplicit): Modify to use ConversionExists to check
15807         and only then attempt the implicit conversion.
15808
15809 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15810
15811         * expression.cs (ConvertImplicit): Use a cache for conversions
15812         already found. Check level of recursion and bail out if necessary.
15813
15814 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15815
15816         * typemanager.cs (string_concat_string_string, string_concat_object_object):
15817         Export standard methods that we expect for string operations.
15818
15819         * statement.cs (Block::UsageWarning): Track usage of variables and
15820         report the errors for not used variables.
15821
15822         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
15823         operator. 
15824
15825 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * codegen.cs: remove unnneded code 
15828
15829         * expression.cs: Removed BuiltinTypeAccess class
15830
15831         Fix the order in which implicit conversions are
15832         done.  
15833
15834         The previous fixed dropped support for boxed conversions (adding a
15835         test to the test suite now)
15836
15837         (UserImplicitCast::CanConvert): Remove test for source being null,
15838         that code is broken.  We should not feed a null to begin with, if
15839         we do, then we should track the bug where the problem originates
15840         and not try to cover it up here.
15841
15842         Return a resolved expression of type UserImplicitCast on success
15843         rather than true/false.  Ravi: this is what I was talking about,
15844         the pattern is to use a static method as a "constructor" for
15845         objects. 
15846
15847         Also, do not create arguments until the very last minute,
15848         otherwise we always create the arguments even for lookups that
15849         will never be performed. 
15850
15851         (UserImplicitCast::Resolve): Eliminate, objects of type
15852         UserImplicitCast are born in a fully resolved state. 
15853
15854         * typemanager.cs (InitCoreTypes): Init also value_type
15855         (System.ValueType). 
15856
15857         * expression.cs (Cast::Resolve): First resolve the child expression.
15858
15859         (LValue): Add new method AddressOf to be used by
15860         the `&' operator.  
15861
15862         Change the argument of Store to take an EmitContext instead of an
15863         ILGenerator, because things like FieldExpr need to be able to call
15864         their children expression to generate the instance code. 
15865
15866         (Expression::Error, Expression::Warning): Sugar functions for
15867         reporting errors.
15868
15869         (Expression::MemberLookup): Accept a TypeContainer instead of a
15870         Report as the first argument.
15871
15872         (Expression::ResolvePrimary): Killed.  I still want to improve
15873         this as currently the code is just not right.
15874
15875         (Expression::ResolveMemberAccess): Simplify, but it is still
15876         wrong. 
15877
15878         (Unary::Resolve): Catch errors in AddressOf operators.
15879
15880         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
15881         index to a byte for the short-version, or the compiler will choose
15882         the wrong Emit call, which generates the wrong data.
15883
15884         (ParameterReference::Emit, ::Store): same.
15885
15886         (FieldExpr::AddressOf): Implement.
15887
15888         * typemanager.cs: TypeManager: made public variable instead of
15889         property.
15890
15891         * driver.cs: document --fatal.
15892
15893         * report.cs (ErrorMessage, WarningMessage): new names for the old
15894         Error and Warning classes.
15895
15896         * cs-parser.jay (member_access): Turn built-in access to types
15897         into a normal simplename
15898
15899 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15900
15901         * expression.cs (Invocation::BetterConversion): Fix to cope
15902         with q being null, since this was introducing a bug.
15903
15904         * expression.cs (ConvertImplicit): Do built-in conversions first.
15905
15906 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15907
15908         * expression.cs (UserImplicitCast::Resolve): Fix bug.
15909
15910 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15911
15912         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
15913         I had introduced long ago (what's new ?).
15914
15915         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
15916         the work of all the checking. 
15917         (ConvertImplicit): Call CanConvert and only then create object if necessary.
15918         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
15919
15920         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
15921         that is the right way. 
15922
15923         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
15924         overloading resolution. Use everywhere instead of cutting and pasting code.
15925
15926         (Binary::ResolveOperator): Use MakeUnionSet.
15927
15928         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
15929         we have to convert to bool types. Not complete yet.
15930
15931 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * typemanager.cs (TypeManager::CSharpName): support ushort.
15934
15935         * expression.cs (Expression::TryImplicitIntConversion): Attempts
15936         to provide an expression that performsn an implicit constant int
15937         conversion (section 6.1.6).
15938         (Expression::ConvertImplicitRequired): Reworked to include
15939         implicit constant expression conversions.
15940
15941         (Expression::ConvertNumericExplicit): Finished.
15942
15943         (Invocation::Emit): If InstanceExpression is null, then it means
15944         that we perform a call on this.
15945
15946 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15947
15948         * expression.cs (Unary::Emit): Remove some dead code.
15949         (Probe): Implement Resolve and Emit for `is'.
15950         (Expression::ConvertImplicitRequired): Attempt to do constant
15951         expression conversions here.  Maybe should be moved to
15952         ConvertImplicit, but I am not sure.
15953         (Expression::ImplicitLongConstantConversionPossible,
15954         Expression::ImplicitIntConstantConversionPossible): New functions
15955         that tell whether is it possible to apply an implicit constant
15956         expression conversion.
15957
15958         (ConvertNumericExplicit): Started work on explicit numeric
15959         conversions.
15960
15961         * cs-parser.jay: Update operator constants.
15962
15963         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
15964         (Parameters::GetSignature): Hook up VerifyArgs here.
15965         (Parameters::VerifyArgs): Verifies that no two arguments have the
15966         same name. 
15967
15968         * class.cs (Operator): Update the operator names to reflect the
15969         ones that the spec expects (as we are just stringizing the
15970         operator names).
15971
15972         * expression.cs (Unary::ResolveOperator): Fix bug: Use
15973         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
15974         previous usage did only work for our methods.
15975         (Expression::ConvertImplicit): Handle decimal implicit numeric
15976         conversions as well.
15977         (Expression::InternalTypeConstructor): Used to invoke constructors
15978         on internal types for default promotions.
15979
15980         (Unary::Emit): Implement special handling for the pre/post
15981         increment/decrement for overloaded operators, as they need to have
15982         the same semantics as the other operators.
15983
15984         (Binary::ResolveOperator): ditto.
15985         (Invocation::ConversionExists): ditto.
15986         (UserImplicitCast::Resolve): ditto.
15987
15988 2001-09-26  Ravi Pratap  <ravi@ximian.com>
15989
15990         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
15991         operator, return after emitting body. Regression tests pass again !
15992
15993         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
15994         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
15995         (Invocation::OverloadResolve): Ditto.
15996         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
15997
15998         * everywhere : update calls to the above methods accordingly.
15999
16000 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * assign.cs (Assign): Make it inherit from ExpressionStatement.
16003
16004         * expression.cs (ExpressionStatement): New base class used for
16005         expressions that can appear in statements, so that we can provide
16006         an alternate path to generate expression that do not leave a value
16007         on the stack.
16008
16009         (Expression::Emit, and all the derivatives): We no longer return
16010         whether a value is left on the stack or not.  Every expression
16011         after being emitted leaves a single value on the stack.
16012
16013         * codegen.cs (EmitContext::EmitStatementExpression): Use the
16014         facilties of ExpressionStatement if possible.
16015
16016         * cs-parser.jay: Update statement_expression.
16017
16018 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
16019
16020         * driver.cs: Change the wording of message
16021
16022 2001-09-25  Ravi Pratap  <ravi@ximian.com>
16023
16024         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
16025         the type of the expression to the return type of the method if
16026         we have an overloaded operator match ! The regression tests pass again !
16027         (Unary::ResolveOperator): Ditto.
16028
16029         * expression.cs (Invocation::ConversionExists): Correct the member lookup
16030         to find "op_Implicit", not "implicit" ;-)
16031         (UserImplicitCast): New class to take care of user-defined implicit conversions.
16032         (ConvertImplicit, ForceConversion): Take TypeContainer argument
16033
16034         * everywhere : Correct calls to the above accordingly.
16035
16036         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
16037         (ConvertImplicit): Do user-defined conversion if it exists.
16038
16039 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * assign.cs: track location.
16042         (Resolve): Use implicit conversions on assignment.
16043
16044         * literal.cs: Oops.  Not good, Emit of short access values should
16045         pass (Bytes) or the wrong argument will be selected.
16046
16047         * expression.cs (Unary::Emit): Emit code for -expr.
16048
16049         (Unary::ResolveOperator): Handle `Substract' for non-constants
16050         (substract from zero from the non-constants).
16051         Deal with Doubles as well. 
16052
16053         (Expression::ConvertImplicitRequired): New routine that reports an
16054         error if no implicit conversion exists. 
16055
16056         (Invocation::OverloadResolve): Store the converted implicit
16057         expressions if we make them
16058
16059 2001-09-24  Ravi Pratap  <ravi@ximian.com>
16060
16061         * class.cs (ConstructorInitializer): Take a Location argument.
16062         (ConstructorBaseInitializer): Same here.
16063         (ConstructorThisInitializer): Same here.
16064
16065         * cs-parser.jay : Update all calls accordingly.
16066
16067         * expression.cs (Unary, Binary, New): Take location argument.
16068         Update accordingly everywhere.
16069
16070         * cs-parser.jay : Update all calls to the above to take a location
16071         argument.
16072
16073         * class.cs : Ditto.
16074
16075 2001-09-24  Ravi Pratap  <ravi@ximian.com>
16076
16077         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
16078         (Invocation::BetterConversion): Same here
16079         (Invocation::ConversionExists): Ditto.
16080
16081         (Invocation::ConversionExists): Implement.
16082
16083 2001-09-22  Ravi Pratap  <ravi@ximian.com>
16084
16085         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
16086         Also take an additional TypeContainer argument.
16087
16088         * All over : Pass in TypeContainer as argument to OverloadResolve.
16089
16090         * typemanager.cs (CSharpName): Update to check for the string type and return
16091         that too.
16092
16093         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
16094         a given method.
16095
16096 2001-09-21  Ravi Pratap  <ravi@ximian.com>
16097
16098         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
16099         (Invocation::BetterFunction): Implement.
16100         (Invocation::BetterConversion): Implement.
16101         (Invocation::ConversionExists): Skeleton, no implementation yet.
16102
16103         Okay, things work fine !
16104
16105 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * typemanager.cs: declare and load enum_type, delegate_type and
16108         void_type. 
16109
16110         * expression.cs (Expression::Emit): Now emit returns a value that
16111         tells whether a value is left on the stack or not.  This strategy
16112         might be reveted tomorrow with a mechanism that would address
16113         multiple assignments.
16114         (Expression::report118): Utility routine to report mismatches on
16115         the ExprClass.
16116
16117         (Unary::Report23): Report impossible type/operator combination
16118         utility function.
16119
16120         (Unary::IsIncrementableNumber): Whether the type can be
16121         incremented or decremented with add.
16122         (Unary::ResolveOperator): Also allow enumerations to be bitwise
16123         complemented. 
16124         (Unary::ResolveOperator): Implement ++, !, ~,
16125
16126         (Invocation::Emit): Deal with new Emit convetion.
16127
16128         * All Expression derivatives: Updated their Emit method to return
16129         whether they leave values on the stack or not.
16130
16131         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
16132         stack for expressions that are statements. 
16133
16134 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
16135
16136         * expression.cs (LValue): New interface.  Must be implemented by
16137         LValue objects.
16138         (LocalVariableReference, ParameterReference, FieldExpr): Implement
16139         LValue interface.
16140
16141         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
16142         interface for generating code, simplifies the code.
16143
16144 2001-09-20  Ravi Pratap  <ravi@ximian.com>
16145
16146         * expression.cs (everywhere): Comment out return statements in ::Resolve
16147         methods to avoid the warnings.
16148
16149 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
16150
16151         * driver.cs (parse): Report error 2001 if we can not open the
16152         source file.
16153
16154         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
16155         not resolve it.
16156
16157         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
16158         object. 
16159
16160         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
16161         otherwise nested blocks end up with the same index.
16162
16163         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
16164
16165         * expression.cs:  Instead of having FIXMEs in the Resolve
16166         functions, throw exceptions so it is obvious that we are facing a
16167         bug. 
16168
16169         * cs-parser.jay (invocation_expression): Pass Location information.
16170
16171         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
16172         Use a basename for those routines because .NET does not like paths
16173         on them. 
16174
16175         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
16176         already defined.
16177
16178 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
16179
16180         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
16181         are loading the correct data types (throws an exception if not).
16182         (TypeManager::InitCoreTypes): Use CoreLookupType
16183
16184         * expression.cs (Unary::ResolveOperator): return the child
16185         expression for expressions which are just +expr.
16186         (Unary::ResolveOperator): Return negative literals for -LITERAL
16187         expressions (otherwise they are Unary {Literal}).
16188         (Invocation::Badness): Take into account `Implicit constant
16189         expression conversions'.
16190
16191         * literal.cs (LongLiteral): Implement long literal class.
16192         (IntLiteral): export the `Value' of the intliteral. 
16193
16194 2001-09-19  Ravi Pratap  <ravi@ximian.com>
16195
16196         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
16197
16198         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
16199         instead of 'Operator'
16200
16201         * expression.cs (Binary::ResolveOperator): Update accordingly.
16202         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
16203         and 'Minus'
16204
16205         * cs-parser.jay (unary_expression): Update to use the new names.
16206
16207         * gen-treedump.cs (GetUnary): Same here.
16208
16209         * expression.cs (Unary::Resolve): Implement.
16210         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
16211         operators are found instead of making noise ;-)
16212         (Unary::ResolveOperator): New method to do precisely the same thing which
16213         Binary::ResolveOperator does for Binary expressions.
16214         (Unary.method, .Arguments): Add.
16215         (Unary::OperName): Implement.   
16216         (Unary::ForceConversion): Copy and Paste !
16217
16218         * class.cs (Operator::Define): Fix a small bug for the case when we have 
16219         a unary operator.
16220
16221         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
16222         for the inbuilt operators. Only overloading works for now ;-)
16223
16224 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
16227         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
16228
16229         * expression.cs (This::Emit): Implement. 
16230         (This::Resolve): Implement.
16231         (TypeOf:Resolve): Implement.
16232         (Expression::ResolveSimpleName): Add an implicit this to instance
16233         field references. 
16234         (MemberAccess::Resolve): Deal with Parameters and Fields. 
16235         Bind instance variable to Field expressions.
16236         (FieldExpr::Instance): New field used to track the expression that
16237         represents the object instance.
16238         (FieldExpr::Resolve): Track potential errors from MemberLookup not
16239         binding 
16240         (FieldExpr::Emit): Implement.
16241
16242         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
16243         the last instruction contains a return opcode to avoid generating
16244         the last `ret' instruction (this generates correct code, and it is
16245         nice to pass the peverify output).
16246
16247         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
16248         initializer for static and instance variables.
16249         (Constructor::Emit): Allow initializer to be null in the case of
16250         static constructors.  Only emit initializer for instance
16251         constructors. 
16252
16253         (TypeContainer::FindMembers): Return a null array if there are no
16254         matches.
16255
16256         Also fix the code for the MemberTypes.Method branch, as it was not
16257         scanning that for operators (or tried to access null variables before).
16258
16259         * assign.cs (Assign::Emit): Handle instance and static fields. 
16260
16261         * TODO: Updated.
16262
16263         * driver.cs: Stop compilation if there are parse errors.
16264
16265         * cs-parser.jay (constructor_declaration): Provide default base
16266         initializer for non-static constructors.
16267         (constructor_declarator): Do not provide a default base
16268         initializers if none was specified.
16269         Catch the fact that constructors should not have parameters.
16270
16271         * class.cs: Do not emit parent class initializers for static
16272         constructors, that should be flagged as an error.
16273
16274 2001-09-18  Ravi Pratap  <ravi@ximian.com>
16275
16276         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
16277         Move back code into TypeContainer::Populate.
16278
16279 2001-09-18  Ravi Pratap  <ravi@ximian.com>
16280
16281         * class.cs (TypeContainer::AddConstructor): Fix the check to
16282         compare against Name, not Basename. 
16283         (Operator::OpType): Change Plus and Minus to Add and Subtract.
16284
16285         * cs-parser.jay : Update accordingly.
16286
16287         * class.cs (TypeContainer::FindMembers): For the case where we are searching
16288         for methods, don't forget to look into the operators too.
16289         (RegisterMethodBuilder): Helper method to take care of this for
16290         methods, constructors and operators.
16291         (Operator::Define): Completely revamp.
16292         (Operator.OperatorMethod, MethodName): New fields.
16293         (TypeContainer::Populate): Move the registering of builders into
16294         RegisterMethodBuilder.
16295         (Operator::Emit): Re-write.
16296
16297         * expression.cs (Binary::Emit): Comment out code path to emit method
16298         invocation stuff for the case when we have a user defined operator. I am
16299         just not able to get it right !
16300
16301 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
16304         argument. 
16305
16306         (Expression::MemberLookup): Provide a version that allows to
16307         specify the MemberTypes and BindingFlags. 
16308
16309         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
16310         so it was not fetching variable information from outer blocks.
16311
16312         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
16313         Beforefieldinit as it was buggy.
16314
16315         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
16316         that Ravi put here.  
16317
16318         * class.cs (Constructor::Emit): Only emit if block is not null.
16319         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
16320         deal with this by semantically definining it as if the user had
16321         done it.
16322
16323         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
16324         constructors as we now "emit" them at a higher level.
16325
16326         (TypeContainer::DefineDefaultConstructor): Used to define the
16327         default constructors if none was provided.
16328
16329         (ConstructorInitializer): Add methods Resolve and Emit. 
16330
16331         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
16332
16333 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16334
16335         * class.cs (TypeContainer::EmitDefaultConstructor): Register
16336         the default constructor builder with our hashtable for methodbuilders
16337         to methodcores.
16338
16339         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
16340         and argument_count is 0 in which case we have a match.
16341         (Binary::ResolveOperator): More null checking and miscellaneous coding
16342         style cleanup.
16343
16344 2001-09-17  Ravi Pratap  <ravi@ximian.com>
16345
16346         * rootcontext.cs (IsNameSpace): Compare against null.
16347
16348         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
16349
16350         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
16351         and Unary::Operator.
16352
16353         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
16354         accordingly.
16355
16356         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
16357         we have overloaded operators.
16358         (Binary::ResolveOperator): Implement the part which does the operator overload
16359         resolution.
16360
16361         * class.cs (Operator::Emit): Implement.
16362         (TypeContainer::Emit): Emit the operators we have too.
16363
16364         * expression.cs (Binary::Emit): Update to emit the appropriate code for
16365         the case when we have a user-defined operator.
16366
16367 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
16370
16371 2001-09-16  Ravi Pratap  <ravi@ximian.com>
16372
16373         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
16374         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
16375         (Constructor::Emit): Implement.
16376         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
16377         if we have no work to do. 
16378         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
16379         Emit method.
16380
16381         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
16382         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
16383
16384         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
16385         of parent.parent.
16386
16387 2001-09-15  Ravi Pratap  <ravi@ximian.com>
16388
16389         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
16390         in the source.
16391         (Tree::RecordNamespace): Method to do what the name says ;-)
16392         (Tree::Namespaces): Property to get at the namespaces hashtable.
16393
16394         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
16395         keep track.
16396
16397         * rootcontext.cs (IsNamespace): Fixed it :-)
16398
16399 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16400
16401         * class.cs (TypeContainer::FindMembers): Add support for
16402         constructors. 
16403         (MethodCore): New class that encapsulates both the shared aspects
16404         of a Constructor and a Method.  
16405         (Method, Constructor): Factored pieces into MethodCore.
16406
16407         * driver.cs: Added --fatal which makes errors throw exceptions.
16408         Load System assembly as well as part of the standard library.
16409
16410         * report.cs: Allow throwing exceptions on errors for debugging.
16411
16412         * modifiers.cs: Do not use `parent', instead use the real type
16413         container to evaluate permission settings.
16414
16415         * class.cs: Put Ravi's patch back in.  He is right, and we will
16416         have to cope with the
16417
16418 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16419
16420         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
16421         FamORAssem, not FamANDAssem.
16422
16423 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * driver.cs: Added --parse option that only parses its input files
16426         and terminates.
16427
16428         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
16429         incorrect.  IsTopLevel is not used to tell whether an object is
16430         root_types or not (that can be achieved by testing this ==
16431         root_types).  But to see if this is a top-level *class* (not
16432         necessarly our "toplevel" container). 
16433
16434 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16435
16436         * enum.cs (Enum::Define): Modify to call the Lookup method on the
16437         parent instead of a direct call to GetType.
16438
16439 2001-09-14  Ravi Pratap  <ravi@ximian.com>
16440
16441         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
16442         Modifiers.TypeAttr. This should just be a call to that method.
16443
16444         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
16445         object so that we can determine if we are top-level or not.
16446
16447         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
16448         TypeContainer too.
16449
16450         * enum.cs (Enum::Define): Ditto.
16451
16452         * modifiers.cs (FieldAttr): Re-write.
16453
16454         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
16455         (TypeContainer::HaveStaticConstructor): New property to provide access
16456         to precisely that info.
16457
16458         * modifiers.cs (MethodAttr): Re-write.
16459         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
16460
16461         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
16462         of top-level types as claimed.
16463
16464 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * expression.cs (MemberLookup): Fruitless attempt to lookup
16467         constructors.  Maybe I need to emit default constructors?  That
16468         might be it (currently .NET emits this for me automatically).
16469         (Invocation::OverloadResolve): Cope with Arguments == null.
16470         (Invocation::EmitArguments): new function, shared by the new
16471         constructor and us.
16472         (Invocation::Emit): Handle static and instance methods.  Emit
16473         proper call instruction for virtual or non-virtual invocations.
16474         (New::Emit): Implement.
16475         (New::Resolve): Implement.
16476         (MemberAccess:Resolve): Implement.
16477         (MethodGroupExpr::InstanceExpression): used conforming to the spec
16478         to track instances.
16479         (FieldExpr::Resolve): Set type.
16480
16481         * support.cs: Handle empty arguments.
16482                 
16483         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
16484         SimpleLookup): Auxiliary routines to help parse a qualifier
16485         identifier.  
16486
16487         Update qualifier_identifier rule.
16488
16489         * codegen.cs: Removed debugging messages.
16490
16491         * class.cs: Make this a global thing, this acts just as a "key" to
16492         objects that we might have around.
16493
16494         (Populate): Only initialize method_builders_to_methods once.
16495
16496         * expression.cs (PropertyExpr): Initialize type from the
16497         PropertyType. 
16498
16499         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
16500         Resolve pattern.  Attempt to implicitly convert value to boolean.
16501         Emit code.
16502
16503         * expression.cs: Set the type for the int32/int32 argument case.
16504         (Binary::ResolveOperator): Set the return type to boolean for
16505         comparission operators
16506
16507         * typemanager.cs: Remove debugging print code.
16508
16509         (Invocation::Resolve): resolve type.
16510
16511         * class.cs: Allocate a MemberInfo of the correct size, as the code
16512         elsewhere depends on the test to reflect the correct contents.
16513
16514         (Method::) Keep track of parameters, due to System.Reflection holes
16515
16516         (TypeContainer::Populate): Keep track of MethodBuilders to Method
16517         mapping here.
16518
16519         (TypeContainer::FindMembers): Use ArrayList and then copy an array
16520         of the exact size and return that.
16521
16522         (Class::LookupMethodByBuilder): New function that maps
16523         MethodBuilders to its methods.  Required to locate the information
16524         on methods because System.Reflection bit us again.
16525
16526         * support.cs: New file, contains an interface ParameterData and
16527         two implementations: ReflectionParameters and InternalParameters
16528         used to access Parameter information.  We will need to grow this
16529         as required.
16530
16531         * expression.cs (Invocation::GetParameterData): implement a cache
16532         and a wrapper around the ParameterData creation for methods. 
16533         (Invocation::OverloadResolve): Use new code.
16534
16535 2001-09-13  Ravi Pratap  <ravi@ximian.com>
16536
16537         * class.cs (TypeContainer::EmitField): Remove and move into 
16538         (Field::Define): here and modify accordingly.
16539         (Field.FieldBuilder): New member.
16540         (TypeContainer::Populate): Update accordingly.
16541         (TypeContainer::FindMembers): Implement.
16542
16543 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * statement.cs: (VariableInfo::VariableType): New field to be
16546         initialized with the full type once it is resolved. 
16547
16548 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
16549
16550         * parameter.cs (GetParameterInfo): Use a type cache to compute
16551         things only once, and to reuse this information
16552
16553         * expression.cs (LocalVariableReference::Emit): Implement.
16554         (OpcodeCast::Emit): fix.
16555
16556         (ParameterReference::Resolve): Implement.
16557         (ParameterReference::Emit): Implement.
16558
16559         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
16560         that are expressions need to stay as Expressions.
16561
16562         * typemanager.cs (CSharpName): Returns the C# name of a type if
16563         possible. 
16564
16565         * expression.cs (Expression::ConvertImplicit): New function that
16566         implements implicit type conversions.
16567
16568         (Expression::ImplicitReferenceConversion): Implements implicit
16569         reference conversions.
16570
16571         (EmptyCast): New type for transparent casts.
16572
16573         (OpcodeCast): New type for casts of types that are performed with
16574         a sequence of bytecodes.
16575
16576         (BoxedCast): New type used for casting value types into reference
16577         types.  Emits a box opcode.
16578
16579         (Binary::DoNumericPromotions): Implements numeric promotions of
16580         and computation of the Binary::Type.
16581
16582         (Binary::EmitBranchable): Optimization.
16583
16584         (Binary::Emit): Implement code emission for expressions.
16585
16586         * typemanager.cs (TypeManager): Added two new core types: sbyte
16587         and byte.
16588
16589 2001-09-12  Ravi Pratap  <ravi@ximian.com>
16590
16591         * class.cs (TypeContainer::FindMembers): Method which does exactly
16592         what Type.FindMembers does, only we don't have to use reflection. No
16593         implementation yet.
16594
16595         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
16596         typecontainer objects as we need to get at them.
16597         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
16598
16599         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
16600         typecontainer object.
16601
16602         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
16603         of just a Report object.
16604
16605 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16606
16607         * class.cs (Event::Define): Go back to using the prefixes "add_" and
16608         "remove_"
16609         (TypeContainer::Populate): Now define the delegates of the type too.
16610         (TypeContainer.Delegates): Property to access the list of delegates defined
16611         in the type.
16612
16613         * delegates.cs (Delegate::Define): Implement partially.
16614
16615         * modifiers.cs (TypeAttr): Handle more flags.
16616
16617 2001-09-11  Ravi Pratap  <ravi@ximian.com>
16618
16619         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
16620         and not <=
16621         (Operator::Define): Re-write logic to get types by using the LookupType method
16622         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
16623         (Indexer::Define): Ditto.
16624         (Event::Define): Ditto.
16625         (Property::Define): Ditto.
16626
16627 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16628
16629         * class.cs (TypeContainer::Populate): Now define operators too. 
16630         (TypeContainer.Operators): New property to access the list of operators
16631         in a type.
16632         (Operator.OperatorMethodBuilder): New member to hold the method builder
16633         for the operator we are defining.
16634         (Operator::Define): Implement.
16635
16636 2001-09-10  Ravi Pratap  <ravi@ximian.com>
16637
16638         * class.cs (Event::Define): Make the prefixes of the accessor methods
16639         addOn_ and removeOn_ 
16640
16641         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
16642         of the location being passed in too. Ideally, this should go later since all
16643         error reporting should be done through the Report object.
16644
16645         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
16646         (Populate): Iterate thru the indexers we have and define them too.
16647         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
16648         for the get and set accessors.
16649         (Indexer::Define): Implement.
16650
16651 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
16652
16653         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
16654         my previous implementation, did not work.
16655
16656         * typemanager.cs: Add a couple of missing types (the longs).
16657
16658         * literal.cs: Use TypeManager.bool_type instead of getting it.
16659
16660         * expression.cs (EventExpr): New kind of expressions.
16661         (Expressio::ExprClassFromMemberInfo): finish
16662
16663 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
16664
16665         * assign.cs: Emit stores to static fields differently.
16666
16667 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16668
16669         * Merge in changes and adjust code to tackle conflicts. Backed out my
16670         code in Assign::Resolve ;-) 
16671
16672 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16673
16674         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
16675         instead Report.Error and also pass in the location.
16676         (CSharpParser::Lexer): New readonly property to return the reference
16677         to the Tokenizer object.
16678         (declare_local_variables): Use Report.Error with location instead of plain 
16679         old error.
16680         (CheckDef): Ditto.
16681
16682         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
16683         (Operator.CheckBinaryOperator): Ditto.
16684
16685         * cs-parser.jay (operator_declarator): Update accordingly.
16686
16687         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
16688         (CheckBinaryOperator): Same here.
16689
16690         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
16691         on the name without any prefixes of namespace names etc. This is because we
16692         already might have something already fully qualified like 
16693         'System.Console.WriteLine'
16694
16695         * assign.cs (Resolve): Begin implementation. Stuck ;-)
16696
16697 2001-09-07  Ravi Pratap  <ravi@ximian.com>
16698
16699         * cs-tokenizer.cs (location): Return a string which also contains
16700         the file name.
16701
16702         * expression.cs (ElementAccess): New class for expressions of the
16703         type 'element access.'
16704         (BaseAccess): New class for expressions of the type 'base access.'
16705         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
16706         respectively.
16707
16708         * cs-parser.jay (element_access): Implement action.
16709         (base_access): Implement actions.
16710         (checked_expression, unchecked_expression): Implement.
16711
16712         * cs-parser.jay (local_variable_type): Correct and implement.
16713         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
16714
16715         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
16716
16717         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
16718         name and the specifiers.
16719
16720         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
16721
16722         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
16723         making them all public ;-)
16724
16725         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
16726         class anyways.
16727
16728 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
16729
16730         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
16731         PropertyExprs.
16732         (FieldExpr, PropertyExprs): New resolved expressions.
16733         (SimpleName::MemberStaticCheck): Perform static checks for access
16734         to non-static fields on static methods. Maybe this should be
16735         generalized for MemberAccesses. 
16736         (SimpleName::ResolveSimpleName): More work on simple name
16737         resolution. 
16738
16739         * cs-parser.jay (primary_expression/qualified_identifier): track
16740         the parameter index.
16741
16742         * codegen.cs (CodeGen::Save): Catch save exception, report error.
16743         (EmitContext::EmitBoolExpression): Chain to expression generation
16744         instead of temporary hack.
16745         (::EmitStatementExpression): Put generic expression code generation.
16746
16747         * assign.cs (Assign::Emit): Implement variable assignments to
16748         local variables, parameters and fields.
16749
16750 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * statement.cs (Block::GetVariableInfo): New method, returns the
16753         VariableInfo for a variable name in a block.
16754         (Block::GetVariableType): Implement in terms of GetVariableInfo
16755
16756         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
16757         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
16758
16759 2001-09-06  Ravi Pratap  <ravi@ximian.com>
16760
16761         * cs-parser.jay (operator_declaration): Continue on my quest : update
16762         to take attributes argument.
16763         (event_declaration): Ditto.
16764         (enum_declaration): Ditto.
16765         (indexer_declaration): Ditto.
16766
16767         * class.cs (Operator::Operator): Update constructor accordingly.
16768         (Event::Event): Ditto.
16769
16770         * delegate.cs (Delegate::Delegate): Same here.
16771
16772         * enum.cs (Enum::Enum): Same here.
16773
16774 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16775
16776         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
16777
16778         * ../tests/cs0658.cs : New file to demonstrate error 0658.
16779
16780         * attribute.cs (Attributes): New class to encapsulate all attributes which were
16781         being passed around as an arraylist.
16782         (Attributes::AddAttribute): Method to add attribute sections.
16783
16784         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
16785         (struct_declaration): Update accordingly.
16786         (constant_declaration): Update.
16787         (field_declaration): Update.
16788         (method_header): Update.
16789         (fixed_parameter): Update.
16790         (parameter_array): Ditto.
16791         (property_declaration): Ditto.
16792         (destructor_declaration): Ditto.
16793
16794         * class.cs (Struct::Struct): Update constructors accordingly.
16795         (Class::Class): Ditto.
16796         (Field::Field): Ditto.
16797         (Method::Method): Ditto.
16798         (Property::Property): Ditto.
16799         (TypeContainer::OptAttribute): update property's return type.
16800
16801         * interface.cs (Interface.opt_attributes): New member.
16802         (Interface::Interface): Update to take the extra Attributes argument.
16803
16804         * parameter.cs (Parameter::Parameter): Ditto.
16805
16806         * constant.cs (Constant::Constant): Ditto.
16807
16808         * interface.cs (InterfaceMemberBase): New OptAttributes field.
16809         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
16810         the attributes as a parameter.
16811         (InterfaceProperty): Update constructor call.
16812         (InterfaceEvent): Ditto.
16813         (InterfaceMethod): Ditto.
16814         (InterfaceIndexer): Ditto.
16815
16816         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
16817         pass the attributes too.
16818         (interface_event_declaration): Ditto.
16819         (interface_property_declaration): Ditto.
16820         (interface_method_declaration): Ditto.
16821         (interface_declaration): Ditto.
16822
16823 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
16824
16825         * class.cs (Method::Define): Track the "static Main" definition to
16826         create an entry point. 
16827
16828         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
16829         EntryPoint if we find it. 
16830
16831         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
16832         (EmitContext::ig): Make this variable public.
16833
16834         * driver.cs: Make the default output file be the first file name
16835         with the .exe extension.  
16836
16837         Detect empty compilations
16838
16839         Handle various kinds of output targets.  Handle --target and
16840         rename -t to --dumper.
16841
16842         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
16843         methods inherited from Expression return now an Expression.  This
16844         will is used during the tree rewriting as we resolve them during
16845         semantic analysis.
16846
16847         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
16848         the spec.  Missing entirely is the information about
16849         accessability of elements of it.
16850
16851         (Expression::ExprClassFromMemberInfo): New constructor for
16852         Expressions that creates a fully initialized Expression based on
16853         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
16854         a Type.
16855
16856         (Invocation::Resolve): Begin implementing resolution of invocations.
16857
16858         * literal.cs (StringLiteral):  Implement Emit.
16859
16860 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16861
16862         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
16863         member.
16864
16865 2001-09-04  Ravi Pratap  <ravi@ximian.com>
16866
16867         * cs-parser.jay (attribute_arguments): Implement actions.
16868         (attribute): Fix bug in production. Implement action.
16869         (attribute_list): Implement.
16870         (attribute_target): Implement.
16871         (attribute_target_specifier, opt_target_specifier): Implement
16872         (CheckAttributeTarget): New method to check if the attribute target
16873         is valid.
16874         (attribute_section): Implement.
16875         (opt_attributes): Implement.
16876
16877         * attribute.cs : New file to handle attributes.
16878         (Attribute): Class to hold attribute info.
16879
16880         * cs-parser.jay (opt_attribute_target_specifier): Remove production
16881         (attribute_section): Modify production to use 2 different rules to 
16882         achieve the same thing. 1 s/r conflict down !
16883         Clean out commented, useless, non-reducing dimension_separator rules.
16884
16885         * class.cs (TypeContainer.attributes): New member to hold list
16886         of attributes for a type.
16887         (Struct::Struct): Modify to take one more argument, the attribute list.
16888         (Class::Class): Ditto.
16889         (Field::Field): Ditto.
16890         (Method::Method): Ditto.
16891         (Property::Property): Ditto.
16892
16893         * cs-parser.jay (struct_declaration): Update constructor call to
16894         pass in the attributes too.
16895         (class_declaration): Ditto.
16896         (constant_declaration): Ditto.
16897         (field_declaration): Ditto.
16898         (method_header): Ditto.
16899         (fixed_parameter): Ditto.
16900         (parameter_array): Ditto.
16901         (property_declaration): Ditto.
16902
16903         * constant.cs (Constant::Constant): Update constructor similarly.
16904         Use System.Collections.
16905
16906         * parameter.cs (Parameter::Parameter): Update as above.
16907
16908 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16909
16910         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
16911         (TypeContainer.delegates): New member to hold list of delegates.
16912
16913         * cs-parser.jay (delegate_declaration): Implement the action correctly 
16914         this time as I seem to be on crack ;-)
16915
16916 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
16917
16918         * rootcontext.cs (RootContext::IsNamespace): new function, used to
16919         tell whether an identifier represents a namespace.
16920
16921         * expression.cs (NamespaceExpr): A namespace expression, used only
16922         temporarly during expression resolution.
16923         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
16924         utility functions to resolve names on expressions.
16925
16926 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
16927
16928         * codegen.cs: Add hook for StatementExpressions. 
16929
16930         * class.cs: Fix inverted test for static flag in methods.
16931
16932 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16933
16934         * class.cs (Operator::CheckUnaryOperator): Correct error number used
16935         to make it coincide with MS' number.
16936         (Operator::CheckBinaryOperator): Ditto.
16937
16938         * ../errors/errors.txt : Remove error numbers added earlier.
16939
16940         * ../errors/cs1019.cs : Test case for error # 1019
16941
16942         * ../errros/cs1020.cs : Test case for error # 1020
16943
16944         * cs-parser.jay : Clean out commented cruft.
16945         (dimension_separators, dimension_separator): Comment out. Ostensibly not
16946         used anywhere - non-reducing rule.
16947         (namespace_declarations): Non-reducing rule - comment out.
16948
16949         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
16950         with TypeContainer::AddEnum.
16951
16952         * delegate.cs : New file for delegate handling classes.
16953         (Delegate): Class for declaring delegates.
16954
16955         * makefile : Update.
16956
16957         * cs-parser.jay (delegate_declaration): Implement.
16958
16959 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
16960
16961         * class.cs (Event::Define): Implement.
16962         (Event.EventBuilder): New member.
16963
16964         * class.cs (TypeContainer::Populate): Update to define all enums and events
16965         we have.
16966         (Events): New property for the events arraylist we hold. Shouldn't we move to using
16967         readonly fields for all these cases ?
16968
16969 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16970
16971         * class.cs (Property): Revamp to use the convention of making fields readonly.
16972         Accordingly modify code elsewhere.
16973
16974         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
16975         the Define method of the Property class.
16976
16977         * class.cs : Clean up applied patch and update references to variables etc. Fix 
16978         trivial bug.
16979         (TypeContainer::Populate): Update to define all the properties we have. Also
16980         define all enumerations.
16981
16982         * enum.cs (Define): Implement.
16983
16984 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16985
16986         * cs-parser.jay (overloadable_operator): The semantic value is an
16987         enum of the Operator class.
16988         (operator_declarator): Implement actions.
16989         (operator_declaration): Implement.
16990
16991         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
16992         validity of definitions.
16993         (Operator::CheckBinaryOperator): Static method to check for binary operators
16994         (TypeContainer::AddOperator): New method to add an operator to a type.
16995
16996         * cs-parser.jay (indexer_declaration): Added line to actually call the
16997         AddIndexer method so it gets added ;-)
16998
16999         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
17000         already taken care of by the MS compiler ?  
17001
17002 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
17003
17004         * class.cs (Operator): New class for operator declarations.
17005         (Operator::OpType): Enum for the various operators.
17006
17007 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
17008
17009         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
17010         ostensibly handle this in semantic analysis.
17011
17012         * cs-parser.jay (general_catch_clause): Comment out
17013         (specific_catch_clauses, specific_catch_clause): Ditto.
17014         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
17015         (catch_args, opt_catch_args): New productions.
17016         (catch_clause): Rewrite to use the new productions above
17017         (catch_clauses): Modify accordingly.
17018         (opt_catch_clauses): New production to use in try_statement
17019         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
17020         and re-write the code in the actions to extract the specific and
17021         general catch clauses by being a little smart ;-)
17022
17023         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
17024         Hooray, try and catch statements parse fine !
17025
17026 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
17027
17028         * statement.cs (Block::GetVariableType): Fix logic to extract the type
17029         string from the hashtable of variables.
17030
17031         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
17032         I end up making that mistake ;-)
17033         (catch_clauses): Fixed gross error which made Key and Value of the 
17034         DictionaryEntry the same : $1 !!
17035
17036 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
17037
17038         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
17039
17040         * cs-parser.jay (event_declaration): Correct to remove the semicolon
17041         when the add and remove accessors are specified. 
17042
17043 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
17044
17045         * cs-parser.jay (IndexerDeclaration): New helper class to hold
17046         information about indexer_declarator.
17047         (indexer_declarator): Implement actions.
17048         (parsing_indexer): New local boolean used to keep track of whether
17049         we are parsing indexers or properties. This is necessary because 
17050         implicit_parameters come into picture even for the get accessor in the 
17051         case of an indexer.
17052         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
17053
17054         * class.cs (Indexer): New class for indexer declarations.
17055         (TypeContainer::AddIndexer): New method to add an indexer to a type.
17056         (TypeContainer::indexers): New member to hold list of indexers for the
17057         type.
17058
17059 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
17060
17061         * cs-parser.jay (add_accessor_declaration): Implement action.
17062         (remove_accessor_declaration): Implement action.
17063         (event_accessors_declaration): Implement
17064         (variable_declarators): swap statements for first rule - trivial.
17065
17066         * class.cs (Event): New class to hold information about event
17067         declarations.
17068         (TypeContainer::AddEvent): New method to add an event to a type
17069         (TypeContainer::events): New member to hold list of events.
17070
17071         * cs-parser.jay (event_declaration): Implement actions.
17072
17073 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
17074
17075         * cs-parser.jay (dim_separators): Implement. Make it a string
17076         concatenating all the commas together, just as they appear.
17077         (opt_dim_separators): Modify accordingly
17078         (rank_specifiers): Update accordingly. Basically do the same
17079         thing - instead, collect the brackets here.
17080         (opt_rank_sepcifiers): Modify accordingly.
17081         (array_type): Modify to actually return the complete type string
17082         instead of ignoring the rank_specifiers.
17083         (expression_list): Implement to collect the expressions
17084         (variable_initializer): Implement. We make it a list of expressions
17085         essentially so that we can handle the array_initializer case neatly too.
17086         (variable_initializer_list): Implement.
17087         (array_initializer): Make it a list of variable_initializers
17088         (opt_array_initializer): Modify accordingly.
17089
17090         * expression.cs (New::NType): Add enumeration to help us
17091         keep track of whether we have an object/delegate creation
17092         or an array creation.
17093         (New:NewType, New::Rank, New::Indices, New::Initializers): New
17094         members to hold data about array creation.
17095         (New:New): Modify to update NewType
17096         (New:New): New Overloaded contructor for the array creation
17097         case.
17098
17099         * cs-parser.jay (array_creation_expression): Implement to call
17100         the overloaded New constructor.
17101
17102 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
17103
17104         * class.cs (TypeContainer::Constructors): Return member
17105         constructors instead of returning null.
17106
17107 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * typemanager.cs (InitCoreTypes): Initialize the various core
17110         types after we have populated the type manager with the user
17111         defined types (this distinction will be important later while
17112         compiling corlib.dll)
17113
17114         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
17115         on Expression Classification.  Now all expressions have a method
17116         `Resolve' and a method `Emit'.
17117
17118         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
17119         generation from working.     Also add some temporary debugging
17120         code. 
17121
17122 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
17123
17124         * codegen.cs: Lots of code generation pieces.  This is only the
17125         beginning, will continue tomorrow with more touches of polish.  We
17126         handle the fundamentals of if, while, do, for, return.  Others are
17127         trickier and I need to start working on invocations soon.
17128
17129         * gen-treedump.cs: Bug fix, use s.Increment here instead of
17130         s.InitStatement. 
17131
17132         * codegen.cs (EmitContext): New struct, used during code
17133         emission to keep a context.   Most of the code generation will be
17134         here. 
17135
17136         * cs-parser.jay: Add embedded blocks to the list of statements of
17137         this block.  So code generation proceeds in a top down fashion.
17138
17139 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
17140
17141         * statement.cs: Add support for multiple child blocks.
17142
17143 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
17144
17145         * codegen.cs (EmitCode): New function, will emit the code for a
17146         Block of code given a TypeContainer and its ILGenerator. 
17147
17148         * statement.cs (Block): Standard public readonly optimization.
17149         (Block::Block constructors): Link children. 
17150         (Block::Child): Child Linker.
17151         (Block::EmitVariables): Emits IL variable declarations.
17152
17153         * class.cs: Drop support for MethodGroups here, delay until
17154         Semantic Analysis.
17155         (Method::): Applied the same simplification that I did before, and
17156         move from Properties to public readonly fields.
17157         (Method::ParameterTypes): Returns the parameter types for the
17158         function, and implements a cache that will be useful later when I
17159         do error checking and the semantic analysis on the methods is
17160         performed.
17161         (Constructor::GetCallingConvention): Renamed from CallingConvetion
17162         and made a method, optional argument tells whether this is a class
17163         or a structure to apply the `has-this' bit.
17164         (Method::GetCallingConvention): Implement, returns the calling
17165         convention. 
17166         (Method::Define): Defines the type, a second pass is performed
17167         later to populate the methods.
17168
17169         (Constructor::ParameterTypes): implement a cache similar to the
17170         one on Method::ParameterTypes, useful later when we do semantic
17171         analysis. 
17172
17173         (TypeContainer::EmitMethod):  New method.  Emits methods.
17174
17175         * expression.cs: Removed MethodGroup class from here.
17176
17177         * parameter.cs (Parameters::GetCallingConvention): new method.
17178
17179 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
17180
17181         * class.cs (TypeContainer::Populate): Drop RootContext from the
17182         argument. 
17183
17184         (Constructor::CallingConvention): Returns the calling convention.
17185         (Constructor::ParameterTypes): Returns the constructor parameter
17186         types. 
17187
17188         (TypeContainer::AddConstructor): Keep track of default constructor
17189         and the default static constructor.
17190
17191         (Constructor::) Another class that starts using `public readonly'
17192         instead of properties. 
17193
17194         (Constructor::IsDefault): Whether this is a default constructor. 
17195
17196         (Field::) use readonly public fields instead of properties also.
17197
17198         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
17199         track of static constructors;  If none is used, turn on
17200         BeforeFieldInit in the TypeAttributes. 
17201
17202         * cs-parser.jay (opt_argument_list): now the return can be null
17203         for the cases where there are no arguments. 
17204
17205         (constructor_declarator): If there is no implicit `base' or
17206         `this', then invoke the default parent constructor. 
17207
17208         * modifiers.cs (MethodAttr): New static function maps a set of
17209         modifiers flags into a MethodAttributes enum
17210         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
17211         MethodAttr, TypeAttr to represent the various mappings where the
17212         modifiers are used.
17213         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
17214
17215 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
17216
17217         * parameter.cs (GetParameterInfo): Fix bug where there would be no
17218         method arguments.
17219
17220         * interface.cs (PopulateIndexer): Implemented the code generator
17221         for interface indexers.
17222
17223 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
17224
17225         * interface.cs (InterfaceMemberBase): Now we track the new status
17226         here.  
17227
17228         (PopulateProperty): Implement property population.  Woohoo!  Got
17229         Methods and Properties going today. 
17230
17231         Removed all the properties for interfaces, and replaced them with
17232         `public readonly' fields. 
17233
17234 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
17235
17236         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
17237         initialize their hashtables/arraylists only when they are needed
17238         instead of doing this always.
17239
17240         * parameter.cs: Handle refs and out parameters.
17241
17242         * cs-parser.jay: Use an ArrayList to construct the arguments
17243         instead of the ParameterCollection, and then cast that to a
17244         Parameter[] array.
17245
17246         * parameter.cs: Drop the use of ParameterCollection and use
17247         instead arrays of Parameters.
17248
17249         (GetParameterInfo): Use the Type, not the Name when resolving
17250         types. 
17251
17252 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
17255         and instead use public readonly fields.
17256
17257         * class.cs: Put back walking code for type containers.
17258
17259 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
17260
17261         * class.cs (MakeConstant): Code to define constants.
17262
17263         * rootcontext.cs (LookupType): New function.  Used to locate types 
17264
17265
17266 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
17267
17268         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
17269         this System.Reflection code is.  Kudos to Microsoft
17270
17271         * typemanager.cs: Implement a type cache and avoid loading all
17272         types at boot time.  Wrap in LookupType the internals.  This made
17273         the compiler so much faster.  Wow.  I rule!
17274
17275         * driver.cs: Make sure we always load mscorlib first (for
17276         debugging purposes, nothing really important).
17277
17278         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
17279         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
17280
17281         * rootcontext.cs: Lookup types on their namespace;  Lookup types
17282         on namespaces that have been imported using the `using' keyword.
17283
17284         * class.cs (TypeContainer::TypeAttr): Virtualize.
17285         (Class::TypeAttr): Return attributes suitable for this bad boy.
17286         (Struct::TypeAttr): ditto.
17287         Handle nested classes.
17288         (TypeContainer::) Remove all the type visiting code, it is now
17289         replaced with the rootcontext.cs code
17290
17291         * rootcontext.cs (GetClassBases): Added support for structs. 
17292
17293 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
17294
17295         * interface.cs, statement.cs, class.cs, parameter.cs,
17296         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
17297         Drop use of TypeRefs, and use strings instead.
17298
17299 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
17300
17301         * rootcontext.cs: 
17302
17303         * class.cs (Struct::Struct): set the SEALED flags after
17304         checking the modifiers.
17305         (TypeContainer::TypeAttr): new property, returns the
17306         TypeAttributes for a class.  
17307
17308         * cs-parser.jay (type_list): Oops, list production was creating a
17309         new list of base types.
17310
17311         * rootcontext.cs (StdLib): New property.
17312         (GetInterfaceTypeByName): returns an interface by type name, and
17313         encapsulates error handling here.
17314         (GetInterfaces): simplified.
17315         (ResolveTree): Encapsulated all the tree resolution here.
17316         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
17317         types. 
17318
17319         * driver.cs: Add support for --nostdlib, to avoid loading the
17320         default assemblies.
17321         (Main): Do not put tree resolution here. 
17322
17323         * rootcontext.cs: Beginning of the class resolution.
17324
17325 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
17326
17327         * rootcontext.cs: Provide better error reporting. 
17328
17329         * cs-parser.jay (interface_base): set our $$ to be interfaces.
17330
17331         * rootcontext.cs (CreateInterface): Handle the case where there
17332         are no parent interfaces.
17333
17334         (CloseTypes): Routine to flush types at the end.
17335         (CreateInterface): Track types.
17336         (GetInterfaces): Returns an array of Types from the list of
17337         defined interfaces.
17338
17339         * typemanager.c (AddUserType): Mechanism to track user types (puts
17340         the type on the global type hash, and allows us to close it at the
17341         end). 
17342
17343 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
17346         RecordInterface instead.
17347
17348         * cs-parser.jay: Updated to reflect changes above.
17349
17350         * decl.cs (Definition): Keep track of the TypeBuilder type that
17351         represents this type here.  Not sure we will use it in the long
17352         run, but wont hurt for now.
17353
17354         * driver.cs: Smaller changes to accomodate the new code.
17355
17356         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
17357         when done. 
17358
17359         * rootcontext.cs (CreateInterface):  New method, used to create
17360         the System.TypeBuilder type for interfaces.
17361         (ResolveInterfaces): new entry point to resolve the interface
17362         hierarchy. 
17363         (CodeGen): Property, used to keep track of the code generator.
17364
17365 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
17366
17367         * cs-parser.jay: Add a second production for delegate_declaration
17368         with `VOID'.
17369
17370         (enum_body): Put an opt_comma here instead of putting it on
17371         enum_body or enum_member_declarations so we can handle trailing
17372         commas on enumeration members.  Gets rid of a shift/reduce.
17373
17374         (type_list): Need a COMMA in the middle.
17375
17376         (indexer_declaration): Tell tokenizer to recognize get/set
17377
17378         * Remove old targets.
17379
17380         * Re-add the parser target.
17381
17382 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17383
17384         * cs-parser.jay: Add precendence rules for a number of operators
17385         ot reduce the number of shift/reduce conflicts in the grammar.
17386
17387 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
17390         and put it here.
17391
17392         Get rid of old crufty code.
17393
17394         * rootcontext.cs: Use this to keep track of the parsed
17395         representation and the defined types available to the program. 
17396
17397         * gen-treedump.cs: adjust for new convention.
17398
17399         * type.cs: Split out the type manager, and the assembly builder
17400         from here. 
17401
17402         * typemanager.cs: the type manager will live here now.
17403
17404         * cil-codegen.cs: And the code generator here. 
17405
17406 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
17407
17408         * makefile: Fixed up for easy making.
17409
17410 2001-07-13  Simon Cozens <simon@simon-cozens.org>
17411
17412         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
17413         the 
17414
17415         (unary_expression): Expand pre_increment_expression and
17416         post_decrement_expression to reduce a shift/reduce.
17417
17418 2001-07-11  Simon Cozens
17419
17420         * cs-tokenizer.cs: Hex numbers should begin with a 0.
17421
17422         Improve allow_keyword_as_indent name.
17423
17424 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
17425
17426         * Adjustments for Beta2. 
17427
17428 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
17429
17430         * decl.cs: Added `Define' abstract method.
17431         (InTransit): new property, used to catch recursive definitions. 
17432
17433         * interface.cs: Implement `Define'. 
17434
17435         * modifiers.cs: Map Modifiers.constants to
17436         System.Reflection.TypeAttribute flags.
17437
17438         * class.cs: Keep track of types and user-defined types.
17439         (BuilderInit): New method for creating an assembly
17440         (ResolveType): New function to launch the resolution process, only
17441         used by interfaces for now.
17442
17443         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
17444         that are inserted into the name space. 
17445
17446 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
17447
17448         * ARGH.  I have screwed up my tree so many times due to the use of
17449         rsync rather than using CVS.  Going to fix this at once. 
17450
17451         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
17452         load types.
17453
17454 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
17455
17456         * Experiment successful: Use System.Type rather that our own
17457         version of Type.  
17458
17459 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
17460
17461         * cs-parser.jay: Removed nsAliases from here.
17462
17463         Use new namespaces, handle `using XXX;' 
17464
17465         * namespace.cs: Reimplemented namespace handling, use a recursive
17466         definition of the class.  Now we can keep track of using clauses
17467         and catch invalid using clauses.
17468
17469 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
17470
17471         * gen-treedump.cs: Adapted for all the renaming.
17472
17473         * expression.cs (Expression): this class now has a Type property
17474         which returns an expression Type.
17475
17476         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
17477         `Type', as this has a different meaning now in the base
17478
17479 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
17480
17481         * interface.cs, class.cs: Removed from all the sources the
17482         references to signature computation, as we can not do method
17483         signature computation during the parsing time, as we are not
17484         trying to solve at that point distinguishing:
17485
17486         class X {
17487                 void a (Blah x) {}
17488                 void a (NS.Blah x) {}
17489         }
17490
17491         Which depending on the context might be valid or not, as we do not
17492         know if Blah is the same thing as NS.Blah at that point.
17493
17494         * Redid everything so the code uses TypeRefs now instead of
17495         Types.  TypeRefs are just temporary type placeholders, that need
17496         to be resolved.  They initially have a pointer to a string and the
17497         current scope in which they are used.  This is used later by the
17498         compiler to resolve the reference to an actual Type. 
17499
17500         * DeclSpace is no longer a CIR.Type, and neither are
17501         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
17502         are all DeclSpaces, but no Types. 
17503
17504         * type.cs (TypeRefManager): This implements the TypeRef manager,
17505         which keeps track of all the types that need to be resolved after
17506         the parsing has finished. 
17507
17508 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
17509
17510         * ARGH.  We are going to have to store `foreach' as a class rather
17511         than resolving it, as we need to verify error 1579 after name
17512         resolution.   *OR* we could keep a flag that says `This request to
17513         IEnumerator comes from a foreach statement' which we can then use
17514         to generate the error.
17515
17516 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
17517
17518         * class.cs (TypeContainer.AddMethod): we now add methods to the
17519         MethodGroup instead of the method hashtable.  
17520
17521         * expression.cs: Add MethodGroup abstraction, which gets us one
17522         step closer to the specification in the way we handle method
17523         declarations.  
17524
17525         * cs-parser.jay (primary_expression): qualified_identifier now
17526         tried to match up an identifier to a local variable reference or
17527         to a parameter reference.
17528
17529         current_local_parameters is now a parser global variable that
17530         points to the current parameters for the block, used during name
17531         lookup.
17532
17533         (property_declaration): Now creates an implicit `value' argument to
17534         the set accessor.
17535
17536 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
17537
17538         * parameter.cs: Do not use `param' arguments as part of the
17539         signature, per the spec.
17540
17541 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
17542
17543         * decl.cs: Base class for classes, structs and interfaces.  This
17544         is the "Declaration Space" 
17545
17546         * cs-parser.jay: Use CheckDef for checking declaration errors
17547         instead of having one on each function.
17548
17549         * class.cs: Factor out some code for handling error handling in
17550         accordance to the "Declarations" section in the "Basic Concepts"
17551         chapter in the ECMA C# spec.
17552
17553         * interface.cs: Make all interface member classes derive from
17554         InterfaceMemberBase.
17555
17556 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
17557
17558         * Many things: all interfaces are parsed and generated in
17559         gen-treedump.  Support for member variables, constructors,
17560         destructors, properties, constants is there.
17561
17562         Beginning of the IL backend, but very little done, just there for
17563         testing purposes. 
17564
17565 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
17566
17567         * cs-parser.jay: Fix labeled statement.
17568
17569         * cs-tokenizer.cs (escape): Escape " and ' always.
17570         ref_line, ref_name: keep track of the line/filename as instructed
17571         by #line by the compiler.
17572         Parse #line.
17573
17574 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
17575
17576         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
17577         to match the values in System.CodeDOM.
17578
17579         Divid renamed to Divide.
17580
17581         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
17582         statements. 
17583         (Statements.set): remove.
17584
17585         * System.CodeDOM/CodeCatchClause.cs: always have a valid
17586         statements. 
17587
17588         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
17589         falseStatements always have valid values. 
17590
17591         * cs-parser.jay: Use System.CodeDOM now.
17592