2004-06-08 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
2
3         * class:
4         (Method.ApplyAttributeBuilder): Moved and added conditional
5         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6
7         * delegate.cs:
8         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9
10 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11
12         Fixed #59640
13         * class.cs: (EventField.attribute_targets): Changed default target.
14
15 2004-06-08  Martin Baulig  <martin@ximian.com>
16
17         * expression.cs (Invocation.EmitCall): Enable varargs methods.
18
19 2004-06-08  Martin Baulig  <martin@ximian.com>
20
21         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
22
23 2004-06-07  Martin Baulig  <martin@ximian.com>
24
25         Added support for varargs methods.
26
27         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
28         keyword.
29
30         * cs-parser.jay: Added support for `__arglist'.
31
32         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
33
34         * expression.cs (Argument.AType): Added `ArgList'.
35         (Invocation): Added support for varargs methods.
36         (ArglistAccess): New public class.
37         (Arglist): New public class.
38
39         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
40
41         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
42         a method's top-level block if the method has varargs.
43
44         * support.cs (ReflectionParameters, InternalParameters): Added
45         support for varargs methods.    
46
47 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
48
49         * class.cs: Provide location in indexer error report.
50
51         * driver.cs: Use standard names.
52
53         * namespace.cs: Catch the use of using after a namespace has been
54         declared also on using aliases.
55
56 2004-06-04  Martin Baulig  <martin@ximian.com>
57
58         Merged latest changes into gmcs.  Please keep this comment in
59         here, it makes it easier for me to see what changed in MCS since
60         the last time I merged.
61
62 2004-06-03  Raja R Harinath  <rharinath@novell.com>
63
64         Bug #50820.
65         * typemanager.cs (closure_private_ok, closure_invocation_type)
66         (closure_qualifier_type, closure_invocation_assembly)
67         (FilterWithClosure): Move to ...
68         (Closure): New internal nested class.
69         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
70         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
71         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
72         (MemberLookup, MemberLookupFailed): Use it.
73         * expression.cs (New.DoResolve): Treat the lookup for the
74         constructor as being qualified by the 'new'ed type.
75         (Indexers.GetIndexersForTypeOrInterface): Update.
76
77 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
78
79         * attribute.cs
80         (GetConditionalAttributeValue): New method. Returns
81         condition of ConditionalAttribute.
82         (SearchMulti): New method.  Returns all attributes of type 't'.
83         Use it when attribute is AllowMultiple = true.
84         (IsConditionalMethodExcluded): New method.
85
86         * class.cs
87         (Method.IsExcluded): Implemented. Returns true if method has conditional
88         attribute and the conditions is not defined (method is excluded).
89         (IMethodData): Extended interface for ConditionalAttribute support.
90         (PropertyMethod.IsExcluded): Implemented.
91
92         * decl.cs
93         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
94
95         * expression.cs
96         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
97         on the method.
98
99 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
100
101         * expression.cs (ArrayCreationExpression): Make this just an
102         `expression'. It can't be a statement, so the code here was
103         dead.
104
105 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
106
107         Fixed #59072
108         * typemanager.cs (GetFullNameSignature): New method for
109         MethodBase types.
110
111 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
112
113         Fixed #56452
114         * class.cs (MemberBase.GetSignatureForError): New virtual method.
115         Use this method when MethodBuilder is null.
116         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
117         Added test for error CS0626 (MONO reports error for this situation).
118         (IMethodData.GetSignatureForError): Extended interface.
119
120 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
121
122         * attribute.cs
123         (AttributeTester.GetObsoleteAttribute): Returns instance of
124         ObsoleteAttribute when type is obsolete.
125
126         * class.cs
127         (TypeContainer.VerifyObsoleteAttribute): Override.
128         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
129         (MethodCode.VerifyObsoleteAttribute): Override.
130         (MemberBase.VerifyObsoleteAttribute): Override.
131
132         * decl.cs
133         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
134         and report proper error.
135
136         *delegate.cs
137         Delegate.VerifyObsoleteAttribute): Override.
138
139         * ecore.cs
140         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
141         and report proper error.
142         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
143
144         * enum.cs
145         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
146         and enum member.
147
148         * expression.cs
149         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
150         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
151         Added test for ObsoleteAttribute.
152
153         * statement.cs
154         (Catch): Derived from Statement.
155
156 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
157  
158         Fixed bug #59071 & cs0160.cs
159  
160         * statement.cs (Try.Resolve): Check here whether order of catch
161         clauses matches their dependencies.
162
163 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
164
165         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
166         caused a regression: #59343.  Referencing nested classes from an
167         assembly stopped working.
168
169 2004-05-31  Martin Baulig  <martin@ximian.com>
170
171         MCS is now frozen for beta 2.
172
173 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
174
175         * convert.cs: add a trivial cache for overload operator resolution.
176
177 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
178
179         * decl.cs: If possible, use lookuptypedirect here. We can only do
180         this if there is no `.' after the namespace. Avoids using
181         LookupType, which does lots of slow processing.
182         (FindNestedType) New method, does what it says :-).
183         * namespace.cs: use LookupTypeDirect.
184         * rootcontext.cs: use membercache, if possible.
185         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
186
187 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
188
189         * expression.cs:
190         According to the spec, 
191
192         In a member access of the form E.I, if E is a single identifier,
193         and if the meaning of E as a simple-name (§7.5.2) is a constant,
194         field, property, localvariable, or parameter with the same type as
195         the meaning of E as a type-name (§3.8), then both possible
196         meanings of E are permitted.
197
198         We did not check that E as a simple-name had the same type as E as
199         a type name.
200
201         This trivial check gives us 5-7% on bootstrap time.
202
203 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
204
205         * expression.cs (Invocation.OverloadResolve): Avoid the
206         use of hashtables and boxing here by allocating on demand.
207
208 2004-05-30  Martin Baulig  <martin@ximian.com>
209
210         * rootcontext.cs (RootContext.LookupType): Don't cache things if
211         we're doing a silent lookup.  Don't try to lookup nested types in
212         TypeManager.object_type (thanks to Ben Maurer).
213
214 2004-05-30  Martin Baulig  <martin@ximian.com>
215
216         Committing a patch from Ben Maurer.
217
218         * rootcontext.cs (RootContext.LookupType): Cache negative results.
219
220 2004-05-29  Martin Baulig  <martin@ximian.com>
221
222         * class.cs (IMethodData.ShouldIgnore): New method.
223
224         * typemanager.cs (TypeManager.MethodFlags): Don't take a
225         `Location' argument, we don't need it anywhere.  Use
226         `IMethodData.ShouldIgnore ()' instead of
227         `MethodData.GetMethodFlags ()'.
228         (TypeManager.AddMethod): Removed.
229         (TypeManager.AddMethod2): Renamed to AddMethod.
230
231 2004-05-29  Martin Baulig  <martin@ximian.com>
232
233         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
234
235         * convert.cs (Convert.ImplicitReferenceConversion): If we're
236         converting from a class type S to an interface type and we already
237         have an object on the stack, don't box it again.  Fixes #52578.
238
239 2004-05-29  Martin Baulig  <martin@ximian.com>
240
241         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
242         Added support for `params' parameters.  Fixes #59267.
243
244 2004-05-29  Martin Baulig  <martin@ximian.com>
245
246         * literal.cs (NullPointer): Provide a private .ctor which sets
247         `type' to TypeManager.object_type.  Fixes #59048.
248
249 2004-05-29  Martin Baulig  <martin@ximian.com>
250
251         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
252         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
253
254         * ecore.cs (EventExpr.instance_expr): Make the field private.
255
256 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
257
258         Fixed bug #50080 & cs0214-2.cs
259         * expression.cs (Cast.DoResolve): Check unsafe context here.
260         
261         * statement.cs (Resolve.DoResolve): Likewise.
262
263 2004-05-26  Martin Baulig  <martin@ximian.com>
264
265         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
266
267         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
268         (RootContext.LookupType): Pass down the `silent' flag.
269
270 2004-05-25  Martin Baulig  <martin@ximian.com>
271
272         * expression.cs
273         (MethodGroupExpr.IdenticalTypeName): New public property.
274         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
275         expression actually refers to a type.
276
277 2004-05-25  Martin Baulig  <martin@ximian.com>
278
279         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
280         for #56176 and made it actually work.
281
282 2004-05-25  Martin Baulig  <martin@ximian.com>
283
284         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
285         (FieldExpr, PropertyExpr): Override and implement
286         CacheTemporaries.  Fixes #52279.
287
288 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
289
290         * location.cs: In the new compiler listing a file twice is a
291         warning, not an error.
292
293 2004-05-24  Martin Baulig  <martin@ximian.com>
294
295         * enum.cs (Enum.DefineType): For the `BaseType' to be a
296         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
297
298 2004-05-24  Martin Baulig  <martin@ximian.com>
299
300         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
301         walking the `using' list.  Fixes #53921.
302
303 2004-05-24  Martin Baulig  <martin@ximian.com>
304
305         * const.cs (Const.LookupConstantValue): Added support for
306         EmptyCast's; fixes #55251.
307
308 2004-05-24  Martin Baulig  <martin@ximian.com>
309
310         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
311         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
312         which does the CS0135 check.  The reason is that we first need to
313         check whether the variable actually exists.
314
315 2004-05-24  Martin Baulig  <martin@ximian.com>
316
317         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
318         than RootContext.LookupType() to find the explicit interface
319         type.  Fixes #58584.
320
321 2004-05-24  Raja R Harinath  <rharinath@novell.com>
322
323         * Makefile: Simplify.  Use executable.make.
324         * mcs.exe.sources: New file.  List of sources of mcs.exe.
325
326 2004-05-24  Anders Carlsson  <andersca@gnome.org>
327
328         * decl.cs:
329         * enum.cs:
330         Use the invariant culture when doing String.Compare for CLS case
331         sensitivity.
332         
333 2004-05-23  Martin Baulig  <martin@ximian.com>
334
335         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
336         don't have any dots.  Fixes #52622, added cs0246-8.cs.
337
338         * namespace.cs (NamespaceEntry.Lookup): Likewise.
339         
340 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
341
342         * class.cs (MemberBase.Define): Reuse MemberType member for 
343         resolved type. Other methods can use it too.
344
345 2004-05-23  Martin Baulig  <martin@ximian.com>
346
347         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
348         the variable also exists in the current block (otherwise, we need
349         to report a CS0103).  Fixes #58670.
350
351 2004-05-23  Martin Baulig  <martin@ximian.com>
352
353         * flowanalysis.cs (Reachability.Reachable): Compute this
354         on-the-fly rather than storing it as a field.
355
356 2004-05-23  Martin Baulig  <martin@ximian.com>
357
358         * flowanalysis.cs (Reachability.And): Manually compute the
359         resulting `barrier' from the reachability.      
360        
361 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
362
363         Fix bug #57835
364         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
365         instance of ObsoleteAttribute when symbol is obsolete.
366
367         * class.cs
368         (IMethodData): Extended interface for ObsoleteAttribute support.
369
370 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
371
372         * attribute.cs: Fix bug #55970
373
374 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
375
376         Fix bug #52705
377         * attribute.cs
378         (GetObsoleteAttribute): New method. Creates the instance of
379         ObsoleteAttribute.
380         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
381         ObsoleteAttribute when member is obsolete.
382         (AttributeTester.Report_ObsoleteMessage): Common method for
383         Obsolete error/warning reporting.
384
385         * class.cs
386         (TypeContainer.base_classs_type): New member for storing parent type.
387
388         * decl.cs
389         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
390         for this MemberCore.
391
392 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
393
394         * attribute.cs, const.cs: Fix bug #58590
395
396 2004-05-21  Martin Baulig  <martin@ximian.com>
397
398         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
399         out parameters if the end of the method is unreachable.  Fixes
400         #58098. 
401
402 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
403
404         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
405         Hari was right, why extra method.
406
407 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
408
409         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
410
411 2004-05-20  Martin Baulig  <martin@ximian.com>
412
413         Merged this back from gmcs to keep the differences to a minumum.
414
415         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
416         instead of a Declspace.
417         (Attribute.ResolveType): Likewise.
418         (Attributes.Search): Likewise.
419         (Attributes.Contains): Likewise.
420         (Attributes.GetClsCompliantAttribute): Likewise.
421
422         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
423         argument.
424         (MethodData.ApplyAttributes): Take an EmitContext instead of a
425         DeclSpace.
426
427 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
428
429         Fix bug #58688 (MCS does not report error when the same attribute
430         is assigned twice)
431
432         * attribute.cs (Attribute.Emit): Distinction between null and default.
433
434 2004-05-19  Raja R Harinath  <rharinath@novell.com>
435
436         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
437         of a top-level attribute without an attribute target.
438         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
439         Make non-static.
440         (Attribute.Conditional_GetConditionName), 
441         (Attribute.Obsolete_GetObsoleteMessage): Update.
442         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
443         part of ScanForIndexerName.
444         (Attribute.CanIgnoreInvalidAttribute): New function.
445         (Attribute.ScanForIndexerName): Move to ...
446         (Attributes.ScanForIndexerName): ... here.
447         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
448         (Attributes.Search): New internal variant that can choose not to
449         complain if types aren't resolved.  The original signature now
450         complains.
451         (Attributes.GetClsCompliantAttribute): Use internal variant, with
452         complaints suppressed.
453         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
454         only if it not useful.
455         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
456         top-level for attributes that are shared between the assembly
457         and a top-level class.
458         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
459         * class.cs: Update to reflect changes.
460         (DefineIndexers): Fuse loops.
461         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
462         a couple more variants of attribute names.
463
464 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
465
466         Fix bug #52585 (Implemented explicit attribute declaration)
467
468         * attribute.cs:
469         (Attributable.ValidAttributeTargets): New abstract method. It gets
470         list of valid attribute targets for explicit target declaration.
471         (Attribute.Target): It holds target itself.
472         (AttributeSection): Removed.
473         (Attribute.CheckTargets): New method. It checks whether attribute
474         target is valid for the current element.
475
476         * class.cs:
477         (EventProperty): New class. For events that are declared like
478         property (with add and remove accessors).
479         (EventField): New class. For events that are declared like field.
480         class.cs
481
482         * cs-parser.jay: Implemented explicit attribute target declaration.
483
484         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
485         Override ValidAttributeTargets.
486
487         * parameter.cs:
488         (ReturnParameter): Class for applying custom attributes on 
489         the return type.
490         (ParameterAtribute): New class. Class for applying custom
491         attributes on the parameter type.
492
493 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
494
495         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
496         definitions. 
497
498         (Method): Allow UNSAFE here.
499
500         * modifiers.cs: Support unsafe reporting.
501
502 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
503
504         * decl.cs: Fix bug #58478.
505
506 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
507
508         * statement.cs: When checking for unreachable code on an EmptyStatement,
509         set the location. Fixes bug #58488.
510
511 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
512
513         * driver.cs: Add -pkg handling.
514
515         From Gonzalo: UseShelLExecute=false
516
517 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
518
519         * attribute.cs:
520         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
521         for attribute.
522         (Attribute.IsClsCompliaceRequired): Moved to base for better
523         accesibility.
524         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
525         when attribute is AttributeUsageAttribute.
526         (Attribute.GetValidTargets): Simplified.
527         (Attribute.GetAttributeUsage): New method returns AttributeUsage
528         attribute for this type.
529         (Attribute.ApplyAttributes): Method renamed to Emit and make
530         non-static.
531         (GlobalAttributeSection): New class for special handling of global
532         attributes (assembly, module).
533         (AttributeSection.Emit): New method.
534
535         * class.cs: Implemented Attributable abstract methods.
536         (MethodCore.LabelParameters): Moved to Parameter class.
537         (Accessor): Is back simple class.
538         (PropertyMethod): Implemented Attributable abstract class.
539         (DelegateMethod): Implemented Attributable abstract class.
540         (Event): New constructor for disctintion between normal Event
541         and Event with accessors.
542
543         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
544
545         * codegen.cs, const.cs, decl.cs, delegate.cs:
546         (CommonAssemblyModulClass): Implemented Attributable abstract class
547         and simplified.
548
549         * enum.cs: Implement IAttributeSupport interface.
550         (EnumMember): New class for emum members. Implemented Attributable
551         abstract class
552
553         * parameter.cs:
554         (ParameterBase): Is abstract.
555         (ReturnParameter): New class for easier [return:] attribute handling.
556
557         * typemanager.cs: Removed builder_to_attr.
558
559 2004-05-11  Raja R Harinath  <rharinath@novell.com>
560
561         Fix bug #57151.
562         * attribute.cs (Attribute.GetPositionalValue): New function.
563         * class.cs (TypeContainer.VerifyMembers): New function.
564         (TypeContainer.Emit): Use it.
565         (ClassOrStruct): New base class for Class and Struct.
566         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
567         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
568         class.
569         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
570         then each non-static field should have a FieldOffset attribute.
571         Otherwise, none of the fields should have a FieldOffset attribute.
572         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
573         and FieldOffset attributes.
574         * typemanager.cs (TypeManager.struct_layout_attribute_type)
575         (TypeManager.field_offset_attribute_type): New core types.
576         (TypeManager.InitCoreTypes): Initialize them.
577
578 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
579
580         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
581         Return correct type.
582         From bug #58270.
583
584 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
585
586         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
587         be implicitly converted to ulong.
588         
589         * expression.cs: The logic for allowing operator &, | and ^ worked
590         was wrong, it worked before because we did not report an error in
591         an else branch.  Fixes 57895.
592
593         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
594         allow volatile fields to be reference types.
595
596 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
597
598         * driver.cs: Add support for /debug-
599
600 2004-05-07  Raja R Harinath  <rharinath@novell.com>
601
602         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
603         Add a 'complain' parameter to silence errors.
604         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
605         silently overlooked type-resolutions.
606         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
607         to reflect changes.
608         (Attributes.Search): New function.
609         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
610         (Attributes.GetAttributeFullName): Remove hack.
611         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
612         Update to reflect changes.
613         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
614         Use Attributes.Search instead of nested loops.
615
616 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
617
618         * decl.cs:
619         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
620         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
621         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
622
623         * report.cs: (Report.Warning): Renamed to Warning_T because of
624         parameter collision.
625
626 2004-05-05  Raja R Harinath  <rharinath@novell.com>
627
628         * expression.cs (MemberAccess.ResolveMemberAccess):
629         Exit with non-zero status after Report.Error.
630         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
631         Likewise.
632         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
633
634 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
635
636         * support.cs: Don't hang when the file is empty.
637
638 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
639
640         * support.cs: In SeekableStreamReader, compute the preamble size of the
641           underlying stream. Position changes should take into account that initial
642           count of bytes.
643
644 2004-05-03  Todd Berman  <tberman@sevenl.net>
645
646         * driver.cs: remove unused GetSysVersion function.
647
648 2004-05-03  Todd Berman  <tberman@sevenl.net>
649
650         * driver.cs: Remove the hack from saturday, as well as the hack
651         from jackson (LoadAssemblyFromGac), also adds the CWD to the
652         link_paths to get that bit proper.
653
654 2004-05-01  Todd Berman  <tberman@sevenl.net>
655
656         * driver.cs: Try a LoadFrom before a Load, this checks the current
657         path. This is currently a bug in mono that is be fixed, however, this
658         provides a workaround for now. This will be removed when the bug
659         is fixed.
660
661 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
662
663         * CryptoConvert.cs: Updated to latest version. Fix issue with 
664         incomplete key pairs (#57941).
665
666 2004-05-01  Todd Berman  <tberman@sevenl.net>
667
668         * driver.cs: Remove '.' from path_chars, now System.* loads properly
669         from the GAC
670
671 2004-04-30  Jackson Harper  <jackson@ximian.com>
672
673         * codegen.cs: Open keys readonly.
674         
675 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
676
677         * typemanager.cs: don't report cyclic struct layout when a struct
678         contains 2 or more fields of the same type. Failed for Pango.AttrShape
679         which has 2 Pango.Rectangle fields.
680
681 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
682
683         * expression.cs: Handle IntPtr comparisons with IL code
684         rather than a method call.
685
686 2004-04-29  Martin Baulig  <martin@ximian.com>
687
688         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
689         the list of PropertyInfo's in class hierarchy and find the
690         accessor.  Fixes #56013.
691
692 2004-04-29  Martin Baulig  <martin@ximian.com>
693
694         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
695
696 2004-04-29  Martin Baulig  <martin@ximian.com>
697
698         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
699
700         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
701
702 2004-04-29  Martin Baulig  <martin@ximian.com>
703
704         * class.cs (ConstructorInitializer.Resolve): Check whether the
705         parent .ctor is accessible.  Fixes #52146.
706
707 2004-04-29  Martin Baulig  <martin@ximian.com>
708
709         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
710
711         * statement.cs (Using.EmitLocalVariableDecls): Use
712         TypeManager.idisposable_type, not typeof (IDisposable).
713         (Foreach.EmitCollectionForeach): Added support for valuetypes.
714
715 2004-04-29  Martin Baulig  <martin@ximian.com>
716
717         * class.cs (Event.Define): Don't emit the field and don't set
718         RTSpecialName and SpecialName for events on interfaces.  Fixes
719         #57703. 
720
721 2004-04-29  Raja R Harinath  <rharinath@novell.com>
722
723         Refactor Attribute.ApplyAttributes.
724         * attribute.cs (Attributable): New base class for objects that can
725         have Attributes applied on them.
726         (Attribute): Make AttributeUsage fields public.
727         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
728         (Attribute.IsInternalCall): New property.
729         (Attribute.UsageAttr): Convert to a public read-only property.
730         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
731         (Attribute.ResolveType, Attribute.Resolve)
732         (Attribute.ScanForIndexerName): Update to reflect changes.
733         (Attribute.CheckAttributeTarget): Re-format.
734         (Attribute.ApplyAttributes): Refactor, to various
735         Attributable.ApplyAttributeBuilder methods.
736         * decl.cs (MemberCore): Make Attributable.
737         * class.cs (Accessor): Make Attributable.
738         (MethodData.ApplyAttributes): Use proper attribute types, not
739         attribute names.
740         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
741         (TypeContainer.ApplyAttributeBuilder)
742         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
743         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
744         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
745         (Operator.ApplyAttributeBuilder): New factored-out methods.
746         * const.cs (Const.ApplyAttributeBuilder): Likewise.
747         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
748         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
749         * parameter.cs (ParameterBase): New Attributable base class
750         that can also represent Return types.
751         (Parameter): Update to the changes.
752
753 2004-04-29  Jackson Harper  <jackson@ximian.com>
754
755         * driver.cs: Prefer the corlib system version when looking for
756         assemblies in the GAC. This is still a hack, but its a better hack
757         now.
758         
759 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
760
761         * decl.cs, enum.cs: Improved error 3005 reporting.
762   
763         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
764         (related_symbols): New private member for list of symbols
765         related to reported error/warning.
766         
767         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
768
769 2004-04-29  Martin Baulig  <martin@ximian.com>
770
771         * ecore.cs (Expression.Constantify): If we're an enum and
772         TypeManager.TypeToCoreType() doesn't give us another type, use
773         t.UnderlyingSystemType.  Fixes #56178.  
774
775 2004-04-29  Martin Baulig  <martin@ximian.com>
776
777         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
778         interfaces and for each interface, only add members directly
779         declared in that interface.  Fixes #53255.
780
781 2004-04-28  Martin Baulig  <martin@ximian.com>
782
783         * expression.cs (ConditionalLogicalOperator): Use a temporary
784         variable for `left' to avoid that we evaluate it more than once;
785         bug #52588.
786
787 2004-04-28  Martin Baulig  <martin@ximian.com>
788
789         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
790         `void[]' (CS1547).
791
792 2004-04-28  Martin Baulig  <martin@ximian.com>
793
794         * statement.cs (LocalInfo.Resolve): Check whether the type is not
795         void (CS1547).
796
797         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
798         whether the type is not void (CS1547).
799
800 2004-04-28  Martin Baulig  <martin@ximian.com>
801
802         * expression.cs (Unary.DoResolveLValue): Override this and report
803         CS0131 for anything but Operator.Indirection.
804
805 2004-04-28  Martin Baulig  <martin@ximian.com>
806
807         Committing a patch from Ben Maurer; see bug #50820.
808
809         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
810         check for classes.
811
812         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
813         classes.        
814
815 2004-04-28  Martin Baulig  <martin@ximian.com>
816
817         Committing a patch from Ben Maurer; see bug #50820.
818
819         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
820         check for classes.
821
822         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
823         classes.        
824
825 2004-04-28  Martin Baulig  <martin@ximian.com>
826
827         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
828         (Block.AddLabel): Call DoLookupLabel() to only search in the
829         current block.
830
831 2004-04-28  Martin Baulig  <martin@ximian.com>
832
833         * cfold.cs (ConstantFold.BinaryFold): Added special support for
834         comparing StringConstants and NullLiterals in Equality and Inequality.
835
836 2004-04-28  Jackson Harper  <jackson@ximian.com>
837
838         * driver.cs: Attempt to load referenced assemblies from the
839         GAC. This is the quick and dirty version of this method that
840         doesnt take into account versions and just takes the first
841         canidate found. Will be good enough for now as we will not have more
842         then one version installed into the GAC until I update this method.
843
844 2004-04-28  Martin Baulig  <martin@ximian.com>
845
846         * typemanager.cs (TypeManager.CheckStructCycles): New public
847         static method to check for cycles in the struct layout.
848
849         * rootcontext.cs (RootContext.PopulateTypes): Call
850         TypeManager.CheckStructCycles() for each TypeContainer.
851         [Note: We only need to visit each type once.]
852
853 2004-04-28  Martin Baulig  <martin@ximian.com>
854
855         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
856
857         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
858         success and added `out object value'.  Use a `bool resolved' field
859         to check whether we've already been called rather than
860         `ConstantValue != null' since this breaks for NullLiterals.
861
862 2004-04-28  Raja R Harinath  <rharinath@novell.com>
863
864         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
865         setting of this flag, since the 'set' method may be non-public.
866
867 2004-04-28  Raja R Harinath  <rharinath@novell.com>
868
869         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
870         check on current_vector.Block.
871
872 2004-04-27  Martin Baulig  <martin@ximian.com>
873
874         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
875         a field initializer.  Fixes #56459.
876
877 2004-04-27  Martin Baulig  <martin@ximian.com>
878
879         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
880         we're not attempting to use an indexer.  Fixes #52154.
881
882 2004-04-27  Martin Baulig  <martin@ximian.com>
883
884         * statement.cs (Return): Don't create a return label if we don't
885         need it; reverts my change from January 20th.  Thanks to Ben
886         Maurer for this.
887
888 2004-04-27  Martin Baulig  <martin@ximian.com>
889
890         According to the spec, `goto' can only leave a nested scope, but
891         never enter it.
892
893         * statement.cs (Block.LookupLabel): Only lookup in the current
894         block, don't recurse into parent or child blocks.
895         (Block.AddLabel): Check in parent and child blocks, report
896         CS0140/CS0158 if we find a duplicate.
897         (Block): Removed this indexer for label lookups.
898         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
899         this already does the error reporting for us.
900
901         * flowanalysis.cs
902         (FlowBranching.UsageVector.Block): New public variable; may be null.
903         (FlowBranching.CreateSibling): Added `Block' argument.
904         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
905         label for the target of a `goto' and check whether we're not
906         leaving a `finally'.
907
908 2004-04-27  Martin Baulig  <martin@ximian.com>
909
910         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
911         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
912         just for returns).
913
914 2004-04-27  Martin Baulig  <martin@ximian.com>
915
916         * statement.cs (Block.AddLabel): Also check for implicit blocks
917         and added a CS0158 check.
918
919 2004-04-27  Martin Baulig  <martin@ximian.com>
920
921         * flowanalysis.cs (FlowBranchingLoop): New class.
922         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
923         UsageVector's instead of an ArrayList.
924         (FlowBranching.Label): Likewise.
925         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
926         (FlowBranching.AddBreakVector): New method.
927
928 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
929
930         * attribute.cs: Small regression fix: only convert the type if we
931         the type is different, fixes System.Drawing build.
932
933 2004-04-27  Martin Baulig  <martin@ximian.com>
934
935         * attribute.cs (Attribute.Resolve): If we have a constant value
936         for a named field or property, implicity convert it to the correct
937         type.
938
939 2004-04-27  Raja R Harinath  <rharinath@novell.com>
940
941         * statement.cs (Block.Block): Implicit blocks share
942         'child_variable_names' fields with parent blocks.
943         (Block.AddChildVariableNames): Remove.
944         (Block.AddVariable): Mark variable as "used by a child block" in
945         every surrounding block.
946         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
947         been used in a child block, complain about violation of "Invariant
948         meaning in blocks" rule.
949         * cs-parser.jay (declare_local_variables): Don't use
950         AddChildVariableNames.
951         (foreach_statement): Don't create an implicit block: 'foreach'
952         introduces a scope.
953
954 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
955
956         * convert.cs (ImplicitNumericConversion): 0 is also positive when
957         converting from 0L to ulong.  Fixes 57522.
958
959 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
960
961         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
962         derived class hides via 'new' keyword field from base class (test-242.cs).
963         TODO: Handle this in the more general way.
964         
965         * class.cs (CheckBase): Ditto.
966
967 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
968
969         * decl.cs (caching_flags): New member for storing cached values
970         as bit flags.
971         (MemberCore.Flags): New enum where bit flags for caching_flags
972         are defined.
973         (MemberCore.cls_compliance): Moved to caching_flags.
974         (DeclSpace.Created): Moved to caching_flags.
975
976         * class.cs: Use caching_flags instead of DeclSpace.Created
977         
978 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
979
980         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
981         if we are only a derived class, not a nested class.
982
983         * typemanager.cs: Same as above, but do this at the MemberLookup
984         level (used by field and methods, properties are handled in
985         PropertyExpr).   Allow for the qualified access if we are a nested
986         method. 
987
988 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
989
990         * class.cs: Refactoring.
991         (IMethodData): New inteface; Holds links to parent members
992         to avoid member duplication (reduced memory allocation).
993         (Method): Implemented IMethodData interface.
994         (PropertyBase): New inner classes for get/set methods.
995         (PropertyBase.PropertyMethod): Implemented IMethodData interface
996         (Event): New inner classes for add/remove methods.
997         (Event.DelegateMethod): Implemented IMethodData interface.
998
999         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
1000         EmitContext (related to class.cs refactoring).
1001
1002 2004-04-21  Raja R Harinath  <rharinath@novell.com>
1003
1004         * delegate.cs (Delegate.VerifyApplicability): If the number of
1005         arguments are the same as the number of parameters, first try to
1006         verify applicability ignoring  any 'params' modifier on the last
1007         parameter.
1008         Fixes #56442.
1009
1010 2004-04-16  Raja R Harinath  <rharinath@novell.com>
1011
1012         * class.cs (TypeContainer.AddIndexer): Use
1013         'ExplicitInterfaceName' to determine if interface name was
1014         explicitly specified.  'InterfaceType' is not initialized at this time.
1015         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
1016         Indexers array is already in the required order.  Initialize
1017         'IndexerName' only if there are normal indexers.
1018         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
1019         (TypeContainer.Emit): Emit DefaultMember attribute only if
1020         IndexerName is initialized.
1021         Fixes #56300.
1022
1023 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
1024
1025         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
1026         Fixes #57007
1027
1028 2004-04-15  Raja R Harinath  <rharinath@novell.com>
1029
1030         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
1031         attributes.
1032         Fix for #56456.
1033
1034         * attribute.cs (Attribute.Resolve): Check for duplicate named
1035         attributes.
1036         Fix for #56463.
1037
1038 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
1039
1040         * iterators.cs (MarkYield): track whether we are in an exception,
1041         and generate code accordingly.  Use a temporary value to store the
1042         result for our state.
1043
1044         I had ignored a bit the interaction of try/catch with iterators
1045         since their behavior was not entirely obvious, but now it is
1046         possible to verify that our behavior is the same as MS .NET 2.0
1047
1048         Fixes 54814
1049
1050 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
1051
1052         * iterators.cs: Avoid creating temporaries if there is no work to
1053         do. 
1054
1055         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
1056         Enumerations, use TypeManager.EnumToUnderlying and call
1057         recursively. 
1058
1059         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
1060         bug #57013
1061
1062         (This.Emit): Use EmitContext.EmitThis to emit our
1063         instance variable.
1064
1065         (This.EmitAssign): Ditto.
1066
1067         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
1068         codepaths, we will move all the functionality into
1069         Mono.CSharp.This 
1070
1071         (FieldExpr.EmitAssign): Ditto.
1072
1073         This fixes several hidden bugs that I uncovered while doing a code
1074         review of this today.
1075
1076         * codegen.cs (EmitThis): reworked so the semantics are more clear
1077         and also support value types "this" instances.
1078
1079         * iterators.cs: Changed so that for iterators in value types, we
1080         do not pass the value type as a parameter.  
1081
1082         Initialization of the enumerator helpers is now done in the caller
1083         instead of passing the parameters to the constructors and having
1084         the constructor set the fields.
1085
1086         The fields have now `assembly' visibility instead of private.
1087
1088 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
1089
1090         * expression.cs (Argument.Resolve): Check if fields passed as ref
1091         or out are contained in a MarshalByRefObject.
1092
1093         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
1094         another compiler type.
1095
1096 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
1097
1098         * class.cs (Indexer.Define): use the new name checking method.
1099         Also, return false on an error.
1100         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
1101         (is_identifier_[start/part]_character): make static.
1102
1103 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
1104
1105         * expression.cs (Binary.ResolveOperator): Do no append strings
1106         twice: since we can be invoked more than once (array evaluation)
1107         on the same concatenation, take care of this here.  Based on a fix
1108         from Ben (bug #56454)
1109
1110 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
1111
1112         * codegen.cs: Fix another case where CS1548 must be reported (when 
1113         delay-sign isn't specified and no private is available #56564). Fix
1114         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
1115         error when MCS is used on the MS runtime and we need to delay-sign 
1116         (which seems unsupported by AssemblyBuilder - see #56621).
1117
1118 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
1119
1120         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
1121         (TypeManager.ComputeNamespaces): Faster implementation for
1122         Microsoft runtime.
1123
1124         * compiler.csproj: Updated AssemblyName to mcs.
1125
1126 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
1127
1128         * rootcontext.cs: Add new types to the boot resolution.
1129
1130         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
1131         MulticastDelegate is not allowed.
1132
1133         * typemanager.cs: Add new types to lookup: System.TypedReference
1134         and ArgIterator.
1135
1136         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
1137         check for TypedReference or ArgIterator, they are not allowed. 
1138
1139         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
1140         makes us properly catch 1510 in some conditions (see bug 56016 for
1141         details). 
1142
1143 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
1144
1145         * CryptoConvert.cs: update from corlib version
1146         with endian fixes.
1147
1148 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
1149
1150         * class.cs (Indexer.Define): Check indexername declaration
1151
1152 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
1153
1154         * attribute.cs (IsClsCompliant): Fixed problem with handling
1155         all three states (compliant, not-compliant, undetected).
1156
1157 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
1158
1159         * attribute.cs (Attribute): Location is now public.
1160         (Resolve): Store resolved arguments (pos_values) in attribute class.
1161         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
1162         (GetClsCompliantAttributeValue): New method that gets
1163         CLSCompliantAttribute value.
1164         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
1165         if exists else null.
1166         (AttributeTester): New class for CLS-Compliant verification routines.
1167
1168         * class.cs (Emit): Add CLS-Compliant verification.
1169         (Method.GetSignatureForError): Implemented.
1170         (Constructor.GetSignatureForError): Implemented
1171         (Constructor.HasCompliantArgs): Returns if constructor has
1172         CLS-Compliant arguments.
1173         (Constructor.Emit): Override.
1174         (Construcor.IsIdentifierClsCompliant): New method; For constructors
1175         is needed to test only parameters.
1176         (FieldBase.GetSignatureForError): Implemented.
1177         (TypeContainer): New member for storing base interfaces.
1178         (TypeContainer.FindMembers): Search in base interfaces too.
1179
1180         * codegen.cs (GetClsComplianceAttribute): New method that gets
1181         assembly or module CLSCompliantAttribute value.
1182         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
1183         for assembly.
1184         (ModuleClass.Emit): Add error 3012 test.
1185
1186         * const.cs (Emit): Override and call base for CLS-Compliant tests.
1187
1188         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
1189         state for all decl types.
1190         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
1191         if CLS-Compliant tests are required.
1192         (IsClsCompliaceRequired): New method. Analyze whether code
1193         must be CLS-Compliant.
1194         (IsExposedFromAssembly): New method. Returns true when MemberCore
1195         is exposed from assembly.
1196         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
1197         value or gets cached value.
1198         (HasClsCompliantAttribute): New method. Returns true if MemberCore
1199         is explicitly marked with CLSCompliantAttribute.
1200         (IsIdentifierClsCompliant): New abstract method. This method is
1201         used to testing error 3005.
1202         (IsIdentifierAndParamClsCompliant): New method. Common helper method
1203         for identifier and parameters CLS-Compliant testing.
1204         (VerifyClsCompliance): New method. The main virtual method for
1205         CLS-Compliant verifications.
1206         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
1207         null. I don't know why is null (too many public members !).
1208         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
1209         and get value of first CLSCompliantAttribute that found.
1210
1211         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
1212         (VerifyClsCompliance): Override and add extra tests.
1213
1214         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
1215         clscheck- disable CLS-Compliant verification event if assembly is has
1216         CLSCompliantAttribute(true).
1217
1218         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
1219         ApllyAttribute is now called in emit section as in the other cases.
1220         Possible future Emit integration.
1221         (IsIdentifierClsCompliant): New override.
1222         (VerifyClsCompliance): New override.
1223         (GetEnumeratorName): Returns full enum name.
1224
1225         * parameter.cs (GetSignatureForError): Implemented.
1226
1227         * report.cs (WarningData): New struct for Warning message information.
1228         (LocationOfPreviousError): New method.
1229         (Warning): New method. Reports warning based on the warning table.
1230         (Error_T): New method. Reports error based on the error table.
1231
1232         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
1233         verifications are done here.
1234
1235         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
1236
1237         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
1238         CLSCompliantAttribute.
1239         (all_imported_types): New member holds all imported types from other
1240         assemblies.
1241         (LoadAllImportedTypes): New method fills static table with exported types
1242         from all referenced assemblies.
1243         (Modules): New property returns all assembly modules.
1244
1245 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
1246
1247         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
1248         throwing a parser error.
1249
1250         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
1251         which removes the hardcoded get_/set_ prefixes for properties, as
1252         IL allows for the properties to be named something else.  
1253
1254         Bug #56013
1255
1256         * expression.cs: Do not override operand before we know if it is
1257         non-null.  Fix 56207
1258
1259 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1260
1261         * typemanager.cs: support for pinned variables.
1262
1263 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1264
1265         * decl.cs, typemanager.cs: Avoid using an arraylist
1266         as a buffer if there is only one result set.
1267
1268 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1269
1270         * expression.cs: Make sure you cant call a static method
1271         with an instance expression, bug #56174.
1272
1273 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
1274
1275         * class.cs (IsDuplicateImplementation): Improve error reporting to
1276         flag 663 (method only differs in parameter modifier).
1277
1278         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
1279         in preprocessor directives.
1280
1281         * location.cs (LookupFile): Allow for the empty path.
1282
1283         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
1284         better approach for some of that patch, but its failing with the
1285         CharSet enumeration.  For now try/catch will do.
1286
1287         * typemanager.cs: Do not crash if a struct does not have fields.
1288         Fixes 56150.
1289
1290 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
1291
1292         * expression.cs: cs0213, cant fix a fixed expression.
1293         fixes 50231.
1294
1295 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
1296
1297         * cs-parser.jay: detect invalid embeded statements gracefully.
1298         bug #51113.
1299
1300 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
1301
1302         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
1303         As a regex:
1304         s/
1305         the invocation type may not be a subclass of the tye of the item/
1306         The type of the item must be a subclass of the invocation item.
1307         /g
1308
1309         Fixes bug #50820.
1310
1311 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
1312
1313         * attribute.cs: Added methods to get a string and a bool from an
1314         attribute. Required to information from AssemblyKeyFileAttribute,
1315         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
1316         * codegen.cs: Modified AssemblyName creation to include support for
1317         strongnames. Catch additional exceptions to report them as CS1548.
1318         * compiler.csproj: Updated include CryptoConvert.cs.
1319         * compiler.csproj.user: Removed file - user specific configuration.
1320         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
1321         Mono.Security assembly. The original class is maintained and tested in
1322         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
1323         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
1324         like CSC 8.0 (C# v2) supports.
1325         * Makefile: Added CryptoConvert.cs to mcs sources.
1326         * rootcontext.cs: Added new options for strongnames.
1327
1328 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
1329
1330         * driver.cs: For --expect-error, report error code `2'
1331         if the program compiled with no errors, error code `1' if
1332         it compiled with an error other than the one expected.
1333
1334 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
1335
1336         * compiler.csproj: Updated for Visual Studio .NET 2003.
1337         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
1338         * compiler.sln: Updated for Visual Studio .NET 2003.
1339
1340 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
1341
1342         * expression.cs: Fix bug #47234. We basically need to apply the
1343         rule that we prefer the conversion of null to a reference type
1344         when faced with a conversion to 'object' (csc behaviour).
1345
1346 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1347
1348         * statement.cs: Shorter form for foreach, eliminates
1349         a local variable. r=Martin.
1350
1351 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1352
1353         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
1354         checks if we can use brtrue/brfalse to test for 0.
1355         * expression.cs: use the above in the test for using brtrue/brfalse.
1356         cleanup code a bit.
1357
1358 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1359
1360         * expression.cs: Rewrite string concat stuff. Benefits:
1361
1362         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
1363         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
1364         rather than a concat chain.
1365
1366         * typemanager.cs: Add lookups for more concat overloads.
1367
1368 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1369
1370         * expression.cs: Emit shorter il code for array init.
1371
1372         newarr
1373         dup
1374         // set 1
1375
1376         // set 2
1377
1378         newarr
1379         stloc.x
1380
1381         ldloc.x
1382         // set 1
1383
1384         ldloc.x
1385         // set 2
1386
1387 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
1388
1389         * statement.cs: Before, two switch blocks would be merged if the
1390         total size of the blocks (end_item - begin_item + 1) was less than
1391         two times the combined sizes of the blocks.
1392
1393         Now, it will only merge if after the merge at least half of the
1394         slots are filled.
1395
1396         fixes 55885.
1397
1398 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
1399
1400         * class.cs : csc build fix for GetMethods(). See bug #52503.
1401
1402 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
1403
1404         * expression.cs: Make sure fp comparisons work with NaN.
1405         This fixes bug #54303. Mig approved this patch a long
1406         time ago, but we were not able to test b/c the runtime
1407         had a related bug.
1408
1409 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
1410
1411         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
1412
1413 2004-03-19  Martin Baulig  <martin@ximian.com>
1414
1415         * class.cs (MemberCore.IsDuplicateImplementation): Report the
1416         error here and not in our caller.
1417
1418 2004-03-19  Martin Baulig  <martin@ximian.com>
1419
1420         * interface.cs: Completely killed this file.
1421         (Interface): We're now a TypeContainer and live in class.cs.
1422
1423         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
1424         argument; we're now also called for interfaces.
1425         (TypeContainer.DefineMembers): Allow this method being called
1426         multiple times.
1427         (TypeContainer.GetMethods): New public method; formerly known as
1428         Interface.GetMethod().  This is used by PendingImplementation.
1429         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
1430         it's now private and non-static.
1431         (Interface): Moved this here; it's now implemented similar to
1432         Class and Struct.
1433         (Method, Property, Event, Indexer): Added `bool is_interface'
1434         argument to their .ctor's.
1435         (MemberBase.IsInterface): New public field.
1436
1437         * cs-parser.jay: Create normal Method, Property, Event, Indexer
1438         instances instead of InterfaceMethod, InterfaceProperty, etc.
1439         (opt_interface_base): Removed; we now use `opt_class_base' instead.
1440         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
1441
1442 2004-03-19  Martin Baulig  <martin@ximian.com>
1443
1444         * class.cs (MethodCore.IsDuplicateImplementation): New private
1445         method which does the CS0111 checking.
1446         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
1447         Use IsDuplicateImplementation().
1448
1449 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
1450
1451         * decl.cs (FindMemberToOverride): New method to find the correct
1452         method or property to override in the base class.
1453         * class.cs
1454             - Make Method/Property use the above method to find the
1455               version in the base class.
1456             - Remove the InheritableMemberSignatureCompare as it is now
1457               dead code.
1458
1459         This patch makes large code bases much faster to compile, as it is
1460         O(n) rather than O(n^2) to do this validation.
1461
1462         Also, it fixes bug 52458 which is that nested classes are not
1463         taken into account when finding the base class member.
1464
1465         Reviewed/Approved by Martin.
1466
1467 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
1468
1469         * interface.cs: In all interface classes removed redundant
1470         member initialization.
1471
1472 2004-03-16  Martin Baulig  <martin@ximian.com>
1473
1474         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
1475
1476 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
1477
1478         * decl.cs (DefineTypeAndParents): New helper method to define a
1479         type's containers before the type itself is defined;  This is a
1480         bug exposed by the recent changes to Windows.Forms when an
1481         implemented interface was defined inside a class that had not been
1482         built yet.   
1483
1484         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
1485
1486         (Check): Loop correctly to report errors modifiers
1487         (UNSAFE was not in the loop, since it was the same as TOP).
1488
1489         * interface.cs: Every interface member now takes a ModFlags,
1490         instead of a "is_new" bool, which we set on the base MemberCore. 
1491
1492         Every place where we called "UnsafeOk" in the interface, now we
1493         call the proper member (InterfaceMethod.UnsafeOK) instead to get
1494         the unsafe settings from the member declaration instead of the
1495         container interface. 
1496
1497         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
1498
1499         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
1500         `set_indexer_name' to the pending bits (one per type).
1501
1502         We fixed a bug today that was picking the wrong method to
1503         override, since for properties the existing InterfaceMethod code
1504         basically ignored the method name.  Now we make sure that the
1505         method name is one of the valid indexer names.
1506
1507 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
1508  
1509         * support.cs (SeekableStreamReader): Keep track of stream byte
1510         positions and don't mix them with character offsets to the buffer.
1511
1512         Patch from Gustavo Giráldez
1513
1514 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
1515
1516         * interface.cs (InterfaceSetGetBase): Removed double member
1517         initialization, base class does it as well.
1518
1519 2004-03-13  Martin Baulig  <martin@ximian.com>
1520
1521         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
1522         when compiling corlib.
1523
1524 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
1525
1526         * convert.cs (ExplicitConversion): We were reporting an error on
1527         certain conversions (object_type source to a value type, when the
1528         expression was `null') before we had a chance to pass it through
1529         the user defined conversions.
1530
1531         * driver.cs: Replace / and \ in resource specifications to dots.
1532         Fixes 50752
1533
1534         * class.cs: Add check for duplicate operators.  Fixes 52477
1535
1536 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
1537
1538         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
1539         that are in the middle of the statements, not only at the end.
1540         Fixes #54987
1541
1542         * class.cs (TypeContainer.AddField): No longer set the
1543         `HaveStaticConstructor' flag, now we call it
1544         `UserDefineStaticConstructor' to diferentiate the slightly
1545         semantic difference.
1546
1547         The situation is that we were not adding BeforeFieldInit (from
1548         Modifiers.TypeAttr) to classes that could have it.
1549         BeforeFieldInit should be set to classes that have no static
1550         constructor. 
1551
1552         See:
1553
1554         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
1555
1556         And most importantly Zoltan's comment:
1557
1558         http://bugzilla.ximian.com/show_bug.cgi?id=44229
1559
1560         "I think beforefieldinit means 'it's ok to initialize the type sometime 
1561          before its static fields are used', i.e. initialization does not need
1562          to be triggered by the first access to the type. Setting this flag
1563          helps the JIT to compile better code, since it can run the static
1564          constructor at JIT time, and does not need to generate code to call it
1565          (possibly lots of times) at runtime. Unfortunately, mcs does not set
1566          this flag for lots of classes like String. 
1567          
1568          csc sets this flag if the type does not have an explicit static 
1569          constructor. The reasoning seems to be that if there are only static
1570          initalizers for a type, and no static constructor, then the programmer
1571          does not care when this initialization happens, so beforefieldinit
1572          can be used.
1573          
1574          This bug prevents the AOT compiler from being usable, since it 
1575          generates so many calls to mono_runtime_class_init that the AOT code
1576          is much slower than the JITted code. The JITted code is faster, 
1577          because it does not generate these calls if the vtable is type is
1578          already initialized, which is true in the majority of cases. But the
1579          AOT compiler can't do this."
1580
1581 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
1582
1583         * class.cs (MethodData.Emit): Refactor the code so symbolic
1584         information is generated for destructors;  For some reasons we
1585         were taking a code path that did not generate symbolic information
1586         before. 
1587
1588 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
1589
1590         * class.cs: Create a Constructor.CheckBase method that
1591         takes care of all validation type code. The method
1592         contains some code that was moved from Define.
1593
1594         It also includes new code that checks for duplicate ctors.
1595         This fixes bug #55148.
1596
1597 2004-03-09  Joshua Tauberer <tauberer@for.net>
1598
1599         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
1600         a { ... }-style array creation invokes EmitStaticInitializers
1601         which is not good for reference-type arrays.  String, decimal
1602         and now null constants (NullCast) are not counted toward
1603         static initializers.
1604
1605 2004-03-05  Martin Baulig  <martin@ximian.com>
1606
1607         * location.cs (SourceFile.HasLineDirective): New public field;
1608         specifies whether the file contains or is referenced by a "#line"
1609         directive.
1610         (Location.DefineSymbolDocuments): Ignore source files which
1611         either contain or are referenced by a "#line" directive.        
1612
1613 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
1614
1615         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
1616         direct access to our parent, so check the method inline there.
1617
1618 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
1619
1620         * expression.cs (Invocation.EmitCall): Miguel's last commit
1621         caused a regression. If you had:
1622
1623             T t = null;
1624             t.Foo ();
1625
1626         In Foo the implict this would be null.
1627
1628 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
1629
1630         * expression.cs (Invocation.EmitCall): If the method is not
1631         virtual, do not emit a CallVirt to it, use Call.
1632
1633         * typemanager.cs (GetFullNameSignature): Improve the method to
1634         cope with ".ctor" and replace it with the type name.
1635
1636         * class.cs (ConstructorInitializer.Resolve): Now the method takes
1637         as an argument the ConstructorBuilder where it is being defined,
1638         to catch the recursive constructor invocations.
1639
1640 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
1641
1642         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
1643         routines to check if a type is an enumerable/enumerator allow
1644         classes that implement the IEnumerable or IEnumerator interfaces.
1645
1646         * class.cs (Property, Operator): Implement IIteratorContainer, and
1647         implement SetYields.
1648
1649         (Property.Define): Do the block swapping for get_methods in the
1650         context of iterators.   We need to check if Properties also
1651         include indexers or not.
1652
1653         (Operator): Assign the Block before invoking the
1654         OperatorMethod.Define, so we can trigger the Iterator code
1655         replacement. 
1656
1657         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
1658         Property and Operator classes are not created when we parse the
1659         declarator but until we have the block completed, so we use a
1660         singleton SimpleIteratorContainer.Simple to flag whether the
1661         SetYields has been invoked.
1662
1663         We propagate this setting then to the Property or the Operator to
1664         allow the `yield' to function.
1665
1666 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
1667
1668         * codegen.cs: Implemented attribute support for modules.
1669         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
1670         Assembly/Module functionality.
1671
1672         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
1673         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
1674         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
1675
1676 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
1677
1678         * interface.cs (FindMembers): The operation is performed on all base
1679         interfaces and not only on the first. It is required for future CLS Compliance patch.
1680
1681 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
1682
1683         * statement.cs, codegen.cs:
1684         This patch deals with patterns such as:
1685
1686         public class List : IEnumerable {
1687
1688                 public MyEnumerator GetEnumerator () {
1689                         return new MyEnumerator(this);
1690                 }
1691
1692                 IEnumerator IEnumerable.GetEnumerator () {
1693                         ...
1694                 }
1695                 
1696                 public struct MyEnumerator : IEnumerator {
1697                         ...
1698                 }
1699         }
1700
1701         Before, there were a few things we did wrong:
1702         1) we would emit callvirt on a struct, which is illegal
1703         2) we emited ldarg when we needed to emit ldarga
1704         3) we would mistakenly call the interface methods on an enumerator
1705         type that derived from IEnumerator and was in another assembly. For example:
1706
1707         public class MyEnumerator : IEnumerator
1708
1709         Would have the interface methods called, even if there were public impls of the
1710         method. In a struct, this lead to invalid IL code.
1711
1712 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
1715           renamed to Emit.
1716
1717         * delegate.cs (Define): Fixed crash when delegate type is undefined.
1718
1719 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
1720
1721         * cs-parser.jay: Fix small regression: we were not testing V2
1722         compiler features correctly.
1723
1724         * interface.cs: If the emit context is null, then create one
1725
1726 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
1727
1728         * decl.cs (GetSignatureForError): New virtual method to get full name
1729           for error messages.
1730
1731         * attribute.cs (IAttributeSupport): New interface for attribute setting.
1732           Now it is possible to rewrite ApplyAttributes method to be less if/else.
1733
1734         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
1735           Duplicated members and code in these classes has been removed.
1736           Better encapsulation in these classes.
1737
1738 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
1739
1740         * assign.cs (Assign.DoResolve): When dealing with compound
1741         assignments, there is a new rule in ECMA C# 2.4 (might have been
1742         there before, but it is documented here) that states that in:
1743
1744         a op= b;
1745
1746         If b is of type int, and the `op' is a shift-operator, then the
1747         above is evaluated as:
1748
1749         a = (int) a op b 
1750
1751         * expression.cs (Binary.ResolveOperator): Instead of testing for
1752         int/uint/long/ulong, try to implicitly convert to any of those
1753         types and use that in pointer arithmetic.
1754
1755         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
1756         method to print information for from the type, not from the
1757         null-method we were given.
1758
1759 2004-02-01  Duncan Mak  <duncan@ximian.com>
1760
1761         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
1762         parsing for cmd, fixes bug #53694.
1763
1764 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
1765
1766         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
1767         in the member name duplication tests. Property and operator name duplication
1768         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
1769
1770 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
1771
1772         * interface.cs (PopulateMethod): Fixed crash when interface method
1773         returns not existing type (error test cs0246-3.cs).
1774
1775 2004-02-02  Ravi Pratap M <ravi@ximian.com>
1776
1777         * cs-parser.jay (interface_accessors): Re-write actions to also
1778         store attributes attached to get and set methods. Fix spelling
1779         while at it.
1780
1781         (inteface_property_declaration): Modify accordingly.
1782
1783         (InterfaceAccessorInfo): New helper class to store information to pass
1784         around between rules that use interface_accessors.
1785
1786         * interface.cs (Emit): Apply attributes on the get and set
1787         accessors of properties and indexers too.
1788
1789         * attribute.cs (ApplyAttributes): Modify accordingly to use the
1790         right MethodBuilder when applying attributes to the get and set accessors.
1791
1792 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
1793
1794         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
1795
1796 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
1797
1798         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
1799
1800 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
1801
1802         * cs-parser.jay: Remove YIELD token, instead use the new grammar
1803         changes that treat `yield' specially when present before `break'
1804         or `return' tokens.
1805
1806         * cs-tokenizer.cs: yield is no longer a keyword.
1807
1808 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
1809
1810         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
1811         setting for default constructors.
1812         For default constructors are almost every time set wrong Modifier. The
1813         generated IL code has been alright. But inside mcs this values was
1814         wrong and this was reason why several of my CLS Compliance tests
1815         failed.
1816
1817 2004-01-22  Martin Baulig  <martin@ximian.com>
1818
1819         * cs-parser.jay (namespace_or_type_name): Return an Expression,
1820         not a QualifiedIdentifier.  This is what `type_name_expression'
1821         was previously doing.
1822         (type_name_expression): Removed; the code is now in
1823         `namespace_or_type_name'.
1824         (qualified_identifier): Removed, use `namespace_or_type_name'
1825         instead.
1826         (QualifiedIdentifier): Removed this class.      
1827
1828 2004-01-22  Martin Baulig  <martin@ximian.com>
1829
1830         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
1831         not a string as alias name.
1832
1833 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
1834
1835         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
1836         #52730 bug, and instead compute correctly the need to use a
1837         temporary variable when requesting an address based on the
1838         static/instace modified of the field and the constructor.
1839  
1840 2004-01-21  Martin Baulig  <martin@ximian.com>
1841
1842         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
1843         class and namespace before looking up aliases.  Fixes #52517.
1844
1845 2004-01-21  Martin Baulig  <martin@ximian.com>
1846
1847         * flowanalysis.cs (UsageVector.Merge): Allow variables being
1848         assinged in a 'try'; fixes exception4.cs.
1849
1850 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
1851         * class.cs : Implemented parameter-less constructor for TypeContainer
1852
1853         * decl.cs: Attributes are now stored here. New property OptAttributes
1854
1855         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
1856
1857         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
1858
1859 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
1860
1861         * typemanager.cs (CSharpSignature): Now reports also inner class name.
1862           (CSharpSignature): New method for indexer and property signature.
1863
1864 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
1865
1866         * pending.cs (IsVirtualFilter): Faster implementation.
1867
1868 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
1869
1870         * typemanager.cs: Avoid inclusion of same assembly more than once.
1871
1872 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
1873
1874         * cs-parser.jay: Fixed problem where the last assembly attribute
1875           has been applied also to following declaration (class, struct, etc.)
1876           
1877 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
1878
1879         * class.cs: Added error CS0538, CS0539 reporting.
1880         Fixed crash on Microsoft runtime when field type is void.
1881
1882         * cs-parser.jay: Added error CS0537 reporting.
1883
1884         * pending.cs: Added error CS0535 reporting.
1885         Improved error report for errors CS0536, CS0534.
1886
1887 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
1888
1889         Merge a few bits from the Anonymous Method MCS tree.
1890
1891         * statement.cs (ToplevelBlock): New class for toplevel methods,
1892         will hold anonymous methods, lifted variables.
1893
1894         * cs-parser.jay: Create toplevel blocks for delegates and for
1895         regular blocks of code. 
1896
1897 2004-01-20  Martin Baulig  <martin@ximian.com>
1898
1899         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
1900         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
1901         and `NeedExplicitReturn'; added `IsLastStatement'.
1902         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
1903         have a `ReturnLabel' or we're not unreachable.
1904
1905         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
1906         child's reachability; don't just override ours with it.  Fixes
1907         #58058 (lluis's example).
1908         (FlowBranching): Added public InTryOrCatch(), InCatch(),
1909         InFinally(), InLoop(), InSwitch() and
1910         BreakCrossesTryCatchBoundary() methods.
1911
1912         * statement.cs (Return): Do all error checking in Resolve().
1913         Unless we are the last statement in a top-level block, always
1914         create a return label and jump to it.
1915         (Break, Continue): Do all error checking in Resolve(); also make
1916         sure we aren't leaving a `finally'.
1917         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
1918         statement in a top-level block.
1919         (Block.Flags): Added `IsDestructor'.
1920         (Block.IsDestructor): New public property.
1921
1922 2004-01-20  Martin Baulig  <martin@ximian.com>
1923
1924         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
1925
1926 2004-01-20  Martin Baulig  <martin@ximian.com>
1927
1928         * statement.cs (Statement.ResolveUnreachable): New public method.
1929         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
1930         (Block.Resolve): Resolve unreachable statements.
1931
1932 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
1933
1934         * expression.cs: We need to fix the case where we do
1935         not have a temp variable here.
1936
1937         * assign.cs: Only expression compound assignments need
1938         temporary variables.
1939
1940 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
1941
1942         * flowanalysis.cs: Reduce memory allocation in a few ways:
1943           - A block with no variables should not allocate a bit
1944             vector for itself.
1945           - A method with no out parameters does not need any tracking
1946             for assignment of the parameters, so we need not allocate
1947             any data for it.
1948           - The arrays:
1949                 public readonly Type[] VariableTypes;
1950                 public readonly string[] VariableNames;
1951             Are redundant. The data is already stored in the variable
1952             map, so we need not allocate another array for it.
1953           - We need to add alot of checks for if (params | locals) == null
1954             due to the first two changes.
1955
1956 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
1957
1958         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
1959         implement IMemoryLocation, we store a copy on a local variable and
1960         take the address of it.  Patch from Benjamin Jemlich
1961
1962         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
1963         to use a special "type_name_expression" rule which reduces the
1964         number of "QualifiedIdentifier" classes created, and instead
1965         directly creates MemberAccess expressions.
1966
1967 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
1968
1969         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
1970         that fixes #52853.  Null literal assignment to ValueType
1971
1972         * class.cs (MethodData.Emit): Instead of checking the name of the
1973         method to determine if its a destructor, create a new derived
1974         class from Method called Destructor, and test for that.  
1975
1976         * cs-parser.jay: Create a Destructor object instead of a Method.  
1977
1978         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
1979
1980         Fixes: 52933
1981
1982 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
1983
1984         * expression.cs (Binary.ResolveOperator): Perform an implicit
1985         conversion from MethodGroups to their delegate types on the
1986         Addition operation.
1987
1988         * delegate.cs: Introduce a new class DelegateCreation that is the
1989         base class for `NewDelegate' and `ImplicitDelegateCreation',
1990         factor some code in here.
1991
1992         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
1993         conversion from MethodGroups to compatible delegate types. 
1994
1995         * ecore.cs (Expression.Resolve): Do not flag error 654
1996         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
1997         we allow conversions from MethodGroups to delegate types now.
1998
1999         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
2000         assignments in v2 either.
2001
2002 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
2003
2004         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
2005         static read-only fields in ctors.
2006
2007         Applied patch from Benjamin Jemlich 
2008
2009         * expression.cs (UnaryMutator): Avoid leaking local variables. 
2010
2011 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
2012
2013         * cs-tokenizer.cs (IsCastToken): Allow the various native types
2014         here to return true, as they can be used like this:
2015
2016                 (XXX) int.MEMBER ()
2017
2018         Fixed 49836 and all the other dups
2019
2020 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
2021
2022         * driver.cs: Implement /win32res and /win32icon.
2023
2024 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
2025
2026         * cs-parser.jay: Add a rule to improve error handling for the
2027         common mistake of placing modifiers after the type.
2028
2029 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
2030
2031         * cs-parser.jay (interface_event_declaration): Catch
2032         initialization of events on interfaces, and report cs0068
2033
2034         * cs-parser.jay (interface_event_declaration): Catch
2035         initialization of events. 
2036
2037         * ecore.cs: Better report missing constructors.
2038
2039         * expression.cs (Binary.ResolveOperator): My previous bug fix had
2040         the error reporting done in the wrong place.  Fix.
2041
2042         * expression.cs (Binary.ResolveOperator): Catch the 
2043         operator + (E x, E y) error earlier, and later allow for implicit
2044         conversions in operator +/- (E e, U x) from U to the underlying
2045         type of E.
2046
2047         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
2048         52596, if the container class is abstract, the default constructor
2049         is protected otherwise its public (before, we were always public).
2050
2051         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
2052         fixed statement.
2053
2054         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
2055         Jemlich that fixes bug #52597, MCS was generating invalid code for
2056         idisposable structs.   Thanks to Ben for following up with this
2057         bug as well.
2058
2059 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
2060
2061         * driver.cs: Allow assemblies without code to be generated, fixes
2062         52230.
2063
2064 2004-01-07  Nick Drochak <ndrochak@gol.com>
2065
2066         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
2067
2068 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
2069
2070         * cs-parser.jay: Add rules to improve error reporting if fields or
2071         methods are declared at the namespace level (error 116)
2072
2073         * Add rules to catch event add/remove
2074
2075 2004-01-04  David Sheldon <dave-mono@earth.li>
2076
2077   * expression.cs: Added matching ")" to error message for 
2078   CS0077
2079
2080 2004-01-03 Todd Berman <tberman@gentoo.org>
2081
2082         * ecore.cs, attribute.cs:
2083         Applying fix from #52429.
2084
2085 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2086
2087         * ecore.cs, expression.cs, statement.cs:
2088         Total rewrite of how we handle branching. We
2089         now handle complex boolean expressions with fewer
2090         jumps. As well if (x == 0) no longer emits a ceq.
2091
2092         if (x is Foo) is much faster now, because we generate
2093         better code.
2094
2095         Overall, we get a pretty big improvement on our benchmark
2096         tests. The code we generate is smaller and more readable.
2097
2098         I did a full two-stage bootstrap. The patch was reviewed
2099         by Martin and Miguel.
2100
2101 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2102
2103         * cs-parser.jay: Make primary_expression not take a QI.
2104         we dont need this because the member_access rule covers
2105         us here. So we replace the rule with just IDENTIFIER.
2106
2107         This has two good effects. First, we remove a s/r conflict.
2108         Second, we allocate many fewer QualifiedIdentifier objects.
2109
2110 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2111
2112         * attribute.cs: Handle MarshalAs attributes as pseudo, and
2113         set the correct information via SRE. This prevents
2114         hanging on the MS runtime. Fixes #29374.
2115
2116 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2117
2118         * convert.cs: correctly handle conversions to value types
2119         from Enum and ValueType as unboxing conversions.
2120
2121         Fixes bug #52569. Patch by Benjamin Jemlich.
2122
2123 2004-01-02  Ravi Pratap  <ravi@ximian.com>
2124
2125         * expression.cs (BetterConversion): Prefer int -> uint
2126         over int -> ulong (csc's behaviour). This fixed bug #52046.
2127
2128 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
2129
2130         * decl.cs (MemberCache.FindMembers): now returns a
2131         MemberInfo [].
2132
2133         * typemanager.cs: In general, go with with ^^.
2134         (CopyNewMethods): take an IList.
2135         (RealMemberLookup): Only allocate an arraylist
2136         if we copy from two sets of methods.
2137
2138         This change basically does two things:
2139         1) Fewer array lists allocated due to CopyNewMethods.
2140         2) the explicit cast in MemberList costed ALOT.
2141
2142 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
2143
2144         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
2145         a hashtable to avoid needless string allocations when an identifier is
2146         used more than once (the common case).
2147
2148 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
2149
2150         * pending.cs: MS's TypeBuilder.GetInterfaces ()
2151         is broken, it will not return anything. So, we
2152         have to use the information we have in mcs to
2153         do the task.
2154
2155         * typemanager.cs: Add a cache for GetInterfaces,
2156         since this will now be used more often (due to ^^)
2157
2158         (GetExplicitInterfaces) New method that gets the
2159         declared, not effective, interfaces on a type
2160         builder (eg, if you have interface IFoo, interface
2161         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
2162         { IBar }.
2163
2164         This patch makes MCS able to bootstrap itself on
2165         Windows again.
2166
2167 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
2168
2169         * expression.cs: Remove the Nop's that Miguel put
2170         in by mistake.
2171
2172 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2173
2174         * report.cs, codegen.cs: Give the real stack trace to
2175         the error when an exception is thrown.
2176
2177 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2178
2179         * decl.cs: only allocate hashtables for ifaces if 
2180         it is an iface!
2181
2182 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2183
2184         * expression.cs: fix the error from cs0121-2.cs
2185         (a parent interface has two child interfaces that
2186         have a function with the same name and 0 params
2187         and the function is called through the parent).
2188
2189 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2190
2191         * class.cs, rootcontext.cs, typmanager.cs: do not
2192         leak pointers.
2193
2194 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2195
2196         * codegen.cs: remove stack for the ec flow branching.
2197         It is already a linked list, so no need.
2198
2199 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
2200
2201         * Makefile: Allow custom profiler here.
2202
2203 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
2204
2205         * typemanager.cs (LookupType):
2206           - Use a static char [], because split takes
2207             a param array for args, so it was allocating
2208             every time.
2209           - Do not store true in a hashtable, it boxes.
2210
2211 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
2212
2213         * flowanalysis.cs: bytify common enums.
2214
2215 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
2216
2217         * modifiers.cs: Add a new set of flags for the
2218         flags allowed on explicit interface impls.
2219         * cs-parser.jay: catch the use of modifiers in
2220         interfaces correctly.
2221         * class.cs: catch private void IFoo.Blah ().
2222
2223         All related to bug #50572.
2224
2225 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
2226
2227         * decl.cs: Rewrite the consistant accessability checking.
2228         Accessability is not linear, it must be implemented in
2229         a tableish way. Fixes #49704.
2230
2231 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
2232
2233         * expression.cs: Handle negation in a checked context.
2234         We must use subtraction from zero. Fixes #38674.
2235
2236 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2237
2238         * class.cs: Ignore static void main in DLLs.
2239         * rootcontext.cs: Handle the target type here,
2240         since we are have to access it from class.cs
2241         * driver.cs: account for the above.
2242
2243 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2244
2245         * report.cs: Give line numbers and files if available.
2246
2247 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
2248
2249         * driver.cs: Implement /addmodule.
2250
2251         * typemanager.cs:  Change 'modules' field so it now contains Modules not
2252         ModuleBuilders.
2253
2254 2003-12-20  Martin Baulig  <martin@ximian.com>
2255
2256         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
2257         (FieldBase.IsAssigned): Removed this field.
2258         (FieldBase.SetAssigned): New public method.
2259         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
2260
2261 2003-12-20  Martin Baulig  <martin@ximian.com>
2262
2263         * expression.cs (LocalVariableReference.DoResolve): Don't set
2264         `vi.Used' if we're called from DoResolveLValue().
2265
2266         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
2267         returns the usage vector it just merged into the current one -
2268         pass this one to UsageWarning().
2269         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
2270         of the `EmitContext', don't call this recursively on our children.
2271
2272 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
2273
2274         * driver.cs: Implement /target:module.
2275
2276 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
2277
2278         * support.cs (CharArrayHashtable): New helper class.
2279
2280         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
2281         char arrays, not strings, so we can avoid creating a string in
2282         consume_identifier if the identifier is a keyword.
2283
2284 2003-12-16  Martin Baulig  <martin@ximian.com>
2285
2286         * statement.cs (LocalInfo.Assigned): Removed this property.
2287         (LocalInfo.Flags): Removed `Assigned'.
2288         (LocalInfo.IsAssigned): New public method; takes the EmitContext
2289         and uses flow analysis.
2290         (Block.UsageWarning): Made this method private.
2291         (Block.Resolve): Call UsageWarning() if appropriate.
2292
2293         * expression.cs (LocalVariableReference.DoResolve): Always set
2294         LocalInfo.Used here.
2295
2296 2003-12-13  Martin Baulig  <martin@ximian.com>
2297
2298         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
2299         any value here; we're now using flow analysis to figure out
2300         whether a statement/block returns a value.
2301
2302 2003-12-13  Martin Baulig  <martin@ximian.com>
2303
2304         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
2305         working again.
2306         (FlowBranching.MergeFinally): Don't call
2307         `branching.CheckOutParameters()' here, this is called in
2308         MergeTopBlock().
2309         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
2310         when adding the `finally' vector.       
2311
2312 2003-12-13  Martin Baulig  <martin@ximian.com>
2313
2314         * flowanalysis.cs
2315         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
2316         actually work and also fix #48962.
2317
2318 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
2319
2320         * decl.cs: Do not check System.Object for nested types,
2321         since we know it does not have any. Big bang for buck:
2322
2323         BEFORE:
2324            Run 1:   8.35 seconds
2325            Run 2:   8.32 seconds
2326            corlib:  17.99 seconds
2327         AFTER:
2328            Run 1:   8.17 seconds
2329            Run 2:   8.17 seconds
2330            corlib:  17.39 seconds
2331
2332 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
2333
2334         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
2335         time we are returning 0 members, so we save alot here.
2336
2337 2003-12-11  Martin Baulig  <martin@ximian.com>
2338
2339         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
2340         `MergeChild()', also just take the `FlowBranching' as argument;
2341         call Merge() on it and return the result.
2342         (FlowBranching.Merge): We don't need to do anything if we just
2343         have one sibling.
2344
2345 2003-12-11  Martin Baulig  <martin@ximian.com>
2346
2347         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
2348         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
2349         Maurer for this idea.
2350
2351 2003-12-11  Martin Baulig  <martin@ximian.com>
2352
2353         * flowanalysis.cs (MergeResult): This class is now gone; we now
2354         use the `UsageVector' for this.  The reason for this is that if a
2355         branching just has one sibling, we don't need to "merge" them at
2356         all - that's the next step to do.
2357         (FlowBranching.Merge): We now return a `UsageVector' instead of a
2358         `MergeResult'.
2359
2360 2003-12-11  Martin Baulig  <martin@ximian.com>
2361
2362         Reworked flow analyis and made it more precise and bug-free.  The
2363         most important change is that we're now using a special `Reachability'
2364         class instead of having "magic" meanings of `FlowReturns'.  I'll
2365         do some more cleanups and optimizations and also add some more
2366         documentation this week.
2367
2368         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
2369         largely reworked this class.
2370         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
2371         the new `Reachability' class instead of having "magic" values here.
2372         (FlowBranching): We're now using an instance of `Reachability'
2373         instead of having separate `Returns', `Breaks' etc. fields.
2374
2375         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
2376         based on flow analysis; ignore the return value of block.Emit ().
2377
2378 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
2379
2380         * driver.cs typemanager.cs: Find the mono extensions to corlib even
2381         if they are private.
2382
2383 2003-12-09  Martin Baulig  <martin@ximian.com>
2384
2385         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
2386         call them directly on the UsageVector.
2387
2388 2003-12-09  Martin Baulig  <martin@ximian.com>
2389
2390         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
2391         Changed return type from `FlowReturns' to `Reachability'.
2392
2393 2003-12-09  Martin Baulig  <martin@ximian.com>
2394
2395         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
2396         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
2397         `Reachable' fields with a single `Reachability' one.
2398
2399 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2400
2401         * class.cs (FindMembers): Remove foreach's.
2402
2403         Bootstrap times:
2404
2405         BEFORE
2406                 Run 1:   8.74 seconds
2407                 Run 2:   8.71 seconds
2408
2409         AFTER
2410                 Run 1:   8.64 seconds
2411                 Run 2:   8.58 seconds
2412
2413
2414 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2415
2416         * cs-parser.jay:
2417         * gen-treedump.cs:
2418         * statement.cs:
2419         This patch does a few things:
2420                 1. EmptyStatement is now a singleton, so it is never reallocated.
2421                 2. All blah is EmptyStatement constructs have been changed to
2422                    blah == EmptyStatement.Value, which is much faster and valid
2423                    now that EmptyStatement is a singleton.
2424                 3. When resolving a block, rather than allocating a new array for
2425                    the non-empty statements, empty statements are replaced with
2426                    EmptyStatement.Value
2427                 4. Some recursive functions have been made non-recursive.
2428         Mainly the performance impact is from (3), however (1) and (2) are needed for
2429         this to work. (4) does not make a big difference in normal situations, however
2430         it makes the profile look saner.
2431
2432         Bootstrap times:
2433
2434         BEFORE
2435         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
2436         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
2437         Total memory allocated: 56397 KB
2438
2439         AFTER
2440         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
2441         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
2442         Total memory allocated: 55666 KB
2443
2444 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2445
2446         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
2447         than the hashtable in a hashtable version
2448
2449         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
2450         we always end up concating a string. This results in a huge perf
2451         loss, because many strings have to be tracked by the GC. In this
2452         patch, we first use a hashtable that works with two keys, so that
2453         the strings do not need to be concat'ed.
2454
2455         Bootstrap times:
2456         BEFORE
2457                 Run 1:   8.74 seconds
2458                 Run 2:   8.71 seconds
2459
2460         AFTER
2461                 Run 1:   8.65 seconds
2462                 Run 2:   8.56 seconds
2463
2464 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2465
2466         * Makefile: Add a new target `do-time' that does a quick and simple
2467         profile, leaving easy to parse output.
2468
2469 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
2470
2471         * codegen.cs (Init): Create the dynamic assembly with 
2472         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
2473
2474 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
2475
2476         * support.cs: Make the PtrHashtable use only one
2477         instance of its comparer.
2478
2479 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
2480
2481         * typemanager.cs: Fix lookup of GetNamespaces.
2482
2483 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
2484
2485         * expression.cs: Removed redundant line.
2486
2487         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
2488         ArrayLists, use for loops with bounds.  
2489
2490         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
2491         arraylist.
2492
2493         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
2494         arraylists, use for loop with bounds.
2495
2496         The above three changes give us a 0.071 second performance
2497         improvement out of 3.294 seconds down to 3.223.  On my machine
2498         the above changes reduced the memory usage by 1,387 KB during
2499         compiler bootstrap.
2500
2501         * cs-parser.jay (QualifiedIdentifier): New class used to represent
2502         QualifiedIdentifiers.  Before we created a new string through
2503         concatenation, and mostly later on, the result would be
2504         manipulated by DecomposeQI through string manipulation.
2505
2506         This reduced the compiler memory usage for bootstrapping from
2507         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
2508         compile times in 0.05 seconds.
2509
2510 2003-11-28  Dick Porter  <dick@ximian.com>
2511
2512         * support.cs: Do string compares with the Invariant culture.
2513
2514         * rootcontext.cs: 
2515         * gen-treedump.cs: 
2516         * expression.cs: 
2517         * driver.cs: 
2518         * decl.cs: 
2519         * codegen.cs: 
2520         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
2521         the comparison is done with the Invariant culture.
2522
2523 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
2524
2525         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
2526         GetEnumerator method.
2527
2528         (ProbeCollectionType): Iterate starting at the most specific type
2529         upwards looking for a GetEnumerator
2530
2531         * expression.cs: Shift count can be up to 31 for int/uint and 63
2532         for long/ulong.
2533
2534 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
2535
2536         * statement.cs (Block.LookupLabel): Also look for the label on the
2537         children blocks.  Use a hash table to keep track of visited
2538         nodes. 
2539
2540         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
2541         we actually did transform the other operand, otherwise fall back
2542         to the common codepath that casts to long.
2543
2544         * cs-tokenizer.cs: Use the same code pattern as the int case.
2545         Maybe I should do the parsing myself, and avoid depending on the
2546         Parse routines to get this done.
2547
2548 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
2549
2550         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
2551         which fixes bug 51347.  This time test it.
2552
2553         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
2554         attributes for example can not tell the difference between these.
2555         The difference was only a syntax feature of the language. 
2556
2557         * attribute.cs: Apply attributes to delegates.
2558
2559         * delegate.cs: Call the apply attributes method.
2560
2561 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
2562
2563         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
2564         comparing 0 vs Byte.MinValue, not the value
2565
2566         (ImplicitConversionRequired): When reporting a conversion error,
2567         use error 31 to print out the constant error instead of the
2568         simpler 29.
2569
2570         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
2571         which fixes bug 51347.
2572
2573 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
2574
2575         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
2576         which fixes the -warnaserror command line option.
2577
2578 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
2579
2580         * cfold.cs (DoNumericPromotions): During constant folding of
2581         additions on UIntConstant, special case intconstants with
2582         IntConstants like we do on the expression binary operator. 
2583
2584 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
2585
2586         * convert.cs (ImplicitReferenceConversion): We were missing a case
2587         (System.Enum are not value types or class types, so we need to
2588         classify them separatedly).
2589
2590         * driver.cs: We do not support error 2007.
2591
2592 2003-11-12 Jackson Harper <jackson@ximian.com>
2593
2594         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
2595         system directory. Also use the full file name so users can
2596         libraries names mscorlib-o-tron.dll in a non system dir.
2597
2598 2003-11-10  Martin Baulig  <martin@ximian.com>
2599
2600         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
2601         (TypeManager.InitCoreTypes): Initialize them here, but instead of
2602         calling `ResolveType()' on them, directly assign their `Type'.
2603
2604 2003-11-08  Martin Baulig  <martin@ximian.com>
2605
2606         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
2607         return value and the `out parent' parameter.
2608         (TypeContainer.DefineType): Moved the CS0644 check into
2609         GetClassBases().  Don't pass the interface types to the
2610         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
2611         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
2612
2613         * ecore.cs (TypeExpr.IsAttribute): New property.
2614         (TypeExpr.GetInterfaces): New method.
2615
2616         * interface.cs (Interface.GetInterfaceTypeByName): Return a
2617         TypeExpr instead of a Type.
2618         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
2619         (Interface.DefineType): Don't pass the interface types to the
2620         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
2621         them later and then call `TypeBulider.AddInterfaceImplementation()'.
2622
2623         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
2624         instead of a `Type[]'.
2625         (TypeManager.RegisterBuilder): Likewise.
2626         (TypeManager.AddUserInterface): Likewise.
2627         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
2628         `Type[]' and also return a `TypeExpr[]'.
2629         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
2630
2631 2003-11-08  Martin Baulig  <martin@ximian.com>
2632
2633         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
2634         Expression.     
2635
2636 2003-11-08  Martin Baulig  <martin@ximian.com>
2637
2638         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
2639         TypeManager.ResolveExpressionTypes().
2640
2641         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
2642         instead of an Expression.
2643         (TypeExpr): This is now an abstract base class for `TypeExpression'.
2644         (TypeExpression): New public class; formerly known as `TypeExpr'.
2645
2646         * expression.cs (ComposedCast): Derive from TypeExpr.
2647
2648         * typemanager.cs (TypeManager.system_*_expr): These are now
2649         TypExpr's instead of Expression's.
2650         (TypeManager.ResolveExpressionTypes): New public static function;
2651         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
2652         of them.        
2653
2654 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
2655
2656         * expression.cs (New.DoResolve): Do not dereference value that
2657         might be a null return.
2658
2659         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
2660         sure that the constant value has the right type.  Fixes an
2661         unreported bug, similar to 50425.
2662
2663         * const.cs (Const.LookupConstantValue): Call
2664         ImplicitStandardConversionExists before doing a conversion to
2665         avoid havng the TypeManager.ChangeType do conversions.
2666
2667         Reduced the number of casts used
2668
2669         (Const.ChangeType): New routine to enable reuse of the constant
2670         type changing code from statement.
2671
2672         * typemanager.cs (ChangeType): Move common initialization to
2673         static global variables.
2674
2675         Fixes #50425.
2676
2677         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
2678         every value type to go through, even if it was void.  Fix that. 
2679
2680         * cs-tokenizer.cs: Use is_identifier_start_character on the start
2681         character of the define, and the is_identifier_part_character for
2682         the rest of the string.
2683
2684 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
2685
2686         * expression.cs (UnaryMutator.EmitCode): When I updated
2687         LocalVariableReference.DoResolve, I overdid it, and dropped an
2688         optimization done on local variable references.
2689
2690 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
2691
2692         * ecore.cs: Convert the return from Ldlen into an int.
2693
2694 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
2695
2696         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
2697         the accessibility, this is a special case for toplevel non-public
2698         classes (internal for instance).
2699
2700 2003-10-20  Nick Drochak <ndrochak@gol.com>
2701
2702         * ecore.cs: Fix typo and build.  Needed another right paren.
2703
2704 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
2705
2706         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
2707         `internal' case regular and protected, but not allowing protected
2708         to be evaluated later.  Bug 49840
2709
2710 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
2711
2712         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
2713         to kb.Nlast, and not the kb.nFirst to isolate the switch
2714         statement.
2715
2716         Extract the underlying type, so enumerations of long/ulong are
2717         treated like long/ulong.
2718
2719 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
2720
2721         * expression.cs (New): Overload the meaning of RequestedType to
2722         track the possible creation of the NewDelegate type, since
2723         DoResolve is invoked more than once for new constructors on field
2724         initialization.
2725
2726         See bugs: #48800 and #37014
2727
2728         * cs-parser.jay (declare_local_constants): Take an arraylist
2729         instead of a single constant.
2730
2731         (local_constant_declaration): It should take a
2732         constant_declarators, not a constant_declarator.  Fixes 49487
2733
2734         * convert.cs: Fix error report.
2735
2736 2003-10-13 Jackson Harper <jackson@ximian.com>
2737
2738         * typemanager.cs (TypeToCoreType): Add float and double this fixes
2739         bug #49611
2740
2741 2003-10-09  Martin Baulig  <martin@ximian.com>
2742
2743         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
2744         to the .ctor.
2745         (MethodCore.DoDefineParameters): Removed the TypeContainer
2746         argument; use the DeclSpace which was passed to the .ctor instead.
2747         (MethodCore.CheckParameter): Take a DeclSpace instead of a
2748         TypeContainer; we only need a DeclSpace here.
2749
2750 2003-10-09  Martin Baulig  <martin@ximian.com>
2751
2752         * class.cs (MethodData): Added additional `DeclSpace ds' argument
2753         to the .ctor.
2754         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
2755         EmitContext's .ctor.    
2756
2757 2003-10-09  Martin Baulig  <martin@ximian.com>
2758
2759         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
2760         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
2761         AsAccessible(), moved them as well.
2762
2763         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
2764
2765 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
2766
2767         * cs-parser.jay : Renamed yyName to yyNames related to jay.
2768
2769 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
2770
2771         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
2772         generation for >=, as spotted by Paolo, bug 48679.  
2773         Patch from David Waite.
2774
2775         * cs-tokenizer.cs: Add handling for #pragma.
2776
2777         * cs-parser.jay: Allow for both yield and yield return in the
2778         syntax.  The anti-cobolization of C# fight will go on!
2779
2780         * class.cs (TypeBuilder.DefineType): Catch error condition here
2781         (Parent.DefineType erroring out and returning null).
2782
2783         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
2784         coping with enumerations variables, we were mistakenly processing
2785         them as a regular value type instead of built-in types.  Fixes the
2786         bug #48063
2787
2788         * typemanager.cs (IsBuiltinOrEnum): New method.
2789
2790 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
2791
2792         * cs-parser.jay: Upgrade: yield now needs the return clause.
2793
2794 2003-09-19  Martin Baulig  <martin@ximian.com>
2795
2796         * decl.cs (MemberCache.SetupCacheForInterface): Take a
2797         `MemberCache parent' argument.  Normally, an interface doesn't
2798         have a parent type except System.Object, but we use this in gmcs
2799         for generic type parameters.
2800
2801 2003-09-18  Martin Baulig  <martin@ximian.com>
2802
2803         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
2804         on `type.IsInterface'; don't check whether the type has a parent
2805         to determine whether it's an interface.
2806
2807 2003-09-15  Martin Baulig  <martin@ximian.com>
2808
2809         * class.cs (TypeContainer.DefineType): Added an error flag to
2810         avoid reporting duplicate CS0146's ("class definition is
2811         circular.").
2812
2813         * driver.cs (Driver.MainDriver): Abort if
2814         RootContext.ResolveTree() reported any errors.
2815
2816 2003-09-07  Martin Baulig  <martin@ximian.com>
2817
2818         * report.cs (Error, Warning): Added overloaded versions which take
2819         a `params object[] args' and call String.Format().
2820
2821 2003-09-07  Martin Baulig  <martin@ximian.com>
2822
2823         * decl.cs (DeclSpace..ctor): Don't call
2824         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
2825         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
2826         (DeclSpace.RecordDecl): New method.
2827
2828         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
2829
2830 2003-09-02  Ravi Pratap  <ravi@ximian.com>
2831
2832         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
2833         value attributes to be applied to ParameterBuilders.
2834
2835         * class.cs (MethodCore.LabelParameters): Make static and more
2836         generic so that it can be used from other places - like interface
2837         methods, for instance.
2838
2839         * interface.cs (Interface.Emit): Call LabelParameters before
2840         emitting attributes on the InterfaceMethod.
2841
2842 2003-08-26  Martin Baulig  <martin@ximian.com>
2843
2844         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
2845         resolving aliases; fixes #47927.
2846
2847 2003-08-26  Martin Baulig  <martin@ximian.com>
2848
2849         * statement.cs (Using.DoResolve): This is internally emitting a
2850         try/finally clause, so we need to set ec.NeedExplicitReturn if we
2851         do not always return.  Fixes #47681.
2852
2853 2003-08-26  Martin Baulig  <martin@ximian.com>
2854
2855         * decl.cs (MemberCore): Moved WarningNotHiding(),
2856         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
2857         into MemberBase.
2858         (AdditionResult): Make this nested in DeclSpace.
2859         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
2860         argument; call NamespaceEntry.Define() unless we're nested in a
2861         class or struct.
2862
2863         * namespace.cs (Namespace.DefineName): New public function.  This
2864         is called from DeclSpace's .ctor to add 
2865         (Namespace.Lookup): Include DeclSpaces in the lookup.
2866
2867         * class.cs (Operator): Derive from MemberBase, not MemberCore.
2868
2869         * const.cs (Const): Derive from MemberBase, not MemberCore.     
2870
2871 2003-08-25  Martin Baulig  <martin@ximian.com>
2872
2873         * convert.cs (Convert.ExplicitReferenceConversion): When
2874         converting from an interface type to a class, unbox if the target
2875         type is a struct type.  Fixes #47822.
2876
2877 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2878
2879         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
2880         #47854.
2881
2882 2003-08-22  Martin Baulig  <martin@ximian.com>
2883
2884         * class.cs (TypeManager.DefineType): When defining a nested type,
2885         call DefineType() on our parent; fixes #47801.
2886
2887 2003-08-22  Martin Baulig  <martin@ximian.com>
2888
2889         * class.cs (MethodData.Define): While checking if a method is an
2890         interface implementation, improve the test a bit more to fix #47654.
2891
2892 2003-08-22  Martin Baulig  <martin@ximian.com>
2893
2894         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
2895         correctly; fixes #47722.
2896
2897 2003-08-22  Martin Baulig  <martin@ximian.com>
2898
2899         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
2900         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
2901
2902         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
2903
2904 2003-08-22  Martin Baulig  <martin@ximian.com>
2905
2906         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
2907         can only be assigned in static constructors.  Fixes #47161.
2908
2909 2003-08-22  Martin Baulig  <martin@ximian.com>
2910
2911         Rewrote and improved the flow analysis code.
2912
2913         * flowbranching.cs (FlowBranching): Make this class abstract.
2914         (FlowBranching.CreateBranching): New static function to create a
2915         new flow branching.
2916         (FlowBranchingBlock, FlowBranchingException): New classes.
2917         (FlowBranching.UsageVector.Type): New public readonly field.
2918         (FlowBranching.UsageVector.Breaks): Removed the setter.
2919         (FlowBranching.UsageVector.Returns): Removed the setter.
2920         (FlowBranching.UsageVector): Added Break(), Return(),
2921         NeverReachable() and Throw() methods to modify the reachability.
2922         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
2923         done by FlowBranching.Merge().
2924         (FlowBranching.UsageVector.MergeChild): New method; merges the
2925         merge result into the current vector.
2926         (FlowBranching.Merge): New abstract method to merge a branching.
2927
2928 2003-08-12  Martin Baulig  <martin@ximian.com>
2929
2930         * expression.cs (Indirection.CacheTemporaries): Create the
2931         LocalTemporary with the pointer type, not its element type.
2932
2933 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
2934
2935         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
2936         token was a keyword or not.
2937
2938         Add `error' options where an IDENTIFIER was expected;  Provide
2939         CheckToken and CheckIdentifierToken convenience error reporting
2940         functions. 
2941
2942         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
2943
2944         * decl.cs: Rename `NamespaceEntry Namespace' public field into
2945         NameSpaceEntry NameSpaceEntry.
2946
2947         (LookupInterfaceOrClass): Avoid creating a full qualified name
2948         from namespace and name: avoid doing lookups when we know the
2949         namespace is non-existant.   Use new Tree.LookupByNamespace which
2950         looks up DeclSpaces based on their namespace, name pair.
2951
2952         * driver.cs: Provide a new `parser verbose' to display the
2953         exception thrown during parsing.  This is turned off by default
2954         now, so the output of a failure from mcs is more graceful.
2955
2956         * namespace.cs: Track all the namespaces defined in a hashtable
2957         for quick lookup.
2958
2959         (IsNamespace): New method
2960
2961 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
2962
2963         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
2964         we know that we need to concatenate (full typename can never be
2965         null). 
2966
2967         * class.cs: ditto.
2968
2969         * statement.cs: Use a bitfield;  Do not initialize to null things
2970         which are done by the constructor by default.
2971
2972         * cs-parser.jay: bug fix, parameter was 4, not 3.
2973
2974         * expression.cs: Just use the property;
2975
2976         * statement.cs: No need for GetVariableInfo method.
2977
2978 2003-08-08  Martin Baulig  <martin@ximian.com>
2979
2980         * flowanalysis.cs (FlowReturns): This is now nested in the
2981         `FlowBranching' class.
2982         (MyBitVector): Moved this here from statement.cs.
2983         (FlowBranching.SiblingType): New enum type.
2984         (FlowBranching.CreateSibling): Added `SiblingType' argument.
2985
2986 2003-08-07  Martin Baulig  <martin@ximian.com>
2987
2988         * flowanalysis.cs (FlowBranchingType): This is now nested in the
2989         `FlowBranching' class and called `BranchingType'.
2990
2991 2003-08-07  Martin Baulig  <martin@ximian.com>
2992
2993         * flowanalysis.cs: Moved all the control flow analysis code into
2994         its own file.
2995
2996 2003-08-07  Martin Baulig  <martin@ximian.com>
2997
2998         * assign.cs (Assign.DoResolve): `target' must either be an
2999         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
3000         #37319.
3001
3002 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
3003
3004         * expression.cs (BinaryMethod): This kind of expression is created by the
3005         Binary class if it determines that the operator has to be handled
3006         by a method.
3007
3008         (BinaryDelegate): This kind of expression is created if we are
3009         dealing with a + or - operator on delegates.
3010
3011         (Binary): remove method, argumetns, and DelegateOperator: when
3012         dealing with methods, 
3013
3014         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
3015
3016         * statement.cs (Block): use bitfields for the three extra booleans
3017         we had in use.   Remove unused topblock parameter.
3018
3019         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
3020
3021         * assign.cs: Drop extra unneeded tests.
3022
3023 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
3024
3025         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
3026
3027         * statement.cs (Foreach): Use VariableStorage instead of
3028         LocalBuilders.   
3029
3030         * codegen.cs (VariableStorage): New class used by clients that
3031         require a variable stored: locals or fields for variables that
3032         need to live across yield.
3033
3034         Maybe provide a convenience api for EmitThis+EmitLoad?
3035
3036         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
3037         these bad boys.
3038
3039 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
3040
3041         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
3042         RemapParameterLValue): New methods that are used to turn a
3043         precomputed FieldInfo into an expression like this:
3044
3045                 instance.FieldInfo
3046
3047         The idea is to use this instead of making LocalVariableReference
3048         have more than one meaning.
3049
3050         * cs-parser.jay: Add error production to BASE.
3051
3052         * ecore.cs: Deal with TypeManager.GetField returning null, which
3053         is now a valid return value.
3054
3055         (FieldExprNoAddress): New expression for Fields whose address can
3056         not be taken.
3057
3058         * expression.cs (LocalVariableReference): During the resolve
3059         phases, create new expressions if we are in a remapping context.
3060         Remove code that dealt with remapping here.
3061
3062         (ParameterReference): same.
3063
3064         (ProxyInstance): New expression, like the `This' expression, but
3065         it is born fully resolved.  We know what we are doing, so remove
3066         the errors that are targeted to user-provided uses of `this'.
3067
3068         * statement.cs (Foreach): our variable is now stored as an
3069         Expression;  During resolution, follow the protocol, dont just
3070         assume it will return this.
3071
3072 2003-08-06  Martin Baulig  <martin@ximian.com>
3073
3074         * support.cs (SeekableStreamReader.cs): New public class.
3075
3076         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
3077         SeekableStreamReader instead of the normal StreamReader.
3078
3079 2003-08-04  Martin Baulig  <martin@ximian.com>
3080
3081         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
3082         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
3083         deambiguate casts and delegate invocations.
3084         (parenthesized_expression): Use the new tokens to ensure this is
3085         not a cast of method invocation.
3086
3087         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
3088         when reading a `)' and Deambiguate_CloseParens () was previously
3089         called.
3090
3091         * expression.cs (ParenthesizedExpression): New class.  This is
3092         just used for the CS0075 test.
3093         (Binary.DoResolve): Check for CS0075.   
3094
3095 2003-07-29  Ravi Pratap  <ravi@ximian.com>
3096
3097         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
3098         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
3099         reference comparison.
3100
3101         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
3102         examine the ReturnType for equality - this is necessary in the
3103         cases of implicit and explicit operators whose signature also
3104         includes the return type.
3105
3106 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
3107
3108         * namespace.cs: Cache the result of the namespace computation,
3109         instead of computing it every time.
3110
3111 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
3112
3113         * decl.cs: Use a global arraylist that we reuse over invocations
3114         to avoid excesive memory consumption.  Reduces memory usage on an
3115         mcs compile by one meg (45 average).
3116
3117         * typemanager.cs (LookupTypeReflection): In .NET pointers are
3118         private, work around that.
3119
3120 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
3121
3122         * literal.cs (IntLiteral): Define Zero and One static literals. 
3123
3124         * cs-parser.jay (integer_literal): use static literals to reduce
3125         memory usage for the most used literals (0, 1 and -1).  211kb
3126         reduced in memory usage.
3127
3128         Replace all calls to `new ArrayList' with `new
3129         ArrayList(4)' which is a good average number for most allocations,
3130         and also requires only 16 bytes of memory for its buffer by
3131         default. 
3132
3133         This reduced MCS memory usage in seven megabytes for the RSS after
3134         bootstrapping.
3135
3136 2003-07-28  Ravi Pratap  <ravi@ximian.com>
3137
3138         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
3139         handle params methods the correct way by forming only one
3140         applicable set with params and normal methods in them. Earlier we
3141         were looking at params methods only if we found no normal methods
3142         which was not the correct thing to do.
3143
3144         (Invocation.BetterFunction): Take separate arguments indicating
3145         when candidate and the best method are params methods in their
3146         expanded form.
3147
3148         This fixes bugs #43367 and #46199.
3149
3150         * attribute.cs: Documentation updates.
3151
3152         (CheckAttribute): Rename to CheckAttributeTarget.
3153         (GetValidPlaces): Rename to GetValidTargets.
3154
3155         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
3156         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
3157
3158         Fixes bug #44468.
3159
3160 2003-07-28  Martin Baulig  <martin@ximian.com>
3161
3162         * class.cs (TypeContainer.DefineMembers): Use the base type's full
3163         name when looking up the base class of a nested class.  Fixes #46977.
3164
3165 2003-07-26  Martin Baulig  <martin@ximian.com>
3166
3167         * expression.cs (Indexers.Indexer): New nested struct; contains
3168         getter, setter and the indexer's type.
3169         (Indexers.Properties): This is now an ArrayList of
3170         Indexers.Indexer's.
3171         (IndexerAccess.DoResolveLValue): Correctly set the type if the
3172         indexer doesn't have any getters.
3173
3174         * assign.cs (Assign.DoResolve): Also do the implicit conversions
3175         for embedded property and indexer assignments.
3176
3177 2003-07-26  Martin Baulig  <martin@ximian.com>
3178
3179         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
3180         preprocessor directive is not the first non-whitespace character
3181         on a line.
3182
3183 2003-07-26  Martin Baulig  <martin@ximian.com>
3184
3185         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
3186         namespace parsing, follow the spec more closely.
3187
3188         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
3189         NamespaceEntry.Lookup().
3190
3191 2003-07-25  Martin Baulig  <martin@ximian.com>
3192
3193         * MethodCore.cs (OverridesSomething): New public field; it's set
3194         from TypeContainer.DefineMembers if this method overrides
3195         something (which doesn't need to be a method).  Fix #39462.
3196
3197 2003-07-25  Ravi Pratap  <ravi@ximian.com>
3198
3199         * typemanager.cs (GetMembers): Ensure that the list of members is
3200         reversed. This keeps things in sync.
3201
3202         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
3203         find an AttributeUsage attribute.
3204
3205         * expression.cs (Invocation.OverloadResolve): Perform the check
3206         which disallows Invoke to be directly called on a Delegate.
3207
3208         (Error_InvokeOnDelegate): Report error cs1533.
3209
3210 2003-07-25  Martin Baulig  <martin@ximian.com>
3211
3212         * expression.cs (Indexers.GetIndexersForType): Only look in the
3213         interface hierarchy if the requested type is already an
3214         interface.  Fixes #46788 while keeping #46502 fixed.
3215
3216 2003-07-25  Martin Baulig  <martin@ximian.com>
3217
3218         * class.cs (TypeContainer.DefineMembers): Check whether all
3219         readonly fields have been assigned and report warning CS0649 if
3220         not.
3221
3222         * statement.cs (LocalInfo.IsFixed): Always return true if this is
3223         a valuetype.
3224
3225 2003-07-24  Ravi Pratap  <ravi@ximian.com>
3226
3227         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
3228         returned from GetMethods to make things consistent with the
3229         assumptions MCS makes about ordering of methods.
3230
3231         This should comprehensively fix bug #45127 and it does :-)
3232
3233         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
3234         ordering is actually reverse.
3235
3236         * Clean up some debug messages I left lying around.
3237
3238         * interface.cs (Populate*): Get rid of code which emits attributes
3239         since the stage in which we emit attributes is the 'Emit' stage,
3240         not the define stage.
3241
3242         (Emit): Move attribute emission for interface members here.
3243
3244 2003-07-22  Ravi Pratap  <ravi@ximian.com>
3245
3246         * expression.cs (Invocation.OverloadResolve): Follow the spec more
3247         closely: we eliminate methods in base types when we have an
3248         applicable method in a top-level type.
3249
3250         Please see section 14.5.5.1 for an exact description of what goes
3251         on. 
3252
3253         This fixes bug #45127 and a host of other related to corlib compilation.
3254
3255         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
3256         array is the method corresponding to the top-level type (this is
3257         because of the changes made to icall.c) so we change this
3258         accordingly.
3259
3260         (MethodGroupExpr.Name): This too.
3261
3262         * typemanager.cs (GetElementType): New method which does the right
3263         thing when compiling corlib. 
3264
3265         * everywhere: Make use of the above in the relevant places.
3266
3267 2003-07-22  Martin Baulig  <martin@ximian.com>
3268
3269         * cs-parser.jay (invocation_expression): Moved
3270         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
3271         `cast_expression', but create a InvocationOrCast which later
3272         resolves to either an Invocation or a Cast.
3273
3274         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
3275         method; call this before EmitStatement() to make sure that this
3276         expression can be used as a statement.
3277
3278         * expression.cs (InvocationOrCast): New class; resolves to either
3279         an Invocation or a Cast.
3280
3281         * statement.cs (StatementExpression): Call ResolveStatement() on
3282         the ExpressionStatement before emitting it.
3283
3284 2003-07-21  Martin Baulig  <martin@ximian.com>
3285
3286         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
3287         `ref' and `out' attributes match; fixes #46220.
3288         (MemberAccess.ResolveMemberAccess): You can't reference a type
3289         through an expression; fixes #33180.
3290         (Indexers.GetIndexersForType): Don't return the indexers from
3291         interfaces the class implements; fixes #46502.
3292
3293 2003-07-21  Martin Baulig  <martin@ximian.com>
3294
3295         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
3296         CS0661 checks; fixes bug #30442.
3297
3298 2003-07-21  Martin Baulig  <martin@ximian.com>
3299
3300         * decl.cs (AdditionResult): Added `Error'.
3301
3302         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
3303
3304         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
3305         makes cs0031.cs actually work.
3306
3307 2003-07-20  Martin Baulig  <martin@ximian.com>
3308
3309         * namespace.cs: Fixed that bug which caused a crash when compiling
3310         the debugger's GUI.
3311
3312 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
3313
3314         * typemanager.cs (LookupTypeReflection): Never expose types which
3315         are NotPublic, NestedPrivate, NestedAssembly, or
3316         NestedFamANDAssem.  We used to return these, and later do a check
3317         that would report a meaningful error, but the problem is that we
3318         would not get the real match, if there was a name override.
3319
3320 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
3321
3322         * namespace.cs (Namespace, Name): Do not compute the namespace
3323         name dynamically, compute it in the constructor.  This reduced
3324         memory usage by 1697 KB.
3325
3326         * driver.cs: Use --pause to pause at the end.
3327
3328 2003-07-17  Peter Williams  <peter@newton.cx>
3329
3330         * Makefile: Change the name of the test target so that it doesn't
3331         conflict with the recursive test target.
3332
3333 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
3334
3335         * expression.cs (LocalVariableReference.Emit, EmitAssign,
3336         AddressOf): Do not use EmitThis, that was wrong, use the actual
3337         this pointer.
3338
3339 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
3340
3341         * class.cs (MethodData.Define): While checking if a method is an
3342         interface implementation, improve the test: If we are not public
3343         (use new test here: use the computed MethodAttributes directly,
3344         instead of the parsed modifier flags) check if the `implementing'
3345         method comes from an interface or not.
3346
3347         * pending.cs (VerifyPendingMethods): Slightly better error
3348         message.
3349
3350         * makefile: add test target that does the mcs bootstrap.
3351
3352 2003-07-16  Ravi Pratap  <ravi@ximian.com>
3353
3354         * interface.cs (Define): Do nothing here since there are no
3355         members to populate etc. Move the attribute emission out of here
3356         since this was just totally the wrong place to put it. Attribute
3357         application happens during the 'Emit' phase, not in the 'Define'
3358         phase.
3359
3360         (Emit): Add this method and move the attribute emission here
3361
3362         * rootcontext.cs (EmitCode): Call the Emit method on interface
3363         types too.
3364
3365 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
3366
3367         * expression.cs (OverloadResolve): Report error only if Location
3368         is not 'Null' which means that there was a probe going on.
3369
3370 2003-07-14  Martin Baulig  <martin@ximian.com>
3371
3372         * expression.cs (ConditionalLogicalOperator): New public class to
3373         implement user defined conditional logical operators.
3374         This is section 14.11.2 in the spec and bug #40505.
3375
3376 2003-07-14  Martin Baulig  <martin@ximian.com>
3377
3378         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
3379
3380 2003-07-14  Martin Baulig  <martin@ximian.com>
3381
3382         * codegen.cs (EmitContext.InFixedInitializer): New public field.
3383
3384         * ecore.cs (IVariable.VerifyFixed): New interface method.
3385
3386         * expression.cs (Unary.ResolveOperator): When resolving the `&'
3387         operator, check whether the variable is actually fixed.  Fixes bug
3388         #36055.  Set a variable definitely assigned when taking its
3389         address as required by the spec.
3390
3391         * statement.cs (LocalInfo.IsFixed): New field.
3392         (LocalInfo.MakePinned): Set `IsFixed' to true.
3393
3394 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
3395
3396         * attribute.cs (Attribute.Resolve): While doing a Member lookup
3397         for .ctors, ensure that we only ask for members declared in the
3398         attribute type (BindingFlags.DeclaredOnly).
3399
3400         Fixes bug #43632.
3401
3402         * expression.cs (Error_WrongNumArguments): Report error 1501
3403         correctly the way CSC does.
3404
3405 2003-07-13  Martin Baulig  <martin@ximian.com>
3406
3407         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
3408         lookup on the fully qualified name, to make things like "X.X" work
3409         where "X.X" is a fully qualified type name, but we also have a
3410         namespace "X" in the using list.  Fixes #41975.
3411
3412 2003-07-13  Martin Baulig  <martin@ximian.com>
3413
3414         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
3415         function. If we're a CompoundAssign, we need to create an embedded
3416         CompoundAssign, not an embedded Assign.
3417         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
3418         Fixes #45854.
3419
3420 2003-07-13  Martin Baulig  <martin@ximian.com>
3421
3422         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
3423         work to fix bug #46088.
3424
3425 2003-07-13  Ravi Pratap <ravi@ximian.com>
3426
3427         * class.cs (Operator.Emit): Do not emit attributes here - it is
3428         taken care of by the Method class that we delegate too. This takes
3429         care of bug #45876.
3430
3431 2003-07-10  Martin Baulig  <martin@ximian.com>
3432
3433         * expression.cs (TypeOfVoid): New class.
3434         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
3435
3436 2003-07-10  Martin Baulig  <martin@ximian.com>
3437
3438         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
3439         bug #35957.
3440
3441 2003-07-10  Martin Baulig  <martin@ximian.com>
3442
3443         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
3444         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
3445
3446         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
3447
3448         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
3449
3450 2003-07-10  Martin Baulig  <martin@ximian.com>
3451
3452         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
3453         of decimal.  Fixes #42850.
3454
3455         NOTE: I also fixed the created byte blob, but this doesn't work on
3456         the MS runtime and csc never produces any byte blobs for decimal
3457         arrays.
3458
3459 2003-07-10  Martin Baulig  <martin@ximian.com>
3460
3461         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
3462         structs; fixes #32068.
3463         (Block.AddChildVariableNames): Fixed #44302.
3464
3465 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3466
3467         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
3468
3469 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
3470
3471         * attribute.cs: And this test is onger needed.
3472
3473 2003-07-08  Martin Baulig  <martin@ximian.com>
3474
3475         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
3476         inaccessible types.  Fixes #36313.
3477
3478         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
3479
3480         * namespace.cs (NamespaceEntry): Create implicit entries for all
3481         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
3482         implicit entries for N1.N2 and N1.
3483
3484 2003-07-08  Martin Baulig  <martin@ximian.com>
3485
3486         Rewrote the handling of namespaces to fix a lot of the issues
3487         wrt. `using' aliases etc.
3488
3489         * namespace.cs (Namespace): Splitted this class into a
3490         per-assembly `Namespace' and a per-file `NamespaceEntry'.
3491
3492         * typemanager.cs (TypeManager.IsNamespace): Removed.
3493         (TypeManager.ComputeNamespaces): Only compute namespaces from
3494         loaded assemblies here, not the namespaces from the assembly we're
3495         currently compiling.
3496
3497 2003-07-08  Martin Baulig  <martin@ximian.com>
3498
3499         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
3500
3501 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
3502
3503         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
3504         already fixed it.  
3505
3506         I thought about the memory savings here, but LookupTypeReflection
3507         is used under already very constrained scenarios.  Compiling
3508         corlib or mcs only exposes one hit, so it would not really reduce
3509         any memory consumption.
3510
3511 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3512
3513         * typemanager.cs: fixes bug #45889 by only adding public types from
3514         other assemblies to the list of known types.
3515
3516 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
3517
3518         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
3519         on the type we resolved.
3520
3521 2003-07-05  Martin Baulig  <martin@ximian.com>
3522
3523         * pending.cs (PendingImplementation.ParentImplements): Don't
3524         create the proxy if the parent is abstract.
3525
3526         * class.cs (TypeContainer.DefineIndexers): Process explicit
3527         interface implementations first.  Fixes #37714.
3528
3529 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
3530
3531         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
3532         defined recursively;  but since we modify the input parameters
3533         (left is set to `this' temporarily), we reset this value if the
3534         left_is_explicit is false, which gives the original semantics to
3535         the code.  
3536
3537         * literal.cs (NullPointer): new class used to represent a null
3538         literal in a pointer context.
3539
3540         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
3541         type is a pointer, use a NullPointer object instead of a
3542         NullLiteral.   Closes 43687
3543
3544         (ExplicitConversion): Convert pointer values using
3545         the conv opcode to the proper type.
3546
3547         * ecore.cs (New): change ValueTypeVariable property into a method,
3548         that returns whether the valuetype is suitable for being used.
3549
3550         * expression.cs (Binary.DoNumericPromotions): Only return if we
3551         the int constant was a valid uint, and we can return both left and
3552         right as uints.  If not, we continue processing, to trigger the
3553         type conversion.  This fixes 39018.
3554
3555         * statement.cs (Block.EmitMeta): During constant resolution, set
3556         the CurrentBlock property on the emitcontext, so that we resolve
3557         constants propertly.
3558
3559 2003-07-02  Martin Baulig  <martin@ximian.com>
3560
3561         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
3562         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
3563
3564         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
3565         than emitting it here.
3566
3567         * statement.cs: Fixed some more flow analysis bugs.
3568
3569 2003-07-02  Martin Baulig  <martin@ximian.com>
3570
3571         * class.cs (MethodData.Define): When implementing interface
3572         methods, set Final unless we're Virtual.
3573
3574         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
3575         check work for interface methods.
3576
3577 2003-07-01  Martin Baulig  <martin@ximian.com>
3578
3579         * ecore.cs (EmitContext.This): Replaced this property with a
3580         GetThis() method which takes a Location argument.  This ensures
3581         that we get the correct error location for a CS0188.
3582
3583 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
3584
3585         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
3586         ImplicitStandardConversion.
3587
3588         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
3589
3590 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
3591
3592         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
3593         optimization.
3594
3595 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
3596
3597         * class.cs (Constructor.Define): Turn off initlocals for unsafe
3598         constructors.
3599
3600         (MethodData.Define): Turn off initlocals for unsafe methods.
3601
3602 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
3603
3604         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
3605         complete;  Fixes #37521.
3606
3607         * delegate.cs: Use Modifiers.TypeAttr to compute the
3608         TypeAttributes, instead of rolling our own.  This makes the flags
3609         correct for the delegates.
3610
3611 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
3612
3613         * class.cs (Constructor.Define): Set the private flag for static
3614         constructors as well.
3615
3616         * cs-parser.jay (statement_expression): Set the return value to
3617         null, to avoid a crash when we catch an error.
3618
3619 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
3620
3621         * cs-parser.jay: Applied patch from Jackson that adds support for
3622         extern and unsafe modifiers to destructor declarations.
3623
3624         * expression.cs: Report error 21 if the user is trying to index a
3625         System.Array.
3626
3627         * driver.cs: Add an error message, suggested by the bug report.
3628
3629         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
3630         if we do not have a ": this ()" constructor initializer.  Fixes 45149
3631
3632 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
3633
3634         * namespace.cs: Add some information to reduce FAQs.
3635
3636 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
3637
3638         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
3639         underlying enumeration types.  Fixes #43915.
3640
3641         * expression.cs: Treat ushort/short as legal values to be used in
3642         bitwise operations.
3643
3644 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
3645
3646         * delegate.cs: transfer custom attributes for paramenters from
3647         the delegate declaration to Invoke and BeginInvoke.
3648
3649 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
3650
3651         * attribute.cs: handle custom marshalers and emit marshal info
3652         for fields, too.
3653
3654 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
3655
3656         * makefile.gnu: Added anonymous.cs to the compiler sources.
3657
3658 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
3659
3660         * iterators.cs: Change the name of the proxy class to include two
3661         underscores.
3662
3663         * cs-parser.jay: Update grammar to include anonymous methods.
3664
3665         * anonymous.cs: new file.
3666
3667 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
3668
3669         * class.cs (Field.Define): Add missing test for pointers and
3670         safety. 
3671
3672 2003-05-27  Ravi Pratap  <ravi@ximian.com>
3673
3674         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
3675         we use the stobj opcode.
3676
3677         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
3678         since it wasn't the correct fix. 
3679
3680         It still is puzzling that we are required to use stobj for IntPtr
3681         which seems to be a ValueType.
3682
3683 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
3684
3685         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
3686         during regular simple name resolution.   Now, the trick is that
3687         instead of returning for processing the simplename, we do a
3688         TypeManager.LookupType (ie, a rooted lookup as opposed to a
3689         contextual lookup type).   If a match is found, return that, if
3690         not, return for further composition.
3691
3692         This fixes long-standing 30485.
3693
3694         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
3695         using the address to initialize an object, do an Stobj instead of
3696         using the regular Stelem.
3697
3698         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
3699         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
3700         Because if we are a BaseIndexerAccess that value will be true.
3701         Fixes 43643.
3702
3703         * statement.cs (GotoCase.Resolve): Return after reporting an
3704         error, do not attempt to continue. 
3705
3706         * expression.cs (PointerArithmetic.Emit): If our operand is a
3707         long, convert our constants to match the operand before
3708         multiplying.  Convert to I type before adding.   Fixes 43670.
3709
3710 2003-05-14  Ravi Pratap  <ravi@ximian.com>
3711
3712         * enum.cs (ImplicitConversionExists) : Rename to
3713         ImplicitEnumConversionExists to remove ambiguity. 
3714
3715         * ecore.cs (NullCast): New type of cast expression class which
3716         basically is very similar to EmptyCast with the difference being
3717         it still is a constant since it is used only to cast a null to
3718         something else
3719         (eg. (string) null)
3720
3721         * convert.cs (ImplicitReferenceConversion): When casting a null
3722         literal, we return a NullCast.
3723
3724         * literal.cs (NullLiteralTyped): Remove - I don't see why this
3725         should be around anymore.
3726
3727         The renaming (reported was slightly wrong). Corrections:
3728
3729         ConvertImplicitStandard -> ImplicitConversionStandard
3730         ConvertExplicitStandard -> ExplicitConversionStandard
3731
3732         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
3733         before passing them in !
3734
3735         * convert.cs (ImplicitConversionStandard): When comparing for
3736         equal expr and target types, ensure that expr is not a
3737         NullLiteral.
3738
3739         In general, we must not be checking (expr_type ==
3740         target_type) in the top level conversion methods
3741         (ImplicitConversion, ExplicitConversion etc). This checking is
3742         done in the methods that they delegate to.
3743
3744 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
3745
3746         * convert.cs: Move Error_CannotConvertType,
3747         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
3748         ImplicitNumericConversion, ImplicitConversionExists,
3749         ImplicitUserConversionExists, StandardConversionExists,
3750         FindMostEncompassedType, FindMostSpecificSource,
3751         FindMostSpecificTarget, ImplicitUserConversion,
3752         ExplicitUserConversion, GetConversionOperators,
3753         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
3754         TryImplicitIntConversion, Error_CannotConvertImplicit,
3755         ConvertImplicitRequired, ConvertNumericExplicit,
3756         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
3757         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
3758         its own file.
3759
3760         Perform the following renames:
3761
3762         StandardConversionExists -> ImplicitStandardConversionExists
3763         ConvertImplicit -> ImplicitConversion
3764         ConvertImplicitStandard -> ImplicitStandardConversion
3765         TryImplicitIntConversion -> ImplicitIntConversion
3766         ConvertImplicitRequired -> ImplicitConversionRequired
3767         ConvertNumericExplicit -> ExplicitNumericConversion
3768         ConvertReferenceExplicit -> ExplicitReferenceConversion
3769         ConvertExplicit -> ExplicitConversion
3770         ConvertExplicitStandard -> ExplicitStandardConversion
3771
3772 2003-05-19  Martin Baulig  <martin@ximian.com>
3773
3774         * statement.cs (TypeInfo.StructInfo): Made this type protected.
3775         (TypeInfo): Added support for structs having structs as fields.
3776
3777         * ecore.cs (FieldExpr): Implement IVariable.
3778         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
3779         VariableInfo for the field.
3780
3781 2003-05-18  Martin Baulig  <martin@ximian.com>
3782
3783         * expression.cs (This.DoResolve): Report a CS0027 if we're
3784         emitting a field initializer.
3785
3786 2003-05-18  Martin Baulig  <martin@ximian.com>
3787
3788         * expression.cs (This.ResolveBase): New public function.
3789         (This.DoResolve): Check for CS0188.
3790
3791         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
3792         This.Resolve().
3793
3794         * ecore.cs (MethodGroupExpr.DoResolve): Set the
3795         `instance_expression' to null if we don't have any non-static
3796         methods.
3797
3798 2003-05-18  Martin Baulig  <martin@ximian.com>
3799
3800         Reworked the way how local variables and parameters are handled by
3801         the flow analysis code.
3802
3803         * statement.cs (TypeInfo, VariableMap): New public classes.
3804         (VariableInfo): New public class.  This is now responsible for
3805         checking whether a variable has been assigned.  It is used for
3806         parameters and local variables.
3807         (Block.EmitMeta): Take the InternalParameters as argument; compute
3808         the layout of the flow vectors here.
3809         (Block.LocalMap, Block.ParameterMap): New public properties.
3810         (FlowBranching): The .ctor doesn't get the InternalParameters
3811         anymore since Block.EmitMeta() now computes the layout of the flow
3812         vector.
3813         (MyStructInfo): This class is now known as `StructInfo' and nested
3814         in `TypeInfo'; we don't access this directly anymore.
3815
3816         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
3817         property and removed IsAssigned(), IsFieldAssigned(),
3818         SetAssigned() and SetFieldAssigned(); we now call them on the
3819         VariableInfo so we don't need to duplicate this code everywhere.
3820
3821         * expression.cs (ParameterReference): Added `Block block' argument
3822         to the .ctor.
3823         (LocalVariableReference, ParameterReference, This): The new
3824         VariableInfo class is now responsible for all the definite
3825         assignment stuff.
3826
3827         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
3828         IsParameterAssigned, SetParameterAssigned): Removed.
3829
3830 2003-05-18  Martin Baulig  <martin@ximian.com>
3831
3832         * typemanager.cs (InitCoreTypes): Try calling
3833         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
3834         the 3-args-version.  Corlib now also needs our `void_type'.
3835         (GetMethod): Added overloaded version which takes an optional
3836         `bool report_errors' to allow lookups of optional methods.
3837
3838 2003-05-12  Martin Baulig  <martin@ximian.com>
3839
3840         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
3841         only used for locals and not for parameters.
3842
3843 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
3844
3845         * support.cs (InternalParameters.ParameterType): Return the
3846         ExternalType of the parameter.
3847
3848         * parameter.cs (Parameter.ExternalType): drop the two arguments,
3849         they were unused.
3850
3851 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
3852
3853         * class.cs (MethodData.Define): Do not set the `newslot' on
3854         interface members, if they are also flagged as "override".
3855
3856         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
3857         better code for ++i and i++.  This only works for static fields
3858         and local variables.
3859
3860         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
3861         want to pull the DeclSpace out of the builder_to_declspace instead
3862         of the TypeBuilder (like in TypeContainer.FindMembers).
3863
3864         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
3865         instead of LookupTypeContainer.  Fixes the crash on .NET for
3866         looking up interface members.
3867
3868         * const.cs: Create our own emit context during the Definition
3869         stage, so that constants are evaluated in the proper context, when
3870         a recursive definition happens.
3871
3872 2003-05-11  Martin Baulig  <martin@ximian.com>
3873
3874         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
3875         new block for a switch section.
3876         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
3877         the adding/lookup in the switch block.  Fixes #39828.
3878
3879 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
3880
3881         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
3882         functionality: I needed to convert the data after I had performed
3883         the add/sub operation into the operands type size.
3884
3885         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
3886         pass the type for the box operation, otherwise the resulting
3887         object would have been of type object.
3888
3889         (BoxedCast): Add constructor to specify the type to box as.
3890
3891 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
3892
3893         * iterators.cs: I was reusing the `count' variable inadvertently,
3894         take steps to not allow this to happen.
3895
3896 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
3897
3898         * attribute.cs (Attribute.Resolve): Params attributes are encoded
3899         by creating an array at the point where the params starts and
3900         putting all those arguments there, then adjusting the size of the
3901         array.
3902
3903 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
3904
3905         * expression.cs (New.AddressOf): Implement interface
3906         IMemoryLocation.  This is used when the `new' operator is used in
3907         the context of an invocation to a method on a value type.
3908
3909         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
3910         example. 
3911
3912         * namespace.cs: Also check the using aliases here.
3913
3914         * driver.cs: Move the test for using validity after the types have
3915         been entered, so we do a single pass that also includes the using
3916         aliases. 
3917
3918         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
3919         in the regular case.   CreateSiblingForFinally is doing extra
3920         error checking.
3921
3922         * attribute.cs (GetAttributeArgumentExpression): Store the result
3923         on an out value, and use the return value to indicate failure
3924         instead of using null (which is a valid return for Constant.GetValue).
3925
3926         * statement.cs: Perform the analysis flow for the increment
3927         portion after the statement, because this will be the real flow of
3928         execution.  Fixes #42385
3929
3930         * codegen.cs (EmitContext.EmitArgument,
3931         EmitContext.EmitStoreArgument): New helper functions when the
3932         RemapToProxy flag is set.
3933
3934         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
3935         function.
3936
3937         Add support for remapping parameters. 
3938
3939         * iterators.cs: Propagate parameter values;  Store parameter
3940         values in the proxy classes.
3941
3942 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
3943
3944         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
3945         need a proxy reference;  I do not know what I was thinking
3946
3947         * cs-parser.jay (constructor_initializer): catch another error,
3948         and display nice message.
3949
3950         (field_declaration): catch void field declaration
3951         to flag a better error. 
3952
3953         * class.cs (MemberBase.CheckBase): Report an error instead of a
3954         warning if a new protected member is declared in a struct. 
3955         (Field.Define): catch the error of readonly/volatile.
3956
3957         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
3958
3959         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
3960         volatile variable is taken
3961
3962 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
3963
3964         * statement.cs (Fixed.Resolve): Report an error if we are not in
3965         an unsafe context.
3966
3967 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
3968
3969         * typemanager.cs: reuse the code that handles type clashes for
3970         delegates and enumerations.
3971
3972         * class.cs (Report28): Always report.
3973
3974         * expression.cs (EncodeAsAttribute): Allow nulls here.
3975
3976 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
3977
3978         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
3979         the functionality for testing whether an expression is valid for
3980         an attribute here.  Also handle the case of arrays of elements
3981         being stored. 
3982
3983         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
3984         encoding a linear array into an array of objects that are suitable
3985         to be passed to an CustomAttributeBuilder.
3986
3987         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
3988
3989         * ecore.cs: (FieldExpr): Handle field remapping here.
3990
3991         * iteratators.cs: Pass the instance variable (if the method is an
3992         instance method) to the constructors, so we can access the field
3993         variables on the class.
3994
3995         TODO: Test this with structs.  I think the THIS variable on
3996         structs might have to be a pointer, and not a refenrece
3997
3998 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
3999
4000         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
4001         local variables to fields in a proxy class.
4002
4003         * iterators.cs (PopulateProxy): Rename our internal fields to
4004         <XXX>.  
4005         Create a <THIS> field if we are an instance method, so we can
4006         reference our parent container variables.
4007         (MapVariable): Called back from the EmitContext code to enter a
4008         new variable to field mapping into the proxy class (we just create
4009         a FieldBuilder).
4010
4011         * expression.cs
4012         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
4013         for using the remapped locals to fields.
4014
4015         I placed the code here, because that gives the same semantics to
4016         local variables, and only changes the Emit code.
4017
4018         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
4019         statements inside iterators.
4020         (VariableInfo): Add a FieldBuilder for the cases when we are
4021         remapping local variables to fields in a proxy class
4022
4023         * ecore.cs (SimpleNameResolve): Avoid testing two times for
4024         current_block != null.
4025
4026         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
4027         not cope with strings, as it has been moved to the
4028         TableSwitchEmit.  Fixed bug in switch generation.
4029
4030         * expression.cs (New.DoResolve): Provide more context for the user
4031         when reporting an error.
4032
4033         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
4034         pointers. 
4035
4036         * expression.cs (MemberAccess.DoResolve): When we get a type back,
4037         check the permissions for it.  Note than in a type-resolution
4038         context the check was already present in DeclSpace.ResolveType,
4039         but was missing from the MemberAccess.
4040
4041         (ArrayCreation.CheckIndices): warn if the user has
4042         more nested levels of expressions, but there are no more
4043         dimensions specified.  Avoids crash on bug 41906.
4044
4045 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
4046
4047         * statement.cs (Block): replace Implicit bool, for a generic
4048         flags.   
4049         New flag: `Unchecked'.  This is used during the EmitMeta phase
4050         (which is out-of-line with the regular Resolve/Emit process for a
4051         statement, as this is done ahead of time, but still gets a chance
4052         to call constant resolve).
4053
4054         (Block.Flags): new enum for adding a new flag.
4055
4056         (Block.EmitMeta): track the state of unchecked.
4057
4058         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
4059         to enable constant resolution to work there as well.
4060
4061 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
4062
4063         * typemanager.cs (ienumerable_type): Also look up
4064         System.Collections.IEnumerable. 
4065
4066 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
4067
4068         TODO: Test more than one conditional per method.
4069
4070         * class.cs (Indexer.Define): Report the location where the user is
4071         referencing the unsupported feature.
4072
4073         (MethodData): Overload the use of `conditionals' to
4074         minimize the creation of needless ArrayLists.   This saves roughly
4075         212kb on my machine.
4076
4077         (Method): Implement the new IIteratorContainer interface.
4078         (Method.SetYields): Implement the method by setting the ModFlags
4079         to contain METHOD_YIELDS.
4080
4081         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
4082         which just got set to null.
4083
4084         * iterators.cs: New file.
4085
4086         (Yield, YieldBreak): New statements.
4087
4088         * statement.cs (Return.Resolve): Flag an error if we are used in
4089         an iterator method.
4090
4091         * codegen.cs (InIterator): New flag set if the code is being
4092         compiled in an iterator method.
4093
4094         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
4095         internal modifier, and we just use it to avoid adding extra
4096         fields, as this is seldom used.  
4097
4098         * cs-parser.jay: Add yield_statement (yield and yield break).
4099
4100         * driver.cs: New flag -v2 to turn on version 2 features. 
4101
4102         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
4103         hashtable when v2 is enabled.
4104
4105 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
4106
4107         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
4108         there is already a namespace defined with this name.
4109
4110         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
4111         people upgraded their corlibs.
4112
4113         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
4114         always use fully qualified types, no need to use the compiler
4115         front end.
4116
4117         (TypeManager.IsNamespace): Use binarysearch.
4118
4119         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
4120         AddDelegate): I did not quite use the new IsValid API properly: I
4121         have to pass the short-name and the fullname.  I was passing only
4122         the basename instead of the fullname sometimes. 
4123
4124         (TypeContainer.DefineType): call NamespaceClash.
4125
4126         * interface.cs (Interface.DefineType): use NamespaceClash before
4127         defining the type.
4128
4129         * delegate.cs (Delegate.DefineType): use NamespaceClash before
4130         defining the type.
4131
4132         * enum.cs: (Enum.DefineType): use NamespaceClash before
4133         defining the type.
4134
4135         * typemanager.cs (: 3-line patch that gives us some tasty 11%
4136         speed increase.  First, use the negative_hits cache when we get a
4137         negative.  Second, add the type with its full original name
4138         instead of the new . and + encoded name (reflection uses + to
4139         separate type from a nested type).  Use LookupTypeReflection
4140         directly which bypasses the type->name hashtable (that we already
4141         know does not contain the type.
4142
4143         * decl.cs (DeclSpace.ResolveTypeExpr): track the
4144         location/container type. 
4145
4146         * driver.cs: When passing utf8, use directly the UTF8Encoding.
4147
4148 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
4149
4150         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
4151
4152         * delegate.cs (NewDelegate.Resolve): Test whether an instance
4153         method is being referenced in the method group from a static
4154         context, and report error 120 if so.
4155
4156         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
4157         Error118. 
4158
4159         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
4160         is created, we create the A namespace).
4161
4162         * cs-parser.jay: A namespace also introduces a DeclarationFound.
4163         Fixes #41591
4164
4165 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
4166
4167         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
4168         invocation to ModuleBuilder.GetType with the same values will
4169         return a new type instance, so we need to cache its return
4170         values. 
4171
4172         * expression.cs (Binary.ResolveOperator): Only allow the compare
4173         operators on enums if they are of the same type.
4174
4175         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
4176         types of ValueType on their own case.  Before we were giving them
4177         the same treatment as objects.
4178
4179         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
4180         fullname.  Short name is used to compare against container name.
4181         Fullname is used to check against defined namespace names.
4182
4183         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
4184         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
4185
4186         (Method.CheckBase): Call parent.
4187         (MemberBase.CheckBase): Check for protected members on sealed
4188         classes.
4189         (PropertyBase.CheckBase): Call parent.
4190         (Field.Define): Call parent.
4191
4192         * report.cs: Negative error codes are now mapped to 8000 - code,
4193         so that the display is render more nicely.
4194
4195         * typemanager.cs: Do not use try/catch, instead report a regular
4196         error. 
4197
4198         (GetPointerType, GetReferenceType): These methods provide
4199         mechanisms to obtain the T* and T& from a T.  We had the code
4200         previously scattered around the code base, and it also used
4201         TypeManager.LookupType that would go through plenty of caches.
4202         This one goes directly to the type source.
4203
4204         In some places we did the Type.GetType followed by
4205         ModuleBuilder.GetType, but not in others, so this unifies the
4206         processing as well.
4207
4208         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
4209         statements now that we have namespace information.
4210
4211         * typemanager.cs (IsNamespace): New method, returns whether the
4212         string presented is a namespace or not.
4213
4214         (ComputeNamespaces): New public entry point, computes the list of
4215         available namespaces, using the GetNamespaces API call in Mono, or
4216         the slower version in MS.NET.   
4217
4218         Now before we start the semantic analysis phase, we have a
4219         complete list of namespaces including everything that the user has
4220         provided.
4221
4222         Deleted old code to cache namespaces in .nsc files.
4223
4224 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
4225
4226         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
4227         class/struct location definition Location for the implicit
4228         constructor location.
4229
4230         (Operator.Define): Use the location of the operator for the
4231         implicit Method definition.
4232
4233         (Constructor.Emit): use the constructor location for the implicit
4234         base initializer constructor.
4235
4236         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
4237         and the Expression class now contains two new methods:
4238
4239         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
4240         isolate type lookup from the rest of the resolution process.
4241
4242         Since we use Expressions to hold type definitions due to the way
4243         we parse the input we have historically overloaded Resolve to
4244         perform the Type lookups if a special flag is passed.  Now this is
4245         eliminated and two methods take their place. 
4246
4247         The differences in the two methods between xStep and xTerminal is
4248         that xStep is involved in our current lookup system that uses
4249         SimpleNames to compose a name, while xTerminal is used just to
4250         catch the case where the simplename lookup failed.
4251
4252 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
4253
4254         * expression.cs (ResolveMemberAccess): Remove redundant code.
4255         TypeExpr expressions are always born fully resolved.
4256
4257         * interface.cs (PopulateMethod): Do not lookup the types twice.
4258         We were doing it once during SemanticAnalysis and once during
4259         PopulateMethod.
4260
4261         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
4262         in local variable type definitions, were being returned as a
4263         SimpleName (we decomposed everything into a string), that is
4264         because primary_expression was being used instead of a type in the
4265         grammar (reduce/reduce conflicts).
4266
4267         The part that was wrong is that we converted the expression into a
4268         string (an oversimplification in one hand, compounded with primary
4269         expressions doing string concatenation).
4270
4271         So things like:
4272
4273         A.B.C [] x;
4274
4275         Would return "A.B.C[]" as a SimpleName.  This stopped things like
4276         using clauses from working on this particular context.  And a type
4277         was being matched directly against "A.B.C[]".
4278
4279         We now use the correct approach, and allow for ComposedCast to be
4280         part of the unary expression.  So the "A.B.C []" become a composed
4281         cast of "A.B.C" (as a nested group of MemberAccess with a
4282         SimpleName at the end) plus the rank composition "[]". 
4283
4284         Also fixes 35567
4285
4286 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
4287
4288         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
4289         for the access level checking.
4290
4291         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
4292         `TypeContainer container', because I kept getting confused when I
4293         was debugging this code.
4294
4295         * expression.cs (Indexers): Instead of tracking getters/setters,
4296         we now track them in parallel.  We create one arraylist less, but
4297         most importantly it is possible now for the LValue code to find a
4298         matching get for a set.
4299
4300         (IndexerAccess.DoResolveLValue): Update the code.
4301         GetIndexersForType has been modified already to extract all the
4302         indexers from a type.  The code assumed it did not.
4303
4304         Also make the code set the correct return type for the indexer.
4305         This was fixed a long time ago for properties, but was missing for
4306         indexers.  It used to be void_type.
4307
4308         (Binary.Emit): Test first for doubles instead of
4309         floats, as they are more common.
4310
4311         (Binary.EmitBranchable): Use the .un version of the branch opcodes
4312         when dealing with floats and the <=, >= operators.  This fixes bug
4313         #39314 
4314
4315         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
4316         to load the array value by emitting a load on the foreach variable
4317         type.  This was incorrect.  
4318
4319         We now emit the code to load an element using the the array
4320         variable type, and then we emit the conversion operator.
4321
4322         Fixed #40176
4323
4324 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
4325
4326         * attribute.cs: Avoid allocation of ArrayLists in the common case.
4327
4328 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
4329
4330         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
4331         test for protection before we test for signatures. 
4332
4333         (MethodSignature.ToString): implement.
4334
4335         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
4336         to the case where we reduced into a LongConstant.
4337
4338         * decl.cs (CheckAccessLevel): If the type is an array, we can not
4339         depend on whether the information is acurrate, because the
4340         Microsoft runtime will always claim that the array type is public,
4341         regardless of the real state.
4342
4343         If the type is a pointer, another problem happens: the type is
4344         reported as non-public in Microsoft.  
4345
4346         In both cases we have to call CheckAccessLevel recursively with
4347         the underlying type as the argument to be tested.
4348
4349 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
4350
4351         * assign.cs (Assign.Emit): If we are dealing with a compound
4352         assignment expression, we should use the code path that stores the
4353         intermediate result in a temporary value.  This fixes #40903.
4354
4355         *expression.cs (Indirection.ToString): Provide ToString method for
4356         debugging. 
4357
4358 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
4359
4360         * class.cs: Null out fields holding references to Block objects so
4361         they can be garbage collected.
4362
4363         * expression.cs (OverloadResolve): Remove unused local.
4364
4365 2003-04-07  Martin Baulig  <martin@ximian.com>
4366
4367         * codegen.cs (EmitContext.CurrentFile): New public field.
4368         (EmitContext.Mark): Use the CurrentFile to check whether the
4369         location is in the correct file.
4370         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
4371
4372 2003-04-07  Martin Baulig  <martin@ximian.com>
4373
4374         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
4375
4376         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
4377         location.  [FIXME: The location argument which gets passed to this
4378         method is sometimes wrong!]
4379
4380 2003-04-07  Nick Drochak <ndrochak@gol.com>
4381
4382         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
4383
4384 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
4385
4386         * expression.cs (Indirection.EmitAssign): We were using the
4387         temporary, but returning immediately instead of continuing the
4388         EmitAssing flow.
4389
4390 2003-04-06  Martin Baulig  <martin@ximian.com>
4391
4392         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
4393         if it's a nested child, but also deriving from the outer class.
4394         See test 190.cs.
4395
4396         * typemanager.cs (IsNestedChildOf): Make this work if it's a
4397         nested child, but also deriving from the outer class.  See
4398         test-190.cs.
4399         (FilterWithClosure): We may access private members of the outer
4400         class if we're a nested child and deriving from the outer class.
4401         (RealMemberLookup): Only set `closure_private_ok' if the
4402         `original_bf' contained BindingFlags.NonPublic.
4403
4404 2003-04-05  Martin Baulig  <martin@ximian.com>
4405
4406         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
4407
4408 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
4409
4410         * class.cs (Event.Define): Do not allow abstract events to have
4411         initializers. 
4412
4413 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
4414
4415         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
4416         block in event declarations.
4417
4418         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
4419         value type, get its address.
4420
4421         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
4422         leaving a class on the stack instead of a boolean value (int
4423         0/1).  Change the code so we compare against null, and then the
4424         result against zero.
4425
4426         * class.cs (TypeContainer.GetClassBases): We were checking for the
4427         parent class being sealed too late.
4428
4429         * expression.cs (Binary.Emit): For <= and >= when dealing with
4430         floating point values, use cgt.un and clt.un instead of cgt and
4431         clt alone.
4432
4433 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
4434
4435         * statement.cs: Apply the same optimization as MS: skip the 
4436         GetEnumerator returning an IEnumerator, and use the one returning a 
4437         CharEnumerator instead. This allows us to avoid the try-finally block 
4438         and the boxing.
4439
4440 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
4441
4442         * cs-parser.jay: Attributes cannot be applied to
4443                          namespaces. Fixes #40473
4444
4445 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4446
4447         * class.cs:
4448         (Add*): check if the name is valid using the full name for constants,
4449         fields, properties and events.
4450
4451 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
4452
4453         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
4454         char constants to be part of the enumeration.
4455
4456         * expression.cs (Conditional.DoResolve): Add support for operator
4457         true. Implements the missing functionality from 14.12
4458
4459         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
4460         operator true/false as required by the spec.
4461
4462         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
4463         implicit conversion to boolean.
4464
4465         * statement.cs (Statement.ResolveBoolean): A boolean expression is
4466         also one where the type implements `operator true'. 
4467
4468         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
4469         get an expression that will invoke operator true based on an
4470         expression.  
4471
4472         (GetConversionOperators): Removed the hack that called op_True
4473         here.  
4474
4475         (Expression.ResolveBoolean): Move this from Statement.
4476
4477 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
4478
4479         * ecore.cs (FieldExpr): do not allow initialization of initonly
4480         fields on derived classes
4481
4482 2003-03-13  Martin Baulig  <martin@ximian.com>
4483
4484         * statement.cs (Block.Emit): Call ig.BeginScope() and
4485         ig.EndScope() when compiling with debugging info; call
4486         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
4487
4488 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
4489
4490         * expression.cs (Indexers): Do not construct immediately, allow
4491         for new members to be appended as we go.  Fixes 38143
4492
4493 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4494
4495         * expression.cs: save/restore context when resolving an unchecked
4496         expression.
4497
4498 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
4499
4500         * cfold.cs: Catch division by zero in modulus operator during
4501         constant folding.
4502
4503 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
4504
4505         * interface.cs (Interface.DefineMembers): Avoid defining members
4506         twice. 
4507
4508 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
4509
4510         * driver.cs: handle the +/- options for -noconfig
4511
4512         * statement.cs (Unckeched.Resolve): Also track the state of
4513         unchecked in the Resolve phase.
4514
4515 2003-02-27  Martin Baulig  <martin@ximian.com>
4516
4517         * ecore.cs (Expression.MemberLookup): Don't create a
4518         MethodGroupExpr for something which is not a method.  Fixes #38291.
4519
4520 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
4521
4522         * class.cs (MemberBase.CheckParameters): Also check that the type
4523         is unmanaged if it is a pointer.
4524
4525         * expression.cs (SizeOf.Resolve): Add location information.
4526
4527         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
4528         a managed type is declared.
4529
4530         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
4531         parameter modifiers as well.  Fixes bug 38606
4532
4533         * class.cs: Very sad.  Am backing out the speed up changes
4534         introduced by the ArrayList -> Array in the TypeContainer, as they
4535         were not actually that much faster, and introduced a bug (no error
4536         reports on duplicated methods).
4537
4538         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
4539         source first, this will guarantee that we have a valid expression
4540         before calling in lower levels functions that will require a
4541         resolved object.  Then use this original_source in the
4542         target.ResolveLValue instead of the original source that was
4543         passed to us.
4544
4545         Another change.  Use target.Resolve instead of LValueResolve.
4546         Although we are resolving for LValues, we will let the Assign code
4547         take care of that (it will be called again from Resolve).  This
4548         basically allows code like this:
4549
4550         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
4551         class Y { void A (X x) { x [0] += o; }
4552
4553         The problem was that the indexer was trying to resolve for
4554         set_Item (idx, object o) and never finding one.  The real set_Item
4555         was set_Item (idx, X).  By delaying the process we get the right
4556         semantics. 
4557
4558         Fixes bug 36505
4559
4560 2003-02-23  Martin Baulig  <martin@ximian.com>
4561
4562         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
4563         while calling DoEmit ().
4564
4565         * codegen.cs (EmitContext.Mark): Don't mark locations in other
4566         source files; if you use the #line directive inside a method, the
4567         compiler stops emitting line numbers for the debugger until it
4568         reaches the end of the method or another #line directive which
4569         restores the original file.
4570
4571 2003-02-23  Martin Baulig  <martin@ximian.com>
4572
4573         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
4574
4575 2003-02-23  Martin Baulig  <martin@ximian.com>
4576
4577         * statement.cs (Block.AddChildVariableNames): We need to call this
4578         recursively, not just for our immediate children.
4579
4580 2003-02-23  Martin Baulig  <martin@ximian.com>
4581
4582         * class.cs (Event.Define): Always make the field private, like csc does.
4583
4584         * typemanager.cs (TypeManager.RealMemberLookup): Make events
4585         actually work, fixes bug #37521.
4586
4587 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
4588
4589         * delegate.cs: When creating the various temporary "Parameters"
4590         classes, make sure that we call the ComputeAndDefineParameterTypes
4591         on those new parameters (just like we do with the formal ones), to
4592         allow them to be resolved in the context of the DeclSpace.
4593
4594         This fixes the bug that Dick observed in Bugzilla #38530.
4595
4596 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
4597
4598         * expression.cs (ResolveMemberAccess): When resolving a constant,
4599         do not attempt to pull a constant if the value was not able to
4600         generate a valid constant.
4601
4602         * const.cs (LookupConstantValue): Do not report more errors than required.
4603
4604 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4605
4606         * expression.cs: fixes bug #38328.
4607
4608 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
4609
4610         * class.cs: Changed all the various members that can be part of a
4611         class from being an ArrayList to be an Array of the right type.
4612         During the DefineType type_list, interface_list, delegate_list and
4613         enum_list are turned into types, interfaces, delegates and enums
4614         arrays.  
4615
4616         And during the member population, indexer_list, event_list,
4617         constant_list, field_list, instance_constructor_list, method_list,
4618         operator_list and property_list are turned into their real arrays.
4619
4620         Although we could probably perform this operation earlier, for
4621         good error reporting we need to keep the lists and remove the
4622         lists for longer than required.
4623
4624         This optimization was triggered by Paolo profiling the compiler
4625         speed on the output of `gen-sample-program.pl' perl script. 
4626
4627         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
4628         not crash in methods like MemberLookupFailed that use this field.  
4629
4630         This problem arises when the compiler fails to resolve a type
4631         during interface type definition for example.
4632
4633 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
4634
4635         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
4636         inherit from System.Object, so we have to stop at null, not only
4637         when reaching System.Object.
4638
4639 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
4640
4641         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
4642         DeclaredOnly because the parent indexer might have had a different
4643         name, but did not loop until the top of the hierarchy was reached.
4644
4645         The problem this one fixes is 35492: when a class implemented an
4646         indexer from an interface, we were getting the interface method
4647         (which was abstract) and we were flagging an error (can not invoke
4648         abstract method).
4649
4650         This also keeps bug 33089 functioning, and test-148 functioning.
4651
4652         * typemanager.cs (IsSpecialMethod): The correct way of figuring
4653         out if a method is special is to see if it is declared in a
4654         property or event, or whether it is one of the predefined operator
4655         names.   This should fix correctly #36804.
4656
4657 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
4658
4659         The goal here is to remove the dependency on EmptyCast.Peel ().
4660         Killing it completely.
4661
4662         The problem is that currently in a number of places where
4663         constants are expected, we have to "probe" for an EmptyCast, and
4664         Peel, which is not the correct thing to do, as this will be
4665         repetitive and will likely lead to errors. 
4666
4667         The idea is to remove any EmptyCasts that are used in casts that
4668         can be reduced to constants, so we only have to cope with
4669         constants. 
4670
4671         This bug hunt was triggered by Bug 37363 and the desire to remove
4672         the duplicate pattern where we were "peeling" emptycasts to check
4673         whether they were constants.  Now constants will always be
4674         constants.
4675
4676         * ecore.cs: Use an enumconstant here instead of wrapping with
4677         EmptyCast.  
4678
4679         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
4680         throwing me off.  By handling this we can get rid of a few hacks.
4681
4682         * statement.cs (Switch): Removed Peel() code.
4683
4684 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
4685
4686         * class.cs: Location information for error 508
4687
4688         * expression.cs (New.DoResolve): Add a guard against double
4689         resolution of an expression.  
4690
4691         The New DoResolve might be called twice when initializing field
4692         expressions (see EmitFieldInitializers, the call to
4693         GetInitializerExpression will perform a resolve on the expression,
4694         and later the assign will trigger another resolution
4695
4696         This leads to bugs (#37014)
4697
4698         * delegate.cs: The signature for EndInvoke should contain any ref
4699         or out parameters as well.  We were not doing this in the past. 
4700
4701         * class.cs (Field.Define): Do not overwrite the type definition
4702         inside the `volatile' group.  Turns out that volatile enumerations
4703         were changing the type here to perform a validity test, which
4704         broke conversions. 
4705
4706 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
4707
4708         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
4709         and structs, we do not want to load the instance variable
4710
4711         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
4712         enum_type has to be handled like an object reference (implicit
4713         conversions exists from this to object), but the regular IsClass
4714         and IsValueType tests will never return true for this one.
4715
4716         Also we use TypeManager.IsValueType instead of type.IsValueType,
4717         just for consistency with the rest of the code (this is only
4718         needed if we ever use the construct exposed by test-180.cs inside
4719         corlib, which we dont today).
4720
4721 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
4722
4723         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
4724         just InternalCall.
4725
4726 2003-02-09  Martin Baulig  <martin@ximian.com>
4727
4728         * namespace.cs (Namespace..ctor): Added SourceFile argument.
4729         (Namespace.DefineNamespaces): New static public method; this is
4730         called when we're compiling with debugging to add all namespaces
4731         to the symbol file.
4732
4733         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
4734         pass it to the Namespace's .ctor.
4735
4736         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
4737         and MethodBase arguments; pass the namespace ID to the symwriter;
4738         pass the MethodBase instead of the token to the symwriter.
4739         (SymbolWriter.DefineNamespace): New method to add a namespace to
4740         the symbol file.
4741
4742 2003-02-09  Martin Baulig  <martin@ximian.com>
4743
4744         * symbolwriter.cs: New file.  This is a wrapper around
4745         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
4746         methods here in near future.
4747
4748 2003-02-09  Martin Baulig  <martin@ximian.com>
4749
4750         * codegen.cs (EmitContext.Mark): Just pass the arguments to
4751         ILGenerator.MarkSequencePoint() which are actually used by the
4752         symbol writer.
4753
4754 2003-02-09  Martin Baulig  <martin@ximian.com>
4755
4756         * location.cs (SourceFile): New public sealed class.  This
4757         contains the name and an index which is used in the location's token.
4758         (Location): Reserve an appropriate number of bits in the token for
4759         the source file instead of walking over that list, this gives us a
4760         really huge performance improvement when compiling with debugging.
4761
4762         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
4763         `SourceFile' argument instead of a string.
4764         (Driver.ProcessFile): Add all the files via Location.AddFile(),
4765         but don't parse/tokenize here, we need to generate the list of all
4766         source files before we do that.
4767         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
4768         the files.
4769
4770         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
4771         instead of a string.
4772
4773         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
4774         of a string.
4775
4776 2003-02-09  Martin Baulig  <martin@ximian.com>
4777
4778         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
4779         filename on `#line default'.
4780
4781 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
4782
4783         * statement.cs: don't clear the pinned var when the fixed statement
4784         returns from the method (fixes bug#37752).
4785
4786 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
4787
4788         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
4789         to IsValueType.
4790
4791 2003-02-07  Martin Baulig  <martin@ximian.com>
4792
4793         * driver.cs: Removed the `--debug-args' command line argument.
4794
4795         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
4796         automatically by the AsssemblyBuilder.
4797         (CodeGen.InitializeSymbolWriter): We don't need to call any
4798         initialization function on the symbol writer anymore.  This method
4799         doesn't take any arguments.
4800
4801 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
4802
4803         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
4804         from referenced assemblies as well.
4805
4806 2003-02-02  Martin Baulig  <martin@ximian.com>
4807
4808         * class.cs (MethodData.Emit): Generate debugging info for external methods.
4809
4810 2003-02-02  Martin Baulig  <martin@ximian.com>
4811
4812         * class.cs (Constructor.Emit): Open the symbol writer before
4813         emitting the constructor initializer.
4814         (ConstructorInitializer.Emit): Call ec.Mark() to allow
4815         single-stepping through constructor initializers.
4816
4817 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
4818
4819         * class.cs: Handle error 549: do not allow virtual methods in
4820         sealed classes. 
4821
4822 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
4823
4824         * decl.cs: Check access levels when resolving types
4825
4826 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
4827
4828         * statement.cs: Add parameters and locals set in catch blocks that might 
4829         return to set vector
4830
4831 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
4832
4833         * class.cs (Operator): Set the SpecialName flags for operators.
4834
4835         * expression.cs (Invocation.DoResolve): Only block calls to
4836         accessors and operators on SpecialName methods.
4837
4838         (Cast.TryReduce): Handle conversions from char constants.
4839
4840
4841 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
4842
4843         * statement.cs: small memory and time optimization in FlowBranching.
4844
4845 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
4846
4847         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
4848         problem that the last fix but in the other sid (Set).
4849
4850         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
4851         access when there is no indexer in the hierarchy.
4852
4853 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
4854
4855         * class.cs: Combine some if statements.
4856
4857 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4858
4859         * driver.cs: fixed bug #37187.
4860
4861 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
4862
4863         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
4864         any indexer, it's needed to build a list with all the indexers in the
4865         hierarchy (AllGetters), else we have problems. Fixes #35653.
4866
4867 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
4868
4869         * class.cs (MethodData.Define): It is wrong for an interface
4870         implementation to be static in both cases: explicit and implicit.
4871         We were only handling this in one case.
4872
4873         Improve the if situation there to not have negations.
4874
4875         * class.cs (Field.Define): Turns out that we do not need to check
4876         the unsafe bit on field definition, only on usage.  Remove the test.
4877
4878 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4879
4880         * driver.cs: use assembly.Location instead of Codebase (the latest
4881         patch made mcs fail when using MS assemblies).
4882
4883 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
4884
4885         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
4886         get the path to *corlib.dll.
4887
4888 2003-01-21  Nick Drochak <ndrochak@gol.com>
4889
4890         * cs-tokenizer.cs:
4891         * pending.cs:
4892         * typemanager.cs: Remove compiler warnings
4893
4894 2003-01-20  Duncan Mak  <duncan@ximian.com>
4895
4896         * AssemblyInfo.cs: Bump the version number to 0.19.
4897
4898 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4899
4900         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
4901
4902 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
4903
4904         * class.cs (Constructor::Emit): Emit debugging info for constructors.
4905
4906 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
4907
4908         * cs-parser.jay: Small fix: we were not comparing the constructor
4909         name correctly.   Thanks to Zoltan for the initial pointer.
4910
4911 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
4912
4913         * cs-tokenizer.cs: Set file name when specified with #line
4914
4915 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
4916
4917         * cs-parser.jay: Only perform the constructor checks here if we
4918         are named like the class;  This will help provider a better
4919         error.  The constructor path is taken when a type definition is
4920         not found, but most likely the user forgot to add the type, so
4921         report that rather than the constructor error.
4922
4923 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
4924
4925         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
4926         allocations.
4927
4928 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
4929
4930         * cs-parser.jay: Add cleanup call.
4931
4932 2003-01-13  Duncan Mak  <duncan@ximian.com>
4933
4934         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
4935         consistent with other methods.
4936
4937 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
4938
4939         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
4940
4941 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
4942
4943         * attribute.cs: only set GuidAttr to true when we have a
4944         GuidAttribute.
4945
4946 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4947
4948         * ecore.cs:
4949         * expression.cs:
4950         * typemanager.cs: fixes to allow mcs compile corlib with the new
4951         Type.IsSubclassOf fix.
4952
4953 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
4954
4955         * expression.cs (LocalVariableReference.DoResolve): Classify a
4956         constant as a value, not as a variable.   Also, set the type for
4957         the variable.
4958
4959         * cs-parser.jay (fixed_statement): take a type instead of a
4960         pointer_type, so we can produce a better error message later.
4961
4962         * statement.cs (Fixed.Resolve): Flag types that are not pointers
4963         as an error.  
4964
4965         (For.DoEmit): Make inifinite loops have a
4966         non-conditional branch back.
4967
4968         (Fixed.DoEmit): First populate the pinned variables, then emit the
4969         statement, then clear the variables.  Before I was emitting the
4970         code once for each fixed piece.
4971
4972
4973 2003-01-08  Martin Baulig  <martin@ximian.com>
4974
4975         * statement.cs (FlowBranching.MergeChild): A break in a
4976         SWITCH_SECTION does not leave a loop.  Fixes #36155.
4977
4978 2003-01-08  Martin Baulig  <martin@ximian.com>
4979
4980         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
4981         lives in the same number space than `param_map'.  Fixes #36154.
4982
4983 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
4984
4985         * cs-parser.jay (constructor_declaration): Set the
4986         Constructor.ModFlags before probing for it.  This makes the
4987         compiler report 514, 515 and 132 (the code was there, but got
4988         broken). 
4989
4990         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
4991         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
4992         (GotoCase.Resolve): Set `Returns' to ALWAYS.
4993
4994 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
4995
4996         * enum.cs: create the enum static fields using the enum type.
4997
4998 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
4999
5000         * class.cs: don't try to create the ParamBuilder for the return
5001         type if it's not needed (and handle it breaking for the ms runtime
5002         anyway).
5003
5004 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
5005
5006         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
5007
5008 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
5009
5010         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
5011         the command.   This showed up while compiling the JANET source
5012         code, which used \r as its only newline separator.
5013
5014 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
5015
5016         * class.cs (Method.Define): If we are an operator (because it
5017         reuses our code), then set the SpecialName and HideBySig.  #36128
5018
5019 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
5020
5021         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
5022         exception, report error 120 `object reference required'.
5023
5024         * driver.cs: Add --pause option, used during to measure the size
5025         of the process as it goes with --timestamp.
5026
5027         * expression.cs (Invocation.DoResolve): Do not allow methods with
5028         SpecialName to be invoked.
5029
5030 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
5031
5032         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
5033         number before adding it.
5034
5035 2002-12-21  Ravi Pratap  <ravi@ximian.com>
5036
5037         * ecore.cs (StandardImplicitConversion): When in an unsafe
5038         context, we allow conversion between void * to any other pointer
5039         type. This fixes bug #35973.
5040
5041 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
5042
5043         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
5044         is not thrown when extensionless outputs are used 
5045
5046 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5047
5048         * rootcontext.cs: fixed compilation of corlib.
5049
5050 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
5051
5052         * attribute.cs (Attributes.Contains): Add new method.
5053
5054         * class.cs (MethodCore.LabelParameters): if the parameter is an
5055         `out' parameter, check that no attribute `[In]' has been passed.
5056
5057         * enum.cs: Handle the `value__' name in an enumeration.
5058
5059 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
5060
5061         * decl.cs: Added special case to allow overrides on "protected
5062         internal" methods
5063
5064 2002-12-18  Ravi Pratap  <ravi@ximian.com>
5065
5066         * attribute.cs (Attributes.AddAttributeSection): Rename to this
5067         since it makes much more sense.
5068
5069         (Attributes.ctor): Don't require a Location parameter.
5070
5071         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
5072
5073         * attribute.cs (ApplyAttributes): Remove extra Location parameters
5074         since we already have that information per attribute.
5075
5076         * everywhere : make appropriate changes.
5077
5078         * class.cs (LabelParameters): Write the code which actually
5079         applies attributes to the return type. We can't do this on the MS
5080         .NET runtime so we flag a warning in the case an exception is
5081         thrown.
5082
5083 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
5084
5085         * const.cs: Handle implicit null conversions here too.
5086
5087 2002-12-17  Ravi Pratap  <ravi@ximian.com>
5088
5089         * class.cs (MethodCore.LabelParameters): Remove the extra
5090         Type [] parameter since it is completely unnecessary. Instead
5091         pass in the method's attributes so that we can extract
5092         the "return" attribute.
5093
5094 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
5095
5096         * cs-parser.jay (parse): Use Report.Error to flag errors instead
5097         of ignoring it and letting the compile continue.
5098
5099         * typemanager.cs (ChangeType): use an extra argument to return an
5100         error condition instead of throwing an exception.
5101
5102 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
5103
5104         * expression.cs (Unary.TryReduce): mimic the code for the regular
5105         code path.  Perform an implicit cast in the cases where we can
5106         implicitly convert to one of the integral types, and then reduce
5107         based on that constant.   This fixes bug #35483.
5108
5109 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5110
5111         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
5112
5113 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5114
5115         * namespace.cs: fixed bug #35489.
5116
5117 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
5118
5119         * class.cs: Remove some dead code.
5120
5121         * cs-parser.jay: Estimate the number of methods needed
5122         (RootContext.MethodCount);
5123
5124         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
5125         numbers instead of StringBuilders.
5126
5127         * support.cs (PtrHashtable): Add constructor with initial size;
5128         We can now reduce reallocations of the method table.
5129
5130 2002-12-10  Ravi Pratap  <ravi@ximian.com>
5131
5132         * attribute.cs (ApplyAttributes): Keep track of the emitted
5133         attributes on a per-target basis. This fixes bug #35413.
5134
5135 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
5136
5137         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
5138         default to the Windows 1252 encoding.
5139
5140         (UnixParseOption): Support version, thanks to Alp for the missing
5141         pointer. 
5142
5143         * AssemblyInfo.cs: Add nice assembly information.
5144
5145         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
5146         (bug 35169).
5147
5148         * cs-parser.jay: Allow a trailing comma before the close bracked
5149         in the attribute_section production.
5150
5151         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
5152         address of the instance was being taken, I will take this out,
5153         because we take the address of the object immediately here.
5154
5155 2002-12-09  Ravi Pratap  <ravi@ximian.com>
5156
5157         * typemanager.cs (AreMultipleAllowed): Take care of the most
5158         obvious case where attribute type is not in the current assembly -
5159         stupid me ;-)
5160
5161 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
5162
5163         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
5164         definitions, instead of doing that afterwards.  
5165
5166         Also we use a nice little hack, depending on the constructor, we
5167         know if we are a "composed" name or a simple name.  Hence, we
5168         avoid the IndexOf test, and we avoid 
5169
5170         * codegen.cs: Add code to assist in a bug reporter to track down
5171         the source of a compiler crash. 
5172
5173 2002-12-07  Ravi Pratap  <ravi@ximian.com>
5174
5175         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
5176         types have been emitted for a given element and flag an error
5177         if something which does not have AllowMultiple set is used more
5178         than once.
5179
5180         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
5181         attribute types and their corresponding AllowMultiple properties
5182
5183         (AreMultipleAllowed): Check the property for a given type.
5184
5185         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
5186         property in the case we have a TypeContainer.
5187
5188         (Attributes.AddAttribute): Detect duplicates and just skip on
5189         adding them. This trivial fix catches a pretty gross error in our
5190         attribute emission - global attributes were being emitted twice!
5191
5192         Bugzilla bug #33187 is now fixed.
5193
5194 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
5195
5196         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
5197         instead of pp_and).
5198
5199         * expression.cs (Binary.ResolveOperator): I can only use the
5200         Concat (string, string, string) and Concat (string, string,
5201         string, string) if the child is actually a concatenation of
5202         strings. 
5203
5204 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
5205
5206         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
5207         context where we need a 2-character lookahead.
5208
5209         * pending.cs (PendingImplementation): Rework so we can keep track
5210         of interface types all the time, and flag those which were
5211         implemented by parents as optional.
5212
5213 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
5214
5215         * expression.cs (Binary.ResolveOperator): Use
5216         String.Concat(string,string,string) or
5217         String.Concat(string,string,string,string) when possible. 
5218
5219         * typemanager: More helper methods.
5220
5221
5222 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
5223
5224         * pending.cs: remove the bogus return from GetMissingInterfaces()
5225         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
5226
5227 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5228
5229         * namespace.cs: avoid duplicated 'using xxx' being added to
5230         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
5231         when we get more than one 'using' statement for the same namespace.
5232         Report a CS0105 warning for it.
5233
5234 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
5235
5236         * cs-tokenizer.cs (consume_identifier): use read directly, instead
5237         of calling getChar/putback, uses internal knowledge of it.    
5238
5239         (xtoken): Reorder tokenizer so most common patterns are checked
5240         first.  This reduces the compilation time in another 5% (from 8.11s
5241         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
5242
5243         The parsing time is 22% of the compilation in mcs, and from that
5244         64% is spent on the tokenization process.  
5245
5246         I tried using a binary search for keywords, but this is slower
5247         than the hashtable.  Another option would be to do a couple of
5248         things:
5249
5250                 * Not use a StringBuilder, instead use an array of chars,
5251                   with a set value.  Notice that this way we could catch
5252                   the 645 error without having to do it *afterwards*.
5253
5254                 * We could write a hand-parser to avoid the hashtable
5255                   compares altogether.
5256
5257         The identifier consumption process takes 37% of the tokenization
5258         time.  Another 15% is spent on is_number.  56% of the time spent
5259         on is_number is spent on Int64.Parse:
5260
5261                 * We could probably choose based on the string length to
5262                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
5263                   computations. 
5264
5265         Another 3% is spend on wrapping `xtoken' in the `token' function.
5266
5267         Handle 0xa0 as whitespace (#34752)
5268
5269 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
5270
5271         * typemanager.cs (IsCLRType): New routine to tell whether a type
5272         is one of the builtin types.  
5273
5274         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
5275         typecode in more places instead of doing pointer comparissions.
5276         We could leverage some knowledge about the way the typecodes are
5277         laid out.
5278
5279         New code to cache namespaces in assemblies, it is currently not
5280         invoked, to be used soon.
5281
5282         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
5283
5284         * expression.cs (Binary.ResolveOperator): specially handle
5285         strings, and do not perform user-defined operator overloading for
5286         built-in types.
5287
5288 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
5289
5290         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
5291         internalcall as it is a pretty simple operation;  Avoid whenever
5292         possible to call Char.IsLetter.
5293
5294         (consume_identifier): Cut by half the number of
5295         hashtable calls by merging the is_keyword and GetKeyword behavior.
5296
5297         Do not short-circuit, because if we do, we
5298         report errors (ie, #if false && true would produce an invalid
5299         directive error);
5300
5301
5302 2002-11-24  Martin Baulig  <martin@ximian.com>
5303
5304         * expression.cs (Cast.TryReduce): If we're in checked syntax,
5305         check constant ranges and report a CS0221.  Fixes #33186.
5306
5307 2002-11-24  Martin Baulig  <martin@ximian.com>
5308
5309         * cs-parser.jay: Make this work for uninitialized variable
5310         declarations in the `for' initializer.  Fixes #32416.
5311
5312 2002-11-24  Martin Baulig  <martin@ximian.com>
5313
5314         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
5315         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
5316
5317 2002-11-24  Martin Baulig  <martin@ximian.com>
5318
5319         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
5320         argument; if true, we also check for user-defined conversions.
5321         This is only needed if both arguments are of a user-defined type.
5322         Fixes #30443, added test-175.cs.
5323         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
5324
5325         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
5326
5327 2002-11-24  Martin Baulig  <martin@ximian.com>
5328
5329         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
5330         function to get the store opcode.
5331         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
5332         only emit the Ldelema if the store opcode is Stobj.  You must run
5333         both test-34 and test-167 to test this.  Fixes #34529.
5334
5335 2002-11-23  Martin Baulig  <martin@ximian.com>
5336
5337         * ecore.cs (Expression.MemberLookup): Added additional
5338         `qualifier_type' argument which is used when we're being called
5339         from MemberAccess.DoResolve() and null if we're called from a
5340         SimpleName lookup.
5341         (Expression.MemberLookupFailed): New method to report errors; this
5342         does the CS1540 check and reports the correct error message.
5343
5344         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
5345         argument for the CS1540 check and redone the way how we're dealing
5346         with private members.  See the comment in the source code for details.
5347         (FilterWithClosure): Reverted this back to revision 1.197; renamed
5348         `closure_start_type' to `closure_qualifier_type' and check whether
5349         it's not null.  It was not this filter being broken, it was just
5350         being called with the wrong arguments.
5351
5352         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
5353         and pass it the correct `qualifier_type'; this also does the error
5354         handling for us.
5355
5356 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
5357
5358         * expression.cs (Invocation.EmitParams): If the we are dealing
5359         with a non-built-in value type, load its address as well.
5360
5361         (ArrayCreation): Use a a pretty constant instead
5362         of the hardcoded value 2.   Use 6 instead of 2 for the number of
5363         static initializers.  
5364
5365         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
5366         because they are not really value types, just glorified integers. 
5367
5368         * driver.cs: Do not append .exe, the CSC compiler does not do it.
5369
5370         * ecore.cs: Remove redundant code for enumerations, make them use
5371         the same code path as everything else, fixes the casting issue
5372         with enumerations in Windows.Forms.
5373
5374         * attribute.cs: Do only cast to string if it is a string, the
5375         validation happens later.
5376
5377         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
5378         people upgrade their corlibs.
5379
5380         * ecore.cs: Oops, enumerations were not following the entire code path
5381
5382 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
5383
5384         * typemanager.cs (FilterWithClosure): Commented out the test for
5385         1540 in typemanager.cs, as it has problems when accessing
5386         protected methods from a parent class (see test-174.cs). 
5387
5388         * attribute.cs (Attribute.ValidateGuid): new method.
5389         (Attribute.Resolve): Use above.
5390
5391 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
5392
5393         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
5394
5395         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
5396         handling for enumerations, as we only needed the TypeContainer
5397         functionality to begin with (this is required for the fix below to
5398         work for enums that reference constants in a container class for
5399         example). 
5400
5401         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
5402
5403         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
5404         a valid TypeBuilder to perform lookups on.o
5405
5406         * class.cs (InheritableMemberSignatureCompare): Use true in the
5407         call to GetGetMethod and GetSetMethod, because we are comparing
5408         the signature, and we need to get the methods *even* if they are
5409         private. 
5410
5411         (PropertyBase.CheckBase): ditto.
5412
5413         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
5414         GotoCase.Resolve): Use Peel on EmpytCasts.
5415
5416         * ecore.cs (EmptyCast): drop child, add Peel method.
5417
5418 2002-11-17  Martin Baulig  <martin@ximian.com>
5419
5420         * ecore.cs (EmptyCast.Child): New public property.
5421
5422         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
5423         label resolved to an EmptyCast.  Fixes #34162.
5424         (GotoCase.Resolve): Likewise.
5425         (Block.EmitMeta): Likewise.
5426
5427 2002-11-17  Martin Baulig  <martin@ximian.com>
5428
5429         * expression.cs (Invocation.BetterConversion): Prefer int over
5430         uint; short over ushort; long over ulong for integer literals.
5431         Use ImplicitConversionExists instead of StandardConversionExists
5432         since we also need to check for user-defined implicit conversions.
5433         Fixes #34165.  Added test-173.cs.
5434
5435 2002-11-16  Martin Baulig  <martin@ximian.com>
5436
5437         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
5438         with the `true' and `false' literals.  Fixes #33151.
5439
5440 2002-11-16  Martin Baulig  <martin@ximian.com>
5441
5442         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
5443         October 22nd; don't do the cs1540 check for static members.
5444
5445         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
5446         now using our own filter here and doing the cs1540 check again.
5447
5448 2002-11-16  Martin Baulig  <martin@ximian.com>
5449
5450         * support.cs (InternalParameters): Don't crash if we don't have
5451         any fixed parameters.  Fixes #33532.
5452
5453 2002-11-16  Martin Baulig  <martin@ximian.com>
5454
5455         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
5456         when looking up static methods to make this work on Windows.
5457         Fixes #33773.
5458
5459 2002-11-16  Martin Baulig  <martin@ximian.com>
5460
5461         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
5462         a setter rather than using PropertyInfo.CanWrite.
5463
5464 2002-11-15  Nick Drochak  <ndrochak@gol.com>
5465
5466         * class.cs: Allow acces to block member by subclasses. Fixes build
5467         breaker.
5468
5469 2002-11-14  Martin Baulig  <martin@ximian.com>
5470
5471         * class.cs (Constructor.Emit): Added the extern/block check.
5472         Fixes bug #33678.
5473
5474 2002-11-14  Martin Baulig  <martin@ximian.com>
5475
5476         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
5477         iteration while looking for indexers, this is needed because the
5478         indexer may have a different name in our base classes.  Fixed the
5479         error reporting (no indexers at all, not get accessor, no
5480         overloaded match).  Fixes bug #33089.
5481         (IndexerAccess.DoResolveLValue): Likewise.
5482
5483 2002-11-14  Martin Baulig  <martin@ximian.com>
5484
5485         * class.cs (PropertyBase.CheckBase): Make this work for multiple
5486         indexers.  Fixes the first part of bug #33089.
5487         (MethodSignature.InheritableMemberSignatureCompare): Added support
5488         for properties.
5489
5490 2002-11-13  Ravi Pratap  <ravi@ximian.com>
5491
5492         * attribute.cs (Attribute.Resolve): Catch the
5493         NullReferenceException and report it since it isn't supposed to
5494         happen. 
5495
5496 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
5497
5498         * expression.cs (Binary.EmitBranchable): Also handle the cases for
5499         LogicalOr and LogicalAnd that can benefit from recursively
5500         handling EmitBranchable.  The code now should be nice for Paolo.
5501
5502 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
5503
5504         * typemanager.cs (LookupType): Added a negative-hit hashtable for
5505         the Type lookups, as we perform quite a number of lookups on
5506         non-Types.  This can be removed once we can deterministically tell
5507         whether we have a type or a namespace in advance.
5508
5509         But this might require special hacks from our corlib.
5510
5511         * TODO: updated.
5512
5513         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
5514         and double which avoids a conversion from an integer to a double.
5515
5516         * expression.cs: tiny optimization, avoid calling IsConstant,
5517         because it effectively performs the lookup twice.
5518
5519 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
5520
5521         But a bogus return here to keep the semantics of the old code
5522         until the Mono runtime is fixed.
5523
5524         * pending.cs (GetMissingInterfaces): New method used to remove all
5525         the interfaces that are already implemented by our parent
5526         classes from the list of pending methods. 
5527
5528         * interface.cs: Add checks for calls after ResolveTypeExpr.
5529
5530 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
5531
5532         * class.cs (Class.Emit): Report warning 67: event not used if the
5533         warning level is beyond 3.
5534
5535         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
5536         being a NullLiteral.
5537
5538         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
5539         specifiers. 
5540
5541         * class.cs (TypeContainer.GetClassBases): Cover a missing code
5542         path that might fail if a type can not be resolved.
5543
5544         * expression.cs (Binary.Emit): Emit unsigned versions of the
5545         operators. 
5546
5547         * driver.cs: use error 5.
5548
5549 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
5550
5551         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
5552
5553 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
5554
5555         * cs-parser.jay (switch_section): A beautiful patch from Martin
5556         Baulig that fixed 33094.
5557
5558 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
5559
5560         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
5561         Check whether the base is abstract and report an error if so.
5562
5563         * expression.cs (IndexerAccess.DoResolveLValue,
5564         IndexerAccess.DoResolve): ditto. 
5565
5566         (Invocation.DoResolve): ditto.
5567
5568         (Invocation.FullMethodDesc): Improve the report string.
5569
5570         * statement.cs (Block): Eliminate IsVariableDefined as it is
5571         basically just a wrapper for GetVariableInfo.
5572
5573         * ecore.cs (SimpleName): Use new 
5574
5575         * support.cs (ReflectionParamter.ParameterType): We unwrap the
5576         type, as we return the actual parameter ref/unref state on a
5577         different call.
5578
5579 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
5580
5581         * support.cs: Return proper flags REF/OUT fixing the previous
5582         commit.  
5583
5584         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
5585         not used to mean `ref' but `ref or out' in ParameterReference
5586
5587         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
5588         full type signature instead of calling TypeManger.CSharpName
5589         ourselves. 
5590
5591         * support.cs (InternalParameters.ParameterDesc): Do not compare
5592         directly to the modflags, because REF/OUT will actually be bitsets
5593         if set. 
5594
5595         * delegate.cs (VerifyMethod): Check also the modifiers.
5596
5597         * cs-tokenizer.cs: Fix bug where floating point values with an
5598         exponent where a sign was missing was ignored.
5599
5600         * driver.cs: Allow multiple assemblies to be specified in a single
5601         /r: argument
5602
5603 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
5604
5605         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
5606         because identifiers after a parenthesis would end up in this kind
5607         of production, and we needed to desamiguate it for having casts
5608         like:
5609
5610                 (UserDefinedType *) xxx
5611
5612 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
5613
5614         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
5615         we should set on the Bindingflags.NonPublic, but not turn on
5616         private_ok.  private_ok controls whether a Private member is
5617         returned (this is chekced on the filter routine), while the
5618         BindingFlags.NonPublic just controls whether private/protected
5619         will be allowed.   This fixes the problem part of the problem of
5620         private properties being allowed to be used in derived classes.
5621
5622         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
5623         so we can call the children DoResolveLValue method (this will
5624         properly signal errors on lvalue assignments to base properties)
5625
5626         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
5627         getter are null, and we have a property info, we know that this
5628         happened because the lookup failed, so we report an error 122 for
5629         protection level violation.
5630
5631         We also silently return if setter and getter are null in the
5632         resolve functions, this condition only happens if we have flagged
5633         the error before.  This is the other half of the problem. 
5634
5635         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
5636         not have accessibility information, that is why we were returning
5637         true in the filter function in typemanager.cs.
5638
5639         To properly report 122 (property is inaccessible because of its
5640         protection level) correctly, we report this error in ResolveAccess
5641         by failing if both the setter and the getter are lacking (ie, the
5642         lookup failed). 
5643
5644         DoResolve and DoLResolve have been modified to check for both
5645         setter/getter being null and returning silently, the reason being
5646         that I did not want to put the knowledge about this error in upper
5647         layers, like:
5648
5649         int old = Report.Errors;
5650         x = new PropertyExpr (...);
5651         if (old != Report.Errors)
5652                 return null;
5653         else
5654                 return x;
5655
5656         So the property expr is returned, but it is invalid, so the error
5657         will be flagged during the resolve process. 
5658
5659         * class.cs: Remove InheritablePropertySignatureCompare from the
5660         class, as we no longer depend on the property signature to compute
5661         whether it is possible to implement a method or not.
5662
5663         The reason is that calling PropertyInfo.GetGetMethod will return
5664         null (in .NET, in Mono it works, and we should change this), in
5665         cases where the Get Method does not exist in that particular
5666         class.
5667
5668         So this code:
5669
5670         class X { public virtual int A { get { return 1; } } }
5671         class Y : X { }
5672         class Z : Y { public override int A { get { return 2; } } }
5673
5674         Would fail in Z because the parent (Y) would not have the property
5675         defined.  So we avoid this completely now (because the alternative
5676         fix was ugly and slow), and we now depend exclusively on the
5677         method names.
5678
5679         (PropertyBase.CheckBase): Use a method-base mechanism to find our
5680         reference method, instead of using the property.
5681
5682         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
5683         routines are gone now.
5684
5685         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
5686         names, they were incorrectly named.
5687
5688         * cs-tokenizer.cs: Return are more gentle token on failure. 
5689
5690         * pending.cs (PendingImplementation.InterfaceMethod): This routine
5691         had an out-of-sync index variable, which caused it to remove from
5692         the list of pending methods the wrong method sometimes.
5693
5694 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
5695
5696         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
5697         CanWrite, because those refer to this particular instance of the
5698         property, and do not take into account the fact that we can
5699         override single members of a property.
5700
5701         Constructor requires an EmitContext.  The resolution process does
5702         not happen here, but we need to compute the accessors before,
5703         because the resolution does not always happen for properties.
5704
5705         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
5706         subclass, before we did not update this flag, but we did update
5707         bindingflags. 
5708
5709         (GetAccessors): Drop this routine, as it did not work in the
5710         presence of partially overwritten set/get methods. 
5711
5712         Notice that this broke the cs1540 detection, but that will require
5713         more thinking. 
5714
5715 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5716
5717         * class.cs:
5718         * codegen.cs:
5719         * driver.cs: issue a warning instead of an error if we don't support
5720         debugging for the platform. Also ignore a couple of errors that may
5721         arise when trying to write the symbols. Undo my previous patch.
5722
5723 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5724
5725         * driver.cs: ignore /debug switch except for Unix platforms.
5726
5727 2002-10-23  Nick Drochak  <ndrochak@gol.com>
5728
5729         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
5730
5731 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
5732
5733         * driver.cs: Do not make mcs-debug conditional, so we do not break
5734         builds that use it.
5735
5736         * statement.cs (UsageVector.MergeChildren): I would like Martin to
5737         review this patch.  But basically after all the children variables
5738         have been merged, the value of "Breaks" was not being set to
5739         new_breaks for Switch blocks.  I think that it should be set after
5740         it has executed.  Currently I set this to the value of new_breaks,
5741         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
5742         conservative, but I do not understand this code very well.
5743
5744         I did not break anything in the build, so that is good ;-)
5745
5746         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
5747
5748 2002-10-20  Mark Crichton  <crichton@gimp.org>
5749
5750         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
5751
5752 2002-10-20  Nick Drochak  <ndrochak@gol.com>
5753
5754         * cfold.cs: Fixed compile blocker.
5755
5756 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
5757
5758         * driver.cs: I was chekcing the key, not the file.
5759
5760 2002-10-19  Ravi Pratap  <ravi@ximian.com>
5761
5762         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
5763         message that we were generating - we just need to silently return
5764         a null.
5765
5766 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
5767
5768         * class.cs (Event.Define): Change my previous commit, as this
5769         breaks the debugger.  This is a temporary hack, as it seems like
5770         the compiler is generating events incorrectly to begin with.
5771
5772         * expression.cs (Binary.ResolveOperator): Added support for 
5773         "U operator - (E x, E y)"
5774
5775         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
5776         y)".
5777
5778         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
5779         init-only variables, but this path did not take into account that
5780         there might be also instance readonly variables.  Correct this
5781         problem. 
5782
5783         This fixes bug 32253
5784
5785         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
5786         delegates as well.
5787
5788         * driver.cs: Change the extension for modules to `netmodule'
5789
5790         * cs-parser.jay: Improved slightly the location tracking for
5791         the debugger symbols.
5792
5793         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
5794         modifiers that were specified instead of the hardcoded value
5795         (FamAndAssem).  This was basically ignoring the static modifier,
5796         and others.  Fixes 32429.
5797
5798         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
5799         fixed a bug in the process (32476)
5800
5801         * expression.cs (ArrayAccess.EmitAssign): Patch from
5802         hwang_rob@yahoo.ca that fixes bug 31834.3
5803
5804 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
5805
5806         * driver.cs: Make the module extension .netmodule.
5807
5808 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
5809
5810         * driver.cs: Report an error if the resource file is not found
5811         instead of crashing.
5812
5813         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
5814         false, like Emit does.
5815
5816 2002-10-16  Nick Drochak  <ndrochak@gol.com>
5817
5818         * typemanager.cs: Remove unused private member.  Also reported mcs
5819         bug to report this as a warning like csc.
5820
5821 2002-10-15  Martin Baulig  <martin@gnome.org>
5822
5823         * statement.cs (Statement.Emit): Made this a virtual method; emits
5824         the line number info and calls DoEmit().
5825         (Statement.DoEmit): New protected abstract method, formerly knows
5826         as Statement.Emit().
5827
5828         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
5829
5830 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
5831
5832         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
5833         have fixed a remaining problem: not every AddXXXX was adding a
5834         fully qualified name.  
5835
5836         Now everyone registers a fully qualified name in the DeclSpace as
5837         being defined instead of the partial name.  
5838
5839         Downsides: we are slower than we need to be due to the excess
5840         copies and the names being registered this way.  
5841
5842         The reason for this is that we currently depend (on the corlib
5843         bootstrap for instance) that types are fully qualified, because
5844         we dump all the types in the namespace, and we should really have
5845         types inserted into the proper namespace, so we can only store the
5846         basenames in the defined_names array.
5847
5848 2002-10-10  Martin Baulig  <martin@gnome.org>
5849
5850         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
5851         from bug #31834, see the bug report for a testcase which is
5852         miscompiled.
5853
5854 2002-10-10  Martin Baulig  <martin@gnome.org>
5855
5856         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
5857         flow analysis code for this.
5858
5859         * statement.cs (Do, While, For): Tell the flow analysis code about
5860         infinite loops.
5861         (FlowBranching.UsageVector): Added support for infinite loops.
5862         (Block.Resolve): Moved the dead code elimination here and use flow
5863         analysis to do it.
5864
5865 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
5866
5867         * class.cs (Field.Define): Catch cycles on struct type
5868         definitions. 
5869
5870         * typemanager.cs (IsUnmanagedtype): Do not recursively check
5871         fields if the fields are static.  We only need to check instance
5872         fields. 
5873
5874         * expression.cs (As.DoResolve): Test for reference type.
5875
5876         * statement.cs (Using.ResolveExpression): Use
5877         ConvertImplicitRequired, not ConvertImplicit which reports an
5878         error on failture
5879         (Using.ResolveLocalVariableDecls): ditto.
5880
5881         * expression.cs (Binary.ResolveOperator): Report errors in a few
5882         places where we had to.
5883
5884         * typemanager.cs (IsUnmanagedtype): Finish implementation.
5885
5886 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
5887
5888         * expression.cs: Use StoreFromPtr instead of extracting the type
5889         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
5890
5891         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
5892         an enumeration value to a System.Enum, but System.Enum is not a
5893         value type, but an class type, so we need to box.
5894
5895         (Expression.ConvertExplicit): One codepath could return
5896         errors but not flag them.  Fix this.  Fixes #31853
5897
5898         * parameter.cs (Resolve): Do not allow void as a parameter type.
5899
5900 2002-10-06  Martin Baulig  <martin@gnome.org>
5901
5902         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
5903         if it's a class type and not a struct.  Fixes #31815.
5904
5905 2002-10-06  Martin Baulig  <martin@gnome.org>
5906
5907         * statement.cs: Reworked the flow analysis code a bit to make it
5908         usable for dead code elimination.
5909
5910 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5911
5912         * cs-parser.jay: allow empty source files. Fixes bug #31781.
5913
5914 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
5915
5916         * expression.cs (ComposedCast.DoResolveType): A quick workaround
5917         to fix the test 165, will investigate deeper.
5918
5919 2002-10-04  Martin Baulig  <martin@gnome.org>
5920
5921         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
5922         finally blocks actually work.
5923         (Try.Resolve): We don't need to create a sibling for `finally' if
5924         there is no finally block.
5925
5926 2002-10-04  Martin Baulig  <martin@gnome.org>
5927
5928         * class.cs (Constructor.Define): The default accessibility for a
5929         non-default constructor is private, not public.
5930
5931 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
5932
5933         * class.cs (Constructor): Make AllowedModifiers public, add
5934         EXTERN.
5935
5936         * cs-parser.jay: Perform the modifiers test here, as the
5937         constructor for the Constructor class usually receives a zero
5938         because of the way we create it (first we create, later we
5939         customize, and we were never checking the modifiers).
5940
5941         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
5942         is a version of LookupTypeReflection that includes the type-name
5943         cache.  This can be used as a fast path for functions that know
5944         the fully qualified name and are only calling into *.GetType() to
5945         obtain a composed type.
5946
5947         This is also used by TypeManager.LookupType during its type
5948         composition.
5949
5950         (LookupType): We now also track the real type name, as sometimes
5951         we can get a quey for the real type name from things like
5952         ComposedCast.  This fixes bug 31422.
5953
5954         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
5955         complete type fullname, it does not have to go through the type
5956         resolution system to obtain the composed version of the type (for
5957         obtaining arrays or pointers).
5958
5959         (Conditional.Emit): Use the EmitBoolExpression to
5960         generate nicer code, as requested by Paolo.
5961
5962         (ArrayCreation.CheckIndices): Use the patch from
5963         hwang_rob@yahoo.ca to validate the array initializers. 
5964
5965 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
5966
5967         * class.cs (ConstructorInitializer.Emit): simplify code by using
5968         Invocation.EmitCall, and at the same time, fix the bugs in calling
5969         parent constructors that took variable arguments. 
5970
5971         * ecore.cs (Expression.ConvertNumericExplicit,
5972         Expression.ImplicitNumericConversion): Remove the code that
5973         manually wrapped decimal (InternalTypeConstructor call is now gone
5974         as well).
5975
5976         * expression.cs (Cast.TryReduce): Also handle decimal types when
5977         trying to perform a constant fold on the type.
5978
5979         * typemanager.cs (IsUnmanagedtype): Partially implemented.
5980
5981         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
5982         that only turned off an error report, and did nothing else. 
5983
5984 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
5985
5986         * driver.cs: Handle and ignore /fullpaths
5987
5988 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
5989
5990         * expression.cs (Binary.ResolveOperator): Catch the case where
5991         DoNumericPromotions returns true, 
5992
5993         (Binary.DoNumericPromotions): Simplify the code, and the tests.
5994
5995 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
5996
5997         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
5998         report error 70.
5999
6000 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
6001
6002         * ecore.cs (ConvertNumericExplicit): It is not enough that the
6003         conversion exists, but it is also required that the conversion be
6004         performed.  This manifested in "(Type64Enum) 2".  
6005
6006         * class.cs (TypeManager.AddMethod): The fix is not to change
6007         AddEnum, because that one was using a fully qualified name (every
6008         DeclSpace derivative does), but to change the AddMethod routine
6009         that was using an un-namespaced name.  This now correctly reports
6010         the duplicated name.
6011
6012         Revert patch until I can properly fix it.  The issue
6013         is that we have a shared Type space across all namespaces
6014         currently, which is wrong.
6015
6016         Options include making the Namespace a DeclSpace, and merge
6017         current_namespace/current_container in the parser.
6018
6019 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
6020
6021         * cs-parser.jay: Improve error reporting when we get a different
6022         kind of expression in local_variable_type and
6023         local_variable_pointer_type. 
6024
6025         Propagate this to avoid missleading errors being reported.
6026
6027         * ecore.cs (ImplicitReferenceConversion): treat
6028         TypeManager.value_type as a target just like object_type.   As
6029         code like this:
6030
6031         ValueType v = 1;
6032
6033         Is valid, and needs to result in the int 1 being boxed before it
6034         is assigned to the value type v.
6035
6036         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
6037         to validate the enumeration name.
6038
6039         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
6040         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
6041         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
6042
6043         * ecore.cs (TryImplicitIntConversion): When doing an
6044         implicit-enumeration-conversion, check if the type is 64-bits and
6045         perform a conversion before passing to EnumConstant.
6046
6047 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
6048
6049         * decl.cs (Error_AmbiguousTypeReference); New routine used to
6050         report ambiguous type references.  Unlike the MS version, we
6051         report what the ambiguity is.   Innovation at work ;-)
6052
6053         (DeclSpace.FindType): Require a location argument to
6054         display when we display an ambiguous error.
6055
6056         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
6057
6058         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
6059
6060         * expression.cs (EmitDynamicInitializers): Apply patch from
6061         hwang_rob@yahoo.ca that fixes the order in which we emit our
6062         initializers. 
6063
6064 2002-09-21  Martin Baulig  <martin@gnome.org>
6065
6066         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
6067         delegate takes no arguments.
6068
6069 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
6070
6071         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
6072         from integers.
6073
6074         * expression.cs: Extract the underlying type.
6075
6076         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
6077
6078         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
6079
6080 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
6081
6082         * class.cs (TypeContainer.DefineType): We can not use the nice
6083         PackingSize with the size set to 1 DefineType method, because it
6084         will not allow us to define the interfaces that the struct
6085         implements.
6086
6087         This completes the fixing of bug 27287
6088
6089         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
6090         means also structs.  This fixes part of the problem. 
6091         (Expresion.ImplicitReferenceConversionExists): ditto.
6092
6093         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
6094         error if there were no errors reported during the type lookup
6095         process, to avoid duplicates or redundant errors.  Without this
6096         you would get an ambiguous errors plus a type not found.  We have
6097         beaten the user enough with the first error.  
6098
6099         (DeclSparce.FindType): Emit a warning if we have an ambiguous
6100         reference. 
6101
6102         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
6103         during the resolution process, stop the lookup, this avoids
6104         repeated error reports (same error twice).
6105
6106         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
6107
6108         * typemanager.cs (LookupType): Redo the type lookup code to match
6109         the needs of System.Reflection.  
6110
6111         The issue is that System.Reflection requires references to nested
6112         types to begin with a "+" sign instead of a dot.  So toplevel
6113         types look like: "NameSpace.TopLevelClass", and nested ones look
6114         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
6115         levels. 
6116
6117 2002-09-19  Martin Baulig  <martin@gnome.org>
6118
6119         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
6120         says that a method always returns or always throws an exception,
6121         don't report the CS0161.
6122
6123         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
6124         set `Returns = new_returns'.
6125
6126 2002-09-19  Martin Baulig  <martin@gnome.org>
6127
6128         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
6129         to an enum constant, check for a CS0176.
6130
6131 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
6132
6133         * class.cs (TypeContainer.CheckPairedOperators): Now we check
6134         for operators that must be in pairs and report errors.
6135
6136         * ecore.cs (SimpleName.DoResolveType): During the initial type
6137         resolution process, when we define types recursively, we must
6138         check first for types in our current scope before we perform
6139         lookups in the enclosing scopes.
6140
6141         * expression.cs (MakeByteBlob): Handle Decimal blobs.
6142
6143         (Invocation.VerifyArgumentsCompat): Call
6144         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
6145         I thought we were supposed to always call this, but there are a
6146         few places in the code where we dont do it.
6147
6148 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
6149
6150         * driver.cs: Add support in -linkres and -resource to specify the
6151         name of the identifier.
6152
6153 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
6154
6155         * ecore.cs (StandardConversionExists): Sync with the conversion
6156         code: allow anything-* to void* conversions.
6157
6158         (FindMostSpecificSource): Use an Expression argument
6159         instead of a Type, because we might be handed over a Literal which
6160         gets a few more implicit conversions that plain types do not.  So
6161         this information was being lost.
6162
6163         Also, we drop the temporary type-holder expression when not
6164         required.
6165
6166 2002-09-17  Martin Baulig  <martin@gnome.org>
6167
6168         * class.cs (PropertyBase.CheckBase): Don't check the base class if
6169         this is an explicit interface implementation.
6170
6171 2002-09-17  Martin Baulig  <martin@gnome.org>
6172
6173         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
6174         different `IndexerName' attributes.
6175
6176         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
6177         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
6178         virtual CommonResolve().
6179
6180 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
6181
6182         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
6183         and convert that to the UnderlyingType.
6184
6185         * statement.cs (Foreach.Resolve): Indexers are just like variables
6186         or PropertyAccesses.
6187
6188         * cs-tokenizer.cs (consume_string): Track line numbers and columns
6189         inside quoted strings, we were not doing this before.
6190
6191 2002-09-16  Martin Baulig  <martin@gnome.org>
6192
6193         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
6194         resolve it.  This is needed for the definite assignment check of the
6195         instance expression, fixes bug #29846.
6196         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
6197
6198 2002-09-16  Nick Drochak  <ndrochak@gol.com>
6199
6200         * parameter.cs: Fix compile error.  Cannot reference static member
6201         from an instance object.  Is this an mcs bug?
6202
6203 2002-09-14  Martin Baulig  <martin@gnome.org>
6204
6205         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
6206         multiple times.  Fixes bug #30295, added test-166.cs.
6207
6208 2002-09-14  Martin Baulig  <martin@gnome.org>
6209
6210         * statement.cs (Block.Emit): Don't emit unreachable code.
6211         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
6212         `break' statements.
6213         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
6214
6215 2002-09-14  Martin Baulig  <martin@gnome.org>
6216
6217         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
6218         is set.
6219
6220 2002-09-14  Martin Baulig  <martin@gnome.org>
6221
6222         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
6223         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
6224         be false on the ms runtime.
6225
6226 2002-09-13  Martin Baulig  <martin@gnome.org>
6227
6228         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
6229         the CS0038 error message.
6230
6231 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
6232
6233         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
6234         constant inside, return it.
6235
6236 2002-09-12  Martin Baulig  <martin@gnome.org>
6237
6238         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
6239         implicit conversion can be done between enum types.
6240
6241         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
6242         check whether an implicit conversion to the current enum's UnderlyingType
6243         exists and report an error if not.
6244
6245         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
6246         without debugging support.
6247
6248         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
6249         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
6250
6251 2002-09-12  Martin Baulig  <martin@gnome.org>
6252
6253         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
6254
6255         * ecore.cs (IMemberExpr.DeclaringType): New property.
6256         (SimpleName.SimpleNameResolve): Check whether we're accessing a
6257         nonstatic member of an outer type (CS0038).
6258
6259 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
6260
6261         * driver.cs: Activate the using-error detector at warning level
6262         4 (at least for MS-compatible APIs).
6263
6264         * namespace.cs (VerifyUsing): Small buglett fix.
6265
6266         * pending.cs (PendingImplementation): pass the container pointer. 
6267
6268         * interface.cs (GetMethods): Allow for recursive definition.  Long
6269         term, I would like to move every type to support recursive
6270         definitions, not the current ordering mechanism that we have right
6271         now.
6272
6273         The situation is this: Attributes are handled before interfaces,
6274         so we can apply attributes to interfaces.  But some attributes
6275         implement interfaces, we will now handle the simple cases
6276         (recursive definitions will just get an error).  
6277
6278         * parameter.cs: Only invalidate types at the end if we fail to
6279         lookup all types.  
6280
6281 2002-09-09  Martin Baulig  <martin@gnome.org>
6282
6283         * ecore.cs (PropertyExpr.Emit): Also check for
6284         TypeManager.system_int_array_get_length so this'll also work when
6285         compiling corlib.  Fixes #30003.
6286
6287 2002-09-09  Martin Baulig  <martin@gnome.org>
6288
6289         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
6290         and throw an exception if we can't get the type's size.  Fixed #30040,
6291         added test-165.cs.
6292
6293 2002-09-09  Martin Baulig  <martin@gnome.org>
6294
6295         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
6296
6297         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
6298         context.  Fixes bug #30027.
6299
6300         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
6301         virtual functions.  Fixes bug #30043, added test-164.cs.
6302
6303 2002-09-08  Ravi Pratap  <ravi@ximian.com>
6304
6305         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
6306
6307 2002-09-08  Nick Drochak  <ndrochak@gol.com>
6308
6309         * driver.cs: Use an object to get the windows codepage since it's not a
6310         static property.
6311
6312 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
6313
6314         * statement.cs (For.Emit): for infinite loops (test == null)
6315         return whether there is a break inside, not always "true".
6316
6317         * namespace.cs (UsingEntry): New struct to hold the name of the
6318         using definition, the location where it is defined, and whether it
6319         has been used in a successful type lookup.
6320
6321         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
6322         strings.
6323
6324         * decl.cs: ditto.
6325
6326 2002-09-06  Ravi Pratap  <ravi@ximian.com>
6327
6328         * attribute.cs : Fix incorrect code which relied on catching
6329         a NullReferenceException to detect a null being passed in
6330         where an object was expected.
6331
6332 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * statement.cs (Try): flag the catch variable as assigned
6335
6336         * expression.cs (Cast): Simplified by using ResolveType instead of
6337         manually resolving.
6338
6339         * statement.cs (Catch): Fix bug by using ResolveType.
6340
6341 2002-09-06  Ravi Pratap  <ravi@ximian.com>
6342
6343         * expression.cs (BetterConversion): Special case for when we have
6344         a NullLiteral as the argument and we have to choose between string
6345         and object types - we choose string the way csc does.
6346
6347         * attribute.cs (Attribute.Resolve): Catch the
6348         NullReferenceException and report error #182 since the Mono
6349         runtime no more has the bug and having this exception raised means
6350         we tried to select a constructor which takes an object and is
6351         passed a null.
6352
6353 2002-09-05  Ravi Pratap  <ravi@ximian.com>
6354
6355         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
6356         message (1502, 1503) when we can't locate a method after overload
6357         resolution. This is much more informative and closes the bug
6358         Miguel reported.
6359
6360         * interface.cs (PopulateMethod): Return if there are no argument
6361         types. Fixes a NullReferenceException bug.
6362
6363         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
6364         expressions too. Previously we were checking only in one place for
6365         positional arguments leaving out named arguments.
6366
6367         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
6368         type to the enum type is not allowed. Remove code corresponding to
6369         that.
6370
6371         (ConvertNumericExplicit): Allow explicit conversions from
6372         the underlying type to enum type. This precisely follows the spec
6373         and closes a bug filed by Gonzalo.
6374
6375 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6376
6377         * compiler.csproj:
6378         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
6379
6380 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
6381
6382         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
6383         it was important that we stored the right value after the
6384         reduction in `converted'.
6385
6386 2002-09-04  Martin Baulig  <martin@gnome.org>
6387
6388         * location.cs (Location.SymbolDocument): Use full pathnames for the
6389         source files.
6390
6391 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
6392
6393         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
6394         of the expression resolve mechanism, because that will catch the
6395         SimpleName error failures.
6396
6397         (Conditional): If we can not resolve the
6398         expression, return, do not crash.
6399
6400 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6401
6402         * cs-tokenizer.cs:
6403         (location): display token name instead of its number.
6404
6405 2002-08-28  Martin Baulig  <martin@gnome.org>
6406
6407         * expression.cs (Binary.ResolveOperator): Don't silently return
6408         but return an error if an operator cannot be applied between two
6409         enum types.
6410
6411 2002-08-28  Martin Baulig  <martin@gnome.org>
6412
6413         * class.cs (Constructor.Define): Set the permission attributes
6414         correctly instead of making all constructors public.
6415
6416 2002-08-28  Martin Baulig  <martin@gnome.org>
6417
6418         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
6419         for private members before reporting a CS0103; if we find anything,
6420         it's a CS0122.
6421
6422 2002-08-28  Martin Baulig  <martin@gnome.org>
6423
6424         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
6425         to check whether `closure_start_type == closure_invocation_type',
6426         we also need to check whether `m.DeclaringType == closure_invocation_type'
6427         before bypassing the permission checks.  We might be accessing
6428         protected/private members from the base class.
6429         (TypeManager.RealMemberLookup): Only set private_ok if private
6430         members were requested via BindingFlags.NonPublic.
6431
6432         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
6433
6434         * expression.cs (MemberAccess.ResolveMemberAccess): Set
6435         MethodGroupExpr.IsExplicitImpl if appropriate.
6436         (Invocation.DoResolve): Don't report the CS0120 for explicit
6437         interface implementations.
6438
6439 2002-08-27  Martin Baulig  <martin@gnome.org>
6440
6441         * expression.cs (Invocation.DoResolve): If this is a static
6442         method and we don't have an InstanceExpression, we must report
6443         a CS0120.
6444
6445 2002-08-25  Martin Baulig  <martin@gnome.org>
6446
6447         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
6448         `==' between a valuetype and an object.
6449
6450 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
6451
6452         * ecore.cs (TypeExpr): Provide a ToString method.
6453
6454 2002-08-24  Martin Baulig  <martin@gnome.org>
6455
6456         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
6457         now called proggie.dbg and it's a binary file.
6458
6459 2002-08-23  Martin Baulig  <martin@gnome.org>
6460
6461         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
6462
6463 2002-08-23  Martin Baulig  <martin@gnome.org>
6464
6465         * struct.cs (MyStructInfo.ctor): Make this work with empty
6466         structs; it's not allowed to use foreach() on null.
6467
6468 2002-08-23  Martin Baulig  <martin@gnome.org>
6469
6470         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
6471         writer the full pathname of the generated assembly.
6472
6473 2002-08-23  Martin Baulig  <martin@gnome.org>
6474
6475         * statements.cs (FlowBranching.UsageVector.MergeChildren):
6476         A `finally' block never returns or breaks; improved handling of
6477         unreachable code.
6478
6479 2002-08-23  Martin Baulig  <martin@gnome.org>
6480
6481         * statement.cs (Throw.Resolve): Allow `throw null'.
6482
6483 2002-08-23  Martin Baulig  <martin@gnome.org>
6484
6485         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
6486         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
6487         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
6488         MemberLookup would return a wrong event if this is an explicit
6489         interface implementation and the class has an event with the same
6490         name.
6491
6492 2002-08-23  Martin Baulig  <martin@gnome.org>
6493
6494         * statement.cs (Block.AddChildVariableNames): New public method.
6495         (Block.AddChildVariableName): Likewise.
6496         (Block.IsVariableNameUsedInChildBlock): Likewise.
6497         (Block.AddVariable): Check whether a variable name has already
6498         been used in a child block.
6499
6500         * cs-parser.jay (declare_local_variables): Mark all variable names
6501         from the current block as being used in a child block in the
6502         implicit block.
6503
6504 2002-08-23  Martin Baulig  <martin@gnome.org>
6505
6506         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
6507         find the symbol writer.
6508
6509         * driver.cs: csc also allows the arguments to /define being
6510         separated by commas, not only by semicolons.
6511
6512 2002-08-23  Martin Baulig  <martin@gnome.org>
6513
6514         * interface.cs (Interface.GetMembers): Added static check for events.
6515
6516 2002-08-15  Martin Baulig  <martin@gnome.org>
6517
6518         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
6519         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
6520
6521         * ecore.cs (Expression.MemberLookup): Added documentation and explained
6522         why the MethodData.EmitDestructor() change was necessary.
6523
6524 2002-08-20  Martin Baulig  <martin@gnome.org>
6525
6526         * class.cs (TypeContainer.FindMembers): Added static check for events.
6527
6528         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
6529
6530         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
6531         use Type.GetEvents(), not Type.FindMembers().
6532
6533 2002-08-20  Martin Baulig  <martin@gnome.org>
6534
6535         * decl.cs (MemberCache): Added a special method cache which will
6536         be used for method-only searched.  This ensures that a method
6537         search will return a MethodInfo with the correct ReflectedType for
6538         inherited methods.      
6539
6540 2002-08-20  Martin Baulig  <martin@gnome.org>
6541
6542         * decl.cs (DeclSpace.FindMembers): Made this public.
6543
6544 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6545
6546         * delegate.cs: fixed build on windows.
6547         [FIXME:  Filed as bug #29150: MCS must report these errors.]
6548
6549 2002-08-19  Ravi Pratap  <ravi@ximian.com>
6550
6551         * ecore.cs (StandardConversionExists): Return a false
6552         if we are trying to convert the void type to anything else
6553         since that is not allowed.
6554
6555         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
6556         we flag error 70 in the event an event is trying to be accessed
6557         directly from outside the declaring type.
6558
6559 2002-08-20  Martin Baulig  <martin@gnome.org>
6560
6561         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
6562         MemberCache from typemanager.cs to decl.cs.
6563
6564 2002-08-19  Martin Baulig  <martin@gnome.org>
6565
6566         * class.cs (TypeContainer): Implement IMemberContainer.
6567         (TypeContainer.DefineMembers): Create the MemberCache.
6568         (TypeContainer.FindMembers): Do better BindingFlags checking; only
6569         return public members if BindingFlags.Public was given, check
6570         whether members are static.
6571
6572 2002-08-16  Martin Baulig  <martin@gnome.org>
6573
6574         * decl.cs (DeclSpace.Define): Splitted this in Define and
6575         DefineMembers.  DefineMembers is called first and initializes the
6576         MemberCache.
6577
6578         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
6579         DefineMembers() on all our DeclSpaces.
6580
6581         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
6582         but call DefineMembers() on all nested interfaces.  We call their
6583         Define() in our new Define() function.
6584
6585         * interface.cs (Interface): Implement IMemberContainer.
6586         (Interface.Define): Moved all code except the attribute stuf to
6587         DefineMembers().
6588         (Interface.DefineMembers): Initialize the member cache.
6589
6590         * typemanager.cs (IMemberFinder): Removed this interface, we don't
6591         need this anymore since we can use MemberCache.FindMembers directly.
6592
6593 2002-08-19  Martin Baulig  <martin@gnome.org>
6594
6595         * typemanager.cs (MemberCache): When creating the cache for an
6596         interface type, add all inherited members.
6597         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
6598         to `out bool used_cache' and documented it.
6599         (TypeManager.MemberLookup): If we already used the cache in the first
6600         iteration, we don't need to do the interfaces check.
6601
6602 2002-08-19  Martin Baulig  <martin@gnome.org>
6603
6604         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
6605         here from IMemberFinder and don't implement this interface anymore.
6606         (DeclSpace.MemberCache): Moved here from IMemberFinder.
6607
6608         * typemanager.cs (IMemberFinder): This interface is now only used by
6609         classes which actually support the member cache.
6610         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
6611         since we only put DeclSpaces into this Hashtable.
6612         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
6613         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
6614
6615 2002-08-16  Martin Baulig  <martin@gnome.org>
6616
6617         * typemanager.cs (ICachingMemberFinder): Removed.
6618         (IMemberFinder.MemberCache): New property.
6619         (TypeManager.FindMembers): Merged this with RealFindMembers().
6620         This function will never be called from TypeManager.MemberLookup()
6621         so we can't use the cache here, just the IMemberFinder.
6622         (TypeManager.MemberLookup_FindMembers): Check whether the
6623         IMemberFinder has a MemberCache and call the cache's FindMembers
6624         function.
6625         (MemberCache): Rewrote larger parts of this yet another time and
6626         cleaned it up a bit.
6627
6628 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
6629
6630         * driver.cs (LoadArgs): Support quoting.
6631
6632         (Usage): Show the CSC-like command line arguments.
6633
6634         Improved a few error messages.
6635
6636 2002-08-15  Martin Baulig  <martin@gnome.org>
6637
6638         * typemanager.cs (IMemberContainer.Type): New property.
6639         (IMemberContainer.IsInterface): New property.
6640
6641         The following changes are conditional to BROKEN_RUNTIME, which is
6642         defined at the top of the file.
6643
6644         * typemanager.cs (MemberCache.MemberCache): Don't add the base
6645         class'es members, but add all members from TypeHandle.ObjectType
6646         if we're an interface.
6647         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
6648         is the current type.
6649         (MemberCache.CacheEntry.Container): Removed this field.
6650         (TypeHandle.GetMembers): Include inherited members.
6651
6652 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6653
6654         * typemanager.cs: fixed compilation and added a comment on a field that
6655         is never used.
6656
6657 2002-08-15  Martin Baulig  <martin@gnome.org>
6658
6659         * class.cs (ConstructorInitializer.Resolve): In the
6660         Expression.MemberLookup call, use the queried_type as
6661         invocation_type.
6662
6663         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
6664         declared' attribute, it's always true.
6665         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
6666         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
6667         temporary wrapper for FindMembers which tells MemberLookup whether
6668         members from the base classes are included in the return value.
6669         This will go away soon.
6670         (TypeManager.MemberLookup): Use this temporary hack here; once the
6671         new MemberCache is completed, we don't need to do the DeclaredOnly
6672         looping here anymore since the MemberCache will take care of this.
6673         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
6674         (MemberCache): When creating the MemberCache for a class, get
6675         members from the current class and all its base classes.
6676         (MemberCache.CacheEntry.Container): New field.  This is a
6677         temporary hack until the Mono runtime is fixed to distinguish
6678         between ReflectedType and DeclaringType.  It allows us to use MCS
6679         with both the MS runtime and the unfixed Mono runtime without
6680         problems and without accecting performance.
6681         (MemberCache.SearchMembers): The DeclaredOnly looping from
6682         TypeManager.MemberLookup is now done here.      
6683
6684 2002-08-14  Martin Baulig  <martin@gnome.org>
6685
6686         * statement.cs (MyStructInfo.MyStructInfo): Don't call
6687         Type.GetFields on dynamic types but get the fields from the
6688         corresponding TypeContainer.
6689         (MyStructInfo.GetStructInfo): Added check for enum types.
6690
6691         * typemanager.cs (MemberList.IsSynchronized): Implemented.
6692         (MemberList.SyncRoot): Implemented.
6693         (TypeManager.FilterWithClosure): No need to check permissions if
6694         closure_start_type == closure_invocation_type, don't crash if
6695         closure_invocation_type is null.
6696
6697 2002-08-13  Martin Baulig  <martin@gnome.org>
6698
6699         Rewrote TypeContainer.FindMembers to use a member cache.  This
6700         gives us a speed increase of about 35% for the self-hosting MCS
6701         build and of about 15-20% for the class libs (both on GNU/Linux).
6702
6703         * report.cs (Timer): New class to get enhanced profiling.  This
6704         whole class is "TIMER" conditional since it remarkably slows down
6705         compilation speed.
6706
6707         * class.cs (MemberList): New class.  This is an IList wrapper
6708         which we're now using instead of passing MemberInfo[]'s around to
6709         avoid copying this array unnecessarily.
6710         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
6711         (ICachingMemberFinder, IMemberContainer): New interface.
6712         (TypeManager.FilterWithClosure): If `criteria' is null, the name
6713         has already been checked, otherwise use it for the name comparision.
6714         (TypeManager.FindMembers): Renamed to RealMemberFinder and
6715         provided wrapper which tries to use ICachingMemberFinder.FindMembers
6716         if possible.  Returns a MemberList, not a MemberInfo [].
6717         (TypeHandle): New class, implements IMemberContainer.  We create
6718         one instance of this class per type, it contains a MemberCache
6719         which is used to do the member lookups.
6720         (MemberCache): New class.  Each instance of this class contains
6721         all members of a type and a name-based hash table.
6722         (MemberCache.FindMembers): This is our new member lookup
6723         function.  First, it looks up all members of the requested name in
6724         the hash table.  Then, it walks this list and sorts out all
6725         applicable members and returns them.
6726
6727 2002-08-13  Martin Baulig  <martin@gnome.org>
6728
6729         In addition to a nice code cleanup, this gives us a performance
6730         increase of about 1.4% on GNU/Linux - not much, but it's already
6731         half a second for the self-hosting MCS compilation.
6732
6733         * typemanager.cs (IMemberFinder): New interface.  It is used by
6734         TypeManager.FindMembers to call FindMembers on a TypeContainer,
6735         Enum, Delegate or Interface.
6736         (TypeManager.finder_to_member_finder): New PtrHashtable.
6737         (TypeManager.finder_to_container): Removed.
6738         (TypeManager.finder_to_delegate): Removed.
6739         (TypeManager.finder_to_interface): Removed.
6740         (TypeManager.finder_to_enum): Removed.
6741
6742         * interface.cs (Interface): Implement IMemberFinder.
6743
6744         * delegate.cs (Delegate): Implement IMemberFinder.
6745
6746         * enum.cs (Enum): Implement IMemberFinder.
6747
6748         * class.cs (TypeContainer): Implement IMemberFinder.
6749
6750 2002-08-12  Martin Baulig  <martin@gnome.org>
6751
6752         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
6753
6754 2002-08-12  Martin Baulig  <martin@gnome.org>
6755
6756         * ecore.cs (ITypeExpression): New interface for expressions which
6757         resolve to a type.
6758         (TypeExpression): Renamed to TypeLookupExpression.
6759         (Expression.DoResolve): If we're doing a types-only lookup, the
6760         expression must implement the ITypeExpression interface and we
6761         call DoResolveType() on it.
6762         (SimpleName): Implement the new ITypeExpression interface.
6763         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
6764         hack, the situation that we're only looking up types can't happen
6765         anymore when this method is called.  Moved the type lookup code to
6766         DoResolveType() and call it.
6767         (SimpleName.DoResolveType): This ITypeExpression interface method
6768         is now doing the types-only lookup.
6769         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
6770         (ResolveFlags): Added MaskExprClass.
6771
6772         * expression.cs (MemberAccess): Implement the ITypeExpression
6773         interface.
6774         (MemberAccess.DoResolve): Added support for a types-only lookup
6775         when we're called via ITypeExpression.DoResolveType().
6776         (ComposedCast): Implement the ITypeExpression interface.
6777
6778         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
6779         Expression.Resolve() with ResolveFlags.Type instead.
6780
6781 2002-08-12  Martin Baulig  <martin@gnome.org>
6782
6783         * interface.cs (Interface.Define): Apply attributes.
6784
6785         * attribute.cs (Attribute.ApplyAttributes): Added support for
6786         interface attributes.
6787
6788 2002-08-11  Martin Baulig  <martin@gnome.org>
6789
6790         * statement.cs (Block.Emit): Only check the "this" variable if we
6791         do not always throw an exception.
6792
6793         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
6794         whether the property has a set accessor.
6795
6796 2002-08-11  Martin Baulig  <martin@gnome.org>
6797
6798         Added control flow analysis support for structs.
6799
6800         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
6801         with control flow analysis turned off.
6802         (IVariable): New interface.
6803         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
6804         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
6805         (FieldExpr.DoResolve): Resolve the instance expression with flow
6806         analysis turned off and do the definite assignment check after the
6807         resolving when we know what the expression will resolve to.
6808
6809         * expression.cs (LocalVariableReference, ParameterReference):
6810         Implement the new IVariable interface, only call the flow analysis
6811         code if ec.DoFlowAnalysis is true.
6812         (This): Added constructor which takes a Block argument.  Implement
6813         the new IVariable interface.
6814         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
6815         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
6816         This does the definite assignment checks for struct members.
6817
6818         * class.cs (Constructor.Emit): If this is a non-static `struct'
6819         constructor which doesn't have any initializer, call
6820         Block.AddThisVariable() to tell the flow analysis code that all
6821         struct elements must be initialized before control returns from
6822         the constructor.
6823
6824         * statement.cs (MyStructInfo): New public class.
6825         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
6826         argument to this indexer.  If non-zero, check an individual struct
6827         member, not the whole struct.
6828         (FlowBranching.CheckOutParameters): Check struct members.
6829         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
6830         overloaded versions of these methods which take an additional
6831         `int field_idx' argument to check struct members.
6832         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
6833         overloaded versions of these methods which take an additional
6834         `string field_name' argument to check struct member.s
6835         (VariableInfo): Implement the IVariable interface.
6836         (VariableInfo.StructInfo): New public property.  Returns the
6837         MyStructInfo instance of the variable if it's a struct or null.
6838         (Block.AddThisVariable): New public method.  This is called from
6839         Constructor.Emit() for non-static `struct' constructor which do
6840         not have any initializer.  It creates a special variable for the
6841         "this" instance variable which will be checked by the flow
6842         analysis code to ensure that all of the struct's fields are
6843         initialized before control returns from the constructor.
6844         (UsageVector): Added support for struct members.  If a
6845         variable/parameter is a struct with N members, we reserve a slot
6846         in the usage vector for each member.  A struct is considered fully
6847         initialized if either the struct itself (slot 0) or all its
6848         members are initialized.
6849
6850 2002-08-08  Martin Baulig  <martin@gnome.org>
6851
6852         * driver.cs (Driver.MainDriver): Only report an error CS5001
6853         if there were no compilation errors.
6854
6855         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
6856         `UnsafeContext' property to determine whether the parent is in
6857         unsafe context rather than checking the parent's ModFlags:
6858         classes nested in an unsafe class are unsafe as well.
6859
6860 2002-08-08  Martin Baulig  <martin@gnome.org>
6861
6862         * statement.cs (UsageVector.MergeChildren): Distinguish between
6863         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
6864         we return.  Added test17() and test18() to test-154.cs.
6865
6866 2002-08-08  Martin Baulig  <martin@gnome.org>
6867
6868         * typemanager.cs (TypeManager.FilterWithClosure): If we have
6869         Family access, make sure the invoking type isn't a subclass of the
6870         queried type (that'd be a CS1540).
6871
6872         * ecore.cs (Expression.MemberLookup): Added overloaded version of
6873         this method which takes an additional `Type invocation_type'.
6874
6875         * expression.cs (BaseAccess.DoResolve): Use the base type as
6876         invocation and query type.
6877         (MemberAccess.DoResolve): If the lookup failed and we're about to
6878         report a CS0122, try a lookup with the ec.ContainerType - if this
6879         succeeds, we must report a CS1540.
6880
6881 2002-08-08  Martin Baulig  <martin@gnome.org>
6882
6883         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
6884         (MethodGroupExpr): Implement the IMemberExpr interface.
6885
6886         * expression (MemberAccess.ResolveMemberAccess): No need to have
6887         any special code for MethodGroupExprs anymore, they're now
6888         IMemberExprs.   
6889
6890 2002-08-08  Martin Baulig  <martin@gnome.org>
6891
6892         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
6893         Family, FamANDAssem and FamORAssem permissions.
6894         (TypeManager.IsSubclassOrNestedChildOf): New public method.
6895
6896 2002-08-08  Martin Baulig  <martin@gnome.org>
6897
6898         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
6899         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
6900         or loop block.
6901
6902 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
6903
6904         * driver.cs: implemented /resource option to embed managed resources.
6905
6906 2002-08-07  Martin Baulig  <martin@gnome.org>
6907
6908         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
6909         (FieldBase.HasFieldInitializer): New public property.
6910         (FieldBase.GetInitializerExpression): New public method.  Resolves and
6911         returns the field initializer and makes sure it is only resolved once.
6912         (TypeContainer.EmitFieldInitializers): Call
6913         FieldBase.GetInitializerExpression to get the initializer, this ensures
6914         that it isn't resolved multiple times.
6915
6916         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
6917         the resolving process (SimpleName/MemberLookup) that we're currently
6918         emitting a field initializer (which must not access any instance members,
6919         this is an error CS0236).
6920
6921         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
6922         argument, if the `IsFieldInitializer' flag is set, we must report and
6923         error CS0236 and not an error CS0120.   
6924
6925 2002-08-07  Martin Baulig  <martin@gnome.org>
6926
6927         * ecore.cs (IMemberExpr): New public interface.
6928         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
6929         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
6930         if the expression is an IMemberExpr.
6931
6932         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
6933         to be null, implicitly default to `this' if we're non-static in
6934         this case.  Simplified the code a lot by using the new IMemberExpr
6935         interface.  Also fixed bug #28176 here.
6936
6937 2002-08-06  Martin Baulig  <martin@gnome.org>
6938
6939         * cs-parser.jay (SimpleLookup): Removed.  We need to create
6940         ParameterReferences during semantic analysis so that we can do a
6941         type-only search when resolving Cast, TypeOf and SizeOf.
6942         (block): Pass the `current_local_parameters' to the Block's
6943         constructor.
6944
6945         * class.cs (ConstructorInitializer): Added `Parameters parameters'
6946         argument to the constructor.
6947         (ConstructorInitializer.Resolve): Create a temporary implicit
6948         block with the parameters.
6949
6950         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
6951         references here if we aren't doing a type-only search.
6952
6953         * statement.cs (Block): Added constructor which takes a
6954         `Parameters parameters' argument.
6955         (Block.Parameters): New public property.
6956
6957         * support.cs (InternalParameters.Parameters): Renamed `parameters'
6958         to `Parameters' and made it public readonly.
6959
6960 2002-08-06  Martin Baulig  <martin@gnome.org>
6961
6962         * ecore.cs (Expression.Warning): Made this public as well.
6963
6964         * report.cs (Report.Debug): Print the contents of collections.
6965
6966 2002-08-06  Martin Baulig  <martin@gnome.org>
6967
6968         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
6969         used to tell Resolve() which kinds of expressions it may return.
6970         (Expression.Resolve): Added overloaded version of this method which
6971         takes a `ResolveFlags flags' argument.  This can be used to tell
6972         Resolve() which kinds of expressions it may return.  Reports a
6973         CS0118 on error.
6974         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
6975         ResolveFlags.SimpleName.
6976         (Expression.Error118): Added overloaded version of this method which
6977         takes a `ResolveFlags flags' argument.  It uses the flags to determine
6978         which kinds of expressions are allowed.
6979
6980         * expression.cs (Argument.ResolveMethodGroup): New public method.
6981         Resolves an argument, but allows a MethodGroup to be returned.
6982         This is used when invoking a delegate.
6983
6984         * TODO: Updated a bit.
6985
6986 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6987
6988         Fixed compilation with csc.
6989
6990         * ecore.cs: Expression.Error made public. Is this correct? Should
6991         Warning be made public too?
6992
6993         * expression.cs: use ea.Location instead of ea.loc.
6994         [FIXME:  Filed as bug #28607: MCS must report these errors.]
6995
6996 2002-08-06  Martin Baulig  <martin@gnome.org>
6997
6998         * ecore.cs (Expression.loc): Moved the location here instead of
6999         duplicating it in all derived classes.
7000         (Expression.Location): New public property.
7001         (Expression.Error, Expression.Warning): Made them non-static and
7002         removed the location argument.
7003         (Expression.Warning): Added overloaded version which takes an
7004         `int level' argument.
7005         (Expression.Error118): Make this non-static and removed the
7006         expression and location arguments.
7007         (TypeExpr): Added location argument to the constructor.
7008
7009         * expression.cs (StaticCallExpr): Added location argument to
7010         the constructor.
7011         (Indirection, PointerArithmetic): Likewise.
7012         (CheckedExpr, UnCheckedExpr): Likewise.
7013         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
7014         (StringPtr): Likewise.
7015
7016
7017 2002-08-05  Martin Baulig  <martin@gnome.org>
7018
7019         * expression.cs (BaseAccess.DoResolve): Actually report errors.
7020
7021         * assign.cs (Assign.DoResolve): Check whether the source
7022         expression is a value or variable.
7023
7024         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
7025         while resolving the corresponding blocks.
7026
7027         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
7028         an error, don't silently return null.
7029
7030         * statement.cs (Block.AddVariable): Do the error reporting here
7031         and distinguish between CS0128 and CS0136.
7032         (Block.DoResolve): Report all unused labels (warning CS0164).
7033         (LabeledStatement): Pass the location to the constructor.
7034         (LabeledStatement.HasBeenReferenced): New property.
7035         (LabeledStatement.Resolve): Set it to true here.
7036
7037         * statement.cs (Return.Emit): Return success even after reporting
7038         a type mismatch error (CS0126 or CS0127), this is what csc does and
7039         it avoids confusing the users with any consecutive errors.
7040
7041 2002-08-05  Martin Baulig  <martin@gnome.org>
7042
7043         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
7044
7045         * const.cs (Const.LookupConstantValue): Catch circular definitions.
7046
7047         * expression.cs (MemberAccess.DoResolve): Silently return if an
7048         error has already been reported.
7049
7050         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
7051         error has already been reported.
7052
7053 2002-08-05  Martin Baulig  <martin@gnome.org>
7054
7055         * statement.cs (UsageVector): Only initialize the `parameters'
7056         vector if we actually have any "out" parameters.
7057
7058 2002-08-05  Martin Baulig  <martin@gnome.org>
7059
7060         * expression.cs (Binary.ResolveOperator): When combining delegates,
7061         they must have the same type.
7062
7063 2002-08-05  Martin Baulig  <martin@gnome.org>
7064
7065         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
7066         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
7067         work with the ms runtime and we also don't need it: if we're a
7068         PropertyBuilder and not in the `indexer_arguments' hash, then we
7069         are a property and not an indexer.
7070
7071         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
7072         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
7073         since the latter one doesn't work with the ms runtime.
7074
7075 2002-08-03  Martin Baulig  <martin@gnome.org>
7076
7077         Fixed bugs #27998 and #22735.
7078
7079         * class.cs (Method.IsOperator): New public field.
7080         (Method.CheckBase): Report CS0111 if there's already a method
7081         with the same parameters in the current class.  Report CS0508 when
7082         attempting to change the return type of an inherited method.
7083         (MethodData.Emit): Report CS0179 if a method doesn't have a body
7084         and it's not marked abstract or extern.
7085         (PropertyBase): New abstract base class for Property and Indexer.
7086         (PropertyBase.CheckBase): Moved here from Property and made it work
7087         for indexers.
7088         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
7089         the same so we can reuse it there.
7090         (Property, Indexer): Derive from PropertyBase.
7091         (MethodSignature.inheritable_property_signature_filter): New delegate
7092         to find properties and indexers.
7093
7094         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
7095         argument and improved error reporting.
7096
7097         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
7098         EmptyReadOnlyParameters and made it a property.
7099
7100         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
7101         version of this method which takes a `PropertyInfo indexer'.
7102         (TypeManager.RegisterIndexer): New method.
7103
7104         * class.cs: Added myself as author of this file :-)
7105
7106 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7107
7108         * class.cs: fixed compilation on windoze.
7109
7110 2002-08-03  Martin Baulig  <martin@gnome.org>
7111
7112         * interface.cs (Interface.GetInterfaceBases): Check whether all
7113         base interfaces are at least as accessible than the current one.
7114
7115         * class.cs (TypeContainer.GetClassBases): Check whether base types
7116         are at least as accessible than the current type.
7117         (TypeContainer.AsAccessible): Implemented and made non-static.
7118         (MemberBase.CheckParameters): Report errors if the accessibility
7119         checks fail.
7120
7121         * delegate.cs (Delegate.Delegate): The default visibility is
7122         internal for top-level types and private for nested types.
7123         (Delegate.Define): Report errors if the accessibility checks fail.
7124
7125         * enum.cs (Enum.Enum): The default visibility is internal for
7126         top-level types and private for nested types.
7127         (Enum.DefineType): Compute the correct visibility.
7128
7129         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
7130         function which takes a `bool is_toplevel' instead of a TypeContainer.
7131
7132         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
7133         builtin type.
7134
7135 2002-08-02  Martin Baulig  <martin@gnome.org>
7136
7137         * expression.cs (LocalVariableReferenc): Added constructor which
7138         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
7139         (LocalVariableReference.IsReadOnly): New property.
7140         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
7141         variable is readonly, use our own readonly flag to do this; you can
7142         use the new constructor to get a writable reference to a read-only
7143         variable.
7144
7145         * cs-parser.jay (foreach_statement, using_statement): Get a writable
7146         reference to the local variable.
7147
7148 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
7149
7150         * rootcontext.cs (ResolveCore): Also include System.Exception
7151
7152         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
7153         we reach an EmptyStatement.
7154
7155         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
7156         is also fine.
7157
7158         * expression.cs (Binary.ResolveOperator): Check error result in
7159         two places.
7160
7161         use brtrue/brfalse directly and avoid compares to null.
7162
7163 2002-08-02  Martin Baulig  <martin@gnome.org>
7164
7165         * class.cs (TypeContainer.Define): Define all nested interfaces here.
7166         Fixes bug #28407, added test-155.cs.
7167
7168 2002-08-01  Martin Baulig  <martin@gnome.org>
7169
7170         * class.cs (Event.EmitDefaultMethod): Make this work with static
7171         events.  Fixes #28311, added verify-3.cs.
7172
7173 2002-08-01  Martin Baulig  <martin@gnome.org>
7174
7175         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
7176         `is_disposable' fields.
7177         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
7178         `hm.is_disposable' if we're using the collection pattern.
7179         (Foreach.EmitCollectionForeach): Use the correct type for the
7180         enumerator's local variable, only emit the try/finally block if
7181         necessary (fixes #27713).
7182
7183 2002-08-01  Martin Baulig  <martin@gnome.org>
7184
7185         * ecore.cs (Expression.report118): Renamed to Error118 and made
7186         it public static.
7187
7188         * statement.cs (Throw.Resolve): Check whether the expression is of
7189         the correct type (CS0118) and whether the type derives from
7190         System.Exception (CS0155).
7191         (Catch.Resolve): New method.  Do the type lookup here and check
7192         whether it derives from System.Exception (CS0155).
7193         (Catch.CatchType, Catch.IsGeneral): New public properties.
7194
7195         * typemanager.cs (TypeManager.exception_type): Added.
7196
7197 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
7198
7199         * driver.cs: Updated About function.
7200
7201 2002-07-31  Martin Baulig  <martin@gnome.org>
7202
7203         Implemented Control Flow Analysis.
7204
7205         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
7206         (EmitContext.CurrentBranching): Added.
7207         (EmitContext.StartFlowBranching): Added.
7208         (EmitContext.EndFlowBranching): Added.
7209         (EmitContext.KillFlowBranching): Added.
7210         (EmitContext.IsVariableAssigned): Added.
7211         (EmitContext.SetVariableAssigned): Added.
7212         (EmitContext.IsParameterAssigned): Added.
7213         (EmitContext.SetParameterAssigned): Added.
7214         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
7215         Added control flow analysis stuff here.
7216
7217         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
7218         resolve the expression as lvalue.
7219         (LocalVariableReference.DoResolve): Check whether the variable has
7220         already been assigned.
7221         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
7222         the parameter as assigned here.
7223         (ParameterReference.DoResolve): Check whether the parameter has already
7224         been assigned.
7225         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
7226         expression as lvalue.
7227
7228         * statement.cs (FlowBranching): New class for the flow analysis code.
7229         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
7230         (LabeledStatement.IsDefined): New public property.
7231         (LabeledStatement.AddUsageVector): New public method to tell flow
7232         analyis that the label may be reached via a forward jump.
7233         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
7234         flow analysis.
7235         (VariableInfo.Number): New public field.  This is used by flow analysis
7236         to number all locals of a block.
7237         (Block.CountVariables): New public property.  This is the number of
7238         local variables in this block (including the locals from all parent
7239         blocks).
7240         (Block.EmitMeta): Number all the variables.
7241
7242         * statement.cs: Added flow analysis support to all classes.
7243
7244 2002-07-31  Martin Baulig  <martin@gnome.org>
7245
7246         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
7247         To get debugging messages, compile mcs with /define:MCS_DEBUG and
7248         then use this argument.
7249
7250         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
7251
7252         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
7253         use this to specify /define options.
7254
7255 2002-07-29  Martin Baulig  <martin@gnome.org>
7256
7257         * statement.cs (Fixed): Moved all code that does variable lookups
7258         and resolvings from Emit to Resolve.
7259
7260         * statement.cs (For): Moved all code that does variable lookups
7261         and resolvings from Emit to Resolve.
7262
7263         * statement.cs (Using): Moved all code that does variable lookups
7264         and resolvings from Emit to Resolve.
7265
7266 2002-07-29  Martin Baulig  <martin@gnome.org>
7267
7268         * attribute.cs (Attribute.Resolve): Explicitly catch a
7269         System.NullReferenceException when creating the
7270         CustromAttributeBuilder and report a different warning message.
7271
7272 2002-07-29  Martin Baulig  <martin@gnome.org>
7273
7274         * support.cs (ParameterData.ParameterName): Added method to
7275         get the name of a parameter.
7276
7277         * typemanager.cs (TypeManager.IsValueType): New public method.
7278
7279 2002-07-29  Martin Baulig  <martin@gnome.org>
7280
7281         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
7282         is a flag which specifies that it's either ref or out.
7283         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
7284         the out parameter to `out Parameter.Modifier mod', also set the
7285         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
7286
7287         * support.cs (InternalParameters.ParameterModifier): Distinguish
7288         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
7289         Parameter.Modifier.ISBYREF flag if it's either ref or out.
7290
7291         * expression.cs (Argument.GetParameterModifier): Distinguish
7292         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
7293         Parameter.Modifier.ISBYREF flag if it's either ref or out.
7294
7295 2002-07-29  Martin Baulig  <martin@gnome.org>
7296
7297         * expression.cs (ParameterReference.ParameterReference): Added
7298         `Location loc' argument to the constructor.
7299
7300         * cs-parser.jay: Pass location to ParameterReference.
7301
7302 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
7303
7304         * statement.cs (Try): Initialize the location.
7305
7306         * cs-parser.jay: pass location to Try.
7307
7308         * expression.cs (Unary.Reduce): Change the prototype to return
7309         whether a constant fold could be performed or not.  The result is
7310         returned in an out parameters.  In the case of Indirection and
7311         AddressOf, we want to perform the full tests.
7312
7313 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
7314
7315         * statement.cs (Statement.Emit): Flag dead code.
7316
7317 2002-07-27  Andrew Birkett  <andy@nobugs.org>
7318
7319         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
7320
7321 2002-07-27  Martin Baulig  <martin@gnome.org>
7322
7323         * class.cs (MethodData.Define): Put back call to
7324         TypeManager.AddMethod(), accidentally commented this out.
7325
7326         * report.cs (Debug): New public method to print debugging information,
7327         this is `[Conditional ("DEBUG")]'.
7328
7329 2002-07-26  Martin Baulig  <martin@gnome.org>
7330
7331         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
7332         (switch_statement): Push the current_block to the switch_stack and
7333         pop it again when we're done with the switch.
7334         (switch_section): The new block is a child of the current_block.
7335         Fixes bug #24007, added test-152.cs.
7336
7337 2002-07-27  Martin Baulig  <martin@gnome.org>
7338
7339         * expression.cs (Invocation.EmitArguments): When calling a varargs
7340         function with only its fixed arguments, we need to pass an empty
7341         array.
7342
7343 2002-07-27  Martin Baulig  <martin@gnome.org>
7344
7345         Mono 0.13 has been released.
7346
7347 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
7348
7349         * driver.cs: Rename --resource to --linkres, because that is what
7350         we do currently, we dont support --resource yet.
7351
7352         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
7353
7354 2002-07-25  Martin Baulig  <martin@gnome.org>
7355
7356         * class.cs (MethodData): New public class.  This is a `method builder'
7357         class for a method or one accessor of a Property/Indexer/Event.
7358         (MethodData.GetMethodFlags): Moved here from MemberBase.
7359         (MethodData.ApplyAttributes): Likewise.
7360         (MethodData.ApplyObsoleteAttribute): Likewise.
7361         (MethodData.ApplyConditionalAttribute): Likewise.
7362         (MethodData.ApplyDllImportAttribute): Likewise.
7363         (MethodData.CheckAbstractAndExternal): Likewise.
7364         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
7365         (MethodData.Emit): Formerly known as Method.Emit().
7366         (MemberBase): Moved everything which was specific to a single
7367         accessor/method to MethodData.
7368         (Method): Create a new MethodData and call Define() and Emit() on it.
7369         (Property, Indexer, Event): Create a new MethodData objects for each
7370         accessor and call Define() and Emit() on them.
7371
7372 2002-07-25  Martin Baulig  <martin@gnome.org>
7373
7374         Made MethodCore derive from MemberBase to reuse the code from there.
7375         MemberBase now also checks for attributes.
7376
7377         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
7378         (MemberBase.GetMethodFlags): Moved here from class Method and marked
7379         as virtual.
7380         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
7381         `CallingConventions cc' and `Attributes opt_attrs' arguments.
7382         (MemberBase.ApplyAttributes): New virtual method; applies the
7383         attributes to a method or accessor.
7384         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
7385         (MemberBase.ApplyConditionalAttribute): Likewise.
7386         (MemberBase.ApplyDllImportAttribute): Likewise.
7387         (MemberBase.CheckAbstractAndExternal): Likewise.
7388         (MethodCore.ParameterTypes): This is now a property instead of a
7389         method, it's initialized from DoDefineParameters().
7390         (MethodCore.ParameterInfo): Removed the set accessor.
7391         (MethodCore.DoDefineParameters): New protected virtual method to
7392         initialize ParameterTypes and ParameterInfo.
7393         (Method.GetReturnType): We can now simply return the MemberType.
7394         (Method.GetMethodFlags): Override the MemberBase version and add
7395         the conditional flags.
7396         (Method.CheckBase): Moved some code from Define() here, call
7397         DoDefineParameters() here.
7398         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
7399         here to avoid some larger code duplication.
7400         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
7401         ensure that abstract and external accessors don't declare a body.
7402
7403         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
7404         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
7405         lookup in the attribute's parent classes, so we need to abort as soon
7406         as we found the first match.
7407         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
7408         the attribute has no arguments.
7409
7410         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
7411         of a Method.
7412
7413 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7414
7415         * cs-parser.jay: reverted previous patch.
7416
7417 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7418
7419         * cs-parser.jay: fixed bug #22119.
7420
7421 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7422
7423         * attribute.cs: fixed compilation. The error was:
7424         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
7425         be assigned to before control leaves the current method."
7426         [FIXME:  Filed as bug #28186: MCS must report this error.]
7427
7428 2002-07-25  Martin Baulig  <martin@gnome.org>
7429
7430         * attribute.cs (Attribute.Conditional_GetConditionName): New static
7431         method to pull the condition name ouf of a Conditional attribute.
7432         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
7433         the obsolete message and error flag out of an Obsolete attribute.
7434
7435         * class.cs (Method.GetMethodFlags): New public method to get the
7436         TypeManager.MethodFlags for this method.
7437         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
7438         private methods.
7439         (Method.Define): Get and apply the Obsolete and Conditional attributes;
7440         if we're overriding a virtual function, set the new private variable
7441         `parent_method'; call the new TypeManager.AddMethod().
7442
7443         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
7444         the MethodBuilder and the Method in a PtrHashtable.
7445         (TypeManager.builder_to_method): Added for this purpose.
7446         (TypeManager.MethodFlags): Added IsObsoleteError.
7447         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
7448         Obsolete and Conditional arguments in MethodBuilders.  If we discover
7449         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
7450         the message from the attribute.
7451
7452 2002-07-24  Martin Baulig  <martin@gnome.org>
7453
7454         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
7455         preprocessor directives, ensure that the argument to #define/#undef is
7456         exactly one identifier and that it's actually an identifier.
7457
7458         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
7459         did not work ....
7460
7461 2002-07-24  Martin Baulig  <martin@gnome.org>
7462
7463         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
7464         initialize it to TypeManager.object_type in the constructor.
7465         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
7466         of the `hm.get_current' method if we're using the collection pattern.
7467         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
7468         for the explicit conversion to make it work when we're using the collection
7469         pattern and the `Current' property has a different return type than `object'.
7470         Fixes #27713.
7471
7472 2002-07-24  Martin Baulig  <martin@gnome.org>
7473
7474         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
7475         does not match, but don't report any errors.  This method is called in
7476         order for all methods in a MethodGroupExpr until a matching method is
7477         found, so we don't want to bail out if the first method doesn't match.
7478         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
7479         matches, report the 123.  Fixes #28070.
7480
7481 2002-07-24  Martin Baulig  <martin@gnome.org>
7482
7483         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
7484         TypeManager.TypeToCoreType() to the top of the method so the
7485         following equality checks will work.  Fixes #28107.
7486
7487 2002-07-24  Martin Baulig  <martin@gnome.org>
7488
7489         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
7490         operand is of type uint, and the other operand is of type sbyte,
7491         short or int, the operands are converted to type long." -
7492         Actually do what this comment already told us.  Fixes bug #28106,
7493         added test-150.cs.
7494
7495 2002-07-24  Martin Baulig  <martin@gnome.org>
7496
7497         * class.cs (MethodBase): New abstract class.  This is now a base
7498         class for Property, Indexer and Event to avoid some code duplication
7499         in their Define() and DefineMethods() methods.
7500         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
7501         generic methods for Define() and DefineMethods().
7502         (FieldBase): Derive from MemberBase, not MemberCore.
7503         (Property): Derive from MemberBase, not MemberCore.
7504         (Property.DefineMethod): Moved all the code from this method to the
7505         new MethodBase.DefineAccessor(), just call it with appropriate
7506         argumetnts.
7507         (Property.Define): Call the new Property.DoDefine(), this does some
7508         sanity checks and we don't need to duplicate the code everywhere.
7509         (Event): Derive from MemberBase, not MemberCore.
7510         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
7511         accessors, this will also make them work with interface events.
7512         (Indexer): Derive from MemberBase, not MemberCore.
7513         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
7514         (Indexer.Define): Use the new MethodBase functions.
7515
7516         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
7517         argument to the constructor.
7518         (Interface.FindMembers): Added support for interface events.
7519         (Interface.PopluateEvent): Implemented.
7520
7521         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
7522
7523 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
7524
7525         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
7526         but this is required to check for a method name being the same as
7527         the containing class.  
7528
7529         Handle this now.
7530
7531 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7532
7533         * interface.cs: initialize variable.
7534
7535 2002-07-23  Martin Baulig  <martin@gnome.org>
7536
7537         Implemented the IndexerName attribute in interfaces.
7538
7539         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
7540         name if this is an explicit interface implementation.
7541         (Indexer.InterfaceIndexerName): New public variable.  If we're
7542         implementing an interface indexer, this is the IndexerName in that
7543         interface.  Otherwise, it's the IndexerName.
7544         (Indexer.DefineMethod): If we're implementing interface indexer,
7545         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
7546         and Pending.ImplementIndexer methods.
7547         (Indexer.Define): Also define the PropertyBuilder if we're
7548         implementing an interface indexer and this is neither an explicit
7549         interface implementation nor do the IndexerName match the one in
7550         the interface.
7551
7552         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
7553         If a method is defined here, then we always need to create a proxy
7554         for it.  This is used when implementing interface indexers.
7555         (Pending.IsInterfaceIndexer): New public method.
7556         (Pending.ImplementIndexer): New public method.
7557         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
7558         This is used when implementing interface indexers to define a proxy
7559         if necessary.
7560         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
7561         define a proxy if necessary.
7562
7563         * interface.cs (Interface.IndexerName): New public variable.
7564         (Interface.PopulateIndexer): Set the IndexerName.
7565         (Interface.DefineIndexers): New private method.  Populate all the
7566         indexers and make sure their IndexerNames match.
7567
7568         * typemanager.cs (IndexerPropertyName): Added support for interface
7569         indexers.
7570
7571 2002-07-22  Martin Baulig  <martin@gnome.org>
7572
7573         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
7574         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
7575         ret if HasReturnLabel.
7576         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
7577         variables.
7578
7579         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
7580         and set the ec.LoopBeginTryCatchLevel.
7581         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
7582         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
7583         the current ec.TryCatchLevel, the branch goes out of an exception
7584         block.  In this case, we need to use Leave and not Br.
7585
7586 2002-07-22  Martin Baulig  <martin@gnome.org>
7587
7588         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
7589         block unless the block does not always return or it is contained in
7590         another try { ... } catch { ... } block.  Fixes bug #26506.
7591         Added verify-1.cs to the test suite.
7592
7593 2002-07-22  Martin Baulig  <martin@gnome.org>
7594
7595         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
7596         then we do not always return.  Fixes bug #24985.
7597
7598 2002-07-22  Martin Baulig  <martin@gnome.org>
7599
7600         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
7601         lookup on a per-class level; ie. walk up the class hierarchy until we
7602         found at least one applicable method, then choose the best among them.
7603         Fixes bug #24463 and test-29.cs.
7604
7605 2002-07-22  Martin Baulig  <martin@gnome.org>
7606
7607         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
7608         return types of the methods.  The return type is not part of the
7609         signature and we must not check it to make the `new' modifier work.
7610         Fixes bug #27999, also added test-147.cs.
7611         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
7612
7613         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
7614         on the method's return type.
7615
7616 2002-07-21  Martin Baulig  <martin@gnome.org>
7617
7618         * assign.cs: Make this work if the rightmost source is a constant and
7619         we need to do an implicit type conversion.  Also adding a few more tests
7620         to test-38.cs which should have caught this.
7621
7622         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
7623         target in the makefile for this.  The makefile.gnu is primarily intended
7624         for end-users who don't want to debug the compiler.
7625
7626 2002-07-21  Martin Baulig  <martin@gnome.org>
7627
7628         * assign.cs: Improved the Assign class so it can now handle embedded
7629         assignments (X = Y = Z = something).  As a side-effect this'll now also
7630         consume less local variables.  test-38.cs now passes with MCS, added
7631         a few new test cases to that test.
7632
7633 2002-07-20  Martin Baulig  <martin@gnome.org>
7634
7635         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
7636         instructions.  Fixes bug #27977, also added test-146.cs.
7637
7638 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7639
7640         * cs-tokenizer.cs: fixed getHex ().
7641
7642 2002-07-19  Martin Baulig  <martin@gnome.org>
7643
7644         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
7645         not Type.GetType() to lookup the array type.  This is needed when
7646         we're constructing an array of a user-defined type.
7647         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
7648         single-dimensional arrays, but also for single-dimensial arrays of
7649         type decimal.
7650
7651 2002-07-19  Martin Baulig  <martin@gnome.org>
7652
7653         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
7654         this function is called, it's not allowed to share LocalBuilders
7655         among ILGenerators.
7656
7657 2002-07-19  Martin Baulig  <martin@gnome.org>
7658
7659         * expression.cs (Argument.Resolve): Report an error 118 when trying
7660         to pass a type as argument.
7661
7662 2002-07-18  Martin Baulig  <martin@gnome.org>
7663
7664         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
7665         Conv_R_Un for the signed `long' type.
7666
7667 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
7668
7669         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
7670         `expr' for the temporary result, as that will fail if we do
7671         multiple resolves on the same expression.
7672
7673 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
7674
7675         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
7676         ec.TypeContainer for looking up aliases. 
7677
7678         * class.cs (TypeContainer): Remove LookupAlias from here.
7679
7680         * decl.cs (DeclSpace); Move here.
7681
7682 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
7683
7684         * class.cs (FindMembers): Only call filter if the constructor
7685         bulider is not null.
7686
7687         Also handle delegates in `NestedTypes' now.  Now we will perform
7688         type lookups using the standard resolution process.  This also
7689         fixes a bug.
7690
7691         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
7692         This uses Expressions (the limited kind that can be parsed by the
7693         tree) instead of strings.
7694
7695         * expression.cs (ComposedCast.ToString): Implement, used to flag
7696         errors since now we have to render expressions.
7697
7698         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
7699         FormArrayType. 
7700
7701         * ecore.cs (SimpleName.ToString): ditto.
7702
7703         * cs-parser.jay: Instead of using strings to assemble types, use
7704         Expressions to assemble the type (using SimpleName, ComposedCast,
7705         MemberAccess).  This should fix the type lookups in declarations,
7706         because we were using a different code path for this.
7707
7708         * statement.cs (Block.Resolve): Continue processing statements
7709         even when there is an error.
7710
7711 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
7712
7713         * class.cs (Event.Define): Also remove the `remove' method from
7714         the list of pending items.
7715
7716         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
7717         generate more compact code. 
7718
7719 2002-07-17  Martin Baulig  <martin@gnome.org>
7720
7721         * const.cs (Const.LookupConstantValue): Add support for constant
7722         `unchecked' and `checked' expressions.
7723         Also adding test case test-140.cs for this.
7724
7725 2002-07-17  Martin Baulig  <martin@gnome.org>
7726
7727         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
7728         check whether mi.ReturnType implements the IEnumerator interface; the
7729         `==' and the IsAssignableFrom() will fail in this situation.
7730
7731 2002-07-16  Ravi Pratap  <ravi@ximian.com>
7732
7733         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
7734         here too.
7735
7736 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7737
7738         * expression.cs: fixed bug #27811.
7739
7740 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
7741
7742         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
7743         Molaro: when we are a ref, the value already contains a pointer
7744         value, do not take the address of it.
7745
7746 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
7747         * removed mb-parser.jay and mb-tokenizer.cs
7748
7749 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
7750
7751         * expression.cs: check against the building corlib void type.
7752
7753 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
7754
7755         * ecore.cs: fix for valuetype static readonly fields: when 
7756         initializing them, we need their address, not the address of a copy.
7757
7758 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
7759
7760         * typemanager.cs: register also enum_type in corlib.
7761
7762 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
7763
7764         * class.cs: allow calling this (but not base) initializers in structs.
7765
7766 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
7767
7768         * ecore.cs: make sure we compare against the building base types
7769         in GetTypeSize ().
7770
7771 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
7772
7773         * typemanager.cs: fix TypeToCoreType() to handle void and object
7774         (corlib gets no more typerefs after this change).
7775
7776 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
7777
7778         * expression.cs (ArrayCreation.EmitArrayArguments): use
7779         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
7780
7781         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
7782         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
7783         array indexes, the runtime actually forbids them.
7784
7785         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
7786         for array arguments here.
7787
7788         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
7789         instead of the default for ValueTypes.
7790
7791         (New.DoEmit): Use IsValueType instead of
7792         IsSubclassOf (value_type)
7793         (New.DoResolve): ditto.
7794         (Invocation.EmitCall): ditto.
7795
7796         * assign.cs (Assign): ditto.
7797
7798         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
7799         Statements *are* currently doing part of their resolution during
7800         Emit.  
7801
7802         Expressions do always resolve during resolve, but statements are
7803         only required to propagate resolution to their children.
7804
7805 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
7806
7807         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
7808
7809         (LoadAssembly): Do not add the dll if it is already specified
7810
7811         (MainDriver): Add the System directory to the link path at the end,
7812         after all the other -L arguments. 
7813
7814         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
7815         wrong opcode for loading bytes and bools (ldelem.i1 instead of
7816         ldelem.u1) and using the opposite for sbytes.
7817
7818         This fixes Digger, and we can finally run it.
7819
7820         * driver.cs (UnixParseOption): Move the option parsing here.  
7821         (CSCParseOption): Implement CSC-like parsing of options.
7822
7823         We now support both modes of operation, the old Unix way, and the
7824         new CSC-like way.  This should help those who wanted to make cross
7825         platform makefiles.
7826
7827         The only thing broken is that /r:, /reference: and /lib: are not
7828         implemented, because I want to make those have the same semantics
7829         as the CSC compiler has, and kill once and for all the confussion
7830         around this.   Will be doing this tomorrow.
7831
7832         * statement.cs (Unsafe.Resolve): The state is checked during
7833         resolve, not emit, so we have to set the flags for IsUnsfe here.
7834
7835 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
7836
7837         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
7838         not catch the Error_ObjectRefRequired in SimpleName (as it is
7839         possible to have a class/instance variable name that later gets
7840         deambiguated), we have to check this here.      
7841
7842 2002-07-10  Ravi Pratap  <ravi@ximian.com>
7843
7844         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
7845         make static and put into Expression.
7846
7847         (Event.Define): Register the private field of the event with the 
7848         TypeManager so that GetFieldFromEvent can get at it.
7849
7850         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
7851         keep track of the private field associated with an event which
7852         has no accessors.
7853
7854         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
7855         private field.
7856
7857         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
7858
7859 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
7860
7861         * expression.cs (Binary.EmitBranchable): this routine emits the
7862         Binary expression in a branchable context.  This basically means:
7863         we need to branch somewhere, not just get the value on the stack.
7864
7865         This works together with Statement.EmitBoolExpression.
7866
7867         * statement.cs (Statement.EmitBoolExpression): Use
7868         EmitBranchable. 
7869
7870 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
7871
7872         * statement.cs (For): Reduce the number of jumps in loops.
7873
7874         (For): Implement loop inversion for the For statement.
7875
7876         (Break): We can be breaking out of a Try/Catch controlled section
7877         (foreach might have an implicit try/catch clause), so we need to
7878         use Leave instead of Br.
7879
7880         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
7881         now).  If the instace expression supports IMemoryLocation, we use
7882         the AddressOf method from the IMemoryLocation to extract the
7883         address instead of emitting the instance.
7884
7885         This showed up with `This', as we were emitting the instance
7886         always (Emit) instead of the Address of This.  Particularly
7887         interesting when This is a value type, as we dont want the Emit
7888         effect (which was to load the object).
7889
7890 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
7891
7892         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
7893
7894         * statement.cs (Checked): Set the CheckedState during the resolve
7895         process too, as the ConvCast operations track the checked state on
7896         the resolve process, and not emit.
7897
7898         * cs-parser.jay (namespace_member_declaration): Flag that we have
7899         found a declaration when we do.  This is used to flag error 1529
7900
7901         * driver.cs: Report ok when we display the help only.
7902
7903 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
7904
7905         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
7906
7907 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
7908
7909         * cs-tokenizer.cs (define): We also have to track locally the
7910         defines.  AllDefines is just used for the Conditional Attribute,
7911         but we also need the local defines for the current source code. 
7912
7913 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
7914
7915         * statement.cs (While, For, Do): These loops can exit through a
7916         Break statement, use this information to tell whether the
7917         statement is the last piece of code.
7918
7919         (Break): Flag that we break.
7920
7921         * codegen.cs (EmitContexts): New `Breaks' state variable.
7922
7923 2002-07-03  Martin Baulig  <martin@gnome.org>
7924
7925         * class.cs (TypeContainer.MethodModifiersValid): Allow override
7926         modifiers in method declarations in structs.  Otherwise, you won't
7927         be able to override things like Object.Equals().
7928
7929 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
7930
7931         * class.cs (Method, Property, Indexer): Do not allow the public
7932         modifier to be used in explicit interface implementations.
7933
7934         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
7935         override modifiers in method declarations in structs
7936
7937 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
7938
7939         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
7940         integer or real overflow, report an error
7941
7942 2002-07-02  Martin Baulig  <martin@gnome.org>
7943
7944         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
7945         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
7946         to tell the runtime about our newly created System.Object and
7947         System.ValueType types.
7948
7949 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
7950
7951         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
7952         struct instead of Ldarg/Starg.
7953
7954 2002-07-02  Martin Baulig  <martin@gnome.org>
7955
7956         * expression.cs (Indirection.Indirection): Call
7957         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
7958
7959 2002-07-02  Martin Baulig  <martin@gnome.org>
7960
7961         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
7962         ValueType, call TypeManager.TypeToCoreType() on it.
7963         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
7964         the OpCodes.Newarr argument.
7965
7966 2002-07-02  Martin Baulig  <martin@gnome.org>
7967
7968         * expression.cs (Invocation.EmitCall): When compiling corlib,
7969         replace all calls to the system's System.Array type to calls to
7970         the newly created one.
7971
7972         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
7973         System.Array methods.
7974         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
7975         from the system's System.Array type which must be replaced.
7976
7977 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
7978
7979         * typemanager.cs: load unverifiable_code_ctor so we can build
7980         corlib using the correct type. Avoid using GetTypeCode() with
7981         TypeBuilders.
7982         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
7983         TypeManager.object_type to allow building corlib.
7984
7985 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
7986
7987         * ecore.cs: handle System.Enum separately in LoadFromPtr().
7988
7989 2002-07-01  Martin Baulig  <martin@gnome.org>
7990
7991         * class.cs: Make the last change actually work, we need to check
7992         whether `ifaces != null' to avoid a crash.
7993
7994 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
7995
7996         * class.cs: when we build structs without fields that implement
7997         interfaces, we need to add the interfaces separately, since there is
7998         no API to both set the size and add the interfaces at type creation
7999         time.
8000
8001 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
8002
8003         * expression.cs: the dimension arguments to the array constructors
8004         need to be converted if they are a long.
8005
8006 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
8007
8008         * class.cs: don't emit ldarg.0 if there is no parent constructor
8009         (fixes showstopper for corlib).
8010
8011 2002-06-29  Martin Baulig  <martin@gnome.org>
8012
8013         MCS now compiles corlib on GNU/Linux :-)
8014
8015         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
8016         ie. check for MethodImplOptions.InternalCall.
8017
8018         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
8019         and TypeManager.attribute_type are null, so we must explicitly check
8020         whether parent is not null to find out whether it's an attribute type.
8021         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
8022         and SetBuilder, not only if the property is neither abstract nor external.
8023         This is necessary to set the MethodImplOptions on the accessor methods.
8024         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
8025         SetBuilder, see Property.Emit().
8026
8027         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
8028         populate "System.Object", "System.ValueType" and "System.Attribute" since
8029         they've already been populated from BootCorlib_PopulateCoreTypes().
8030
8031 2002-06-29  Martin Baulig  <martin@gnome.org>
8032
8033         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
8034         is the NullLiteral, we also need to make sure that target_type is not
8035         an enum type.   
8036
8037 2002-06-29  Martin Baulig  <martin@gnome.org>
8038
8039         * rootcontext.cs (RootContext.ResolveCore): We must initialize
8040         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
8041         before calling BootstrapCorlib_ResolveDelegate ().
8042
8043 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8044
8045         * statement.cs: fixed build-breaker. All tests passed ok.
8046
8047 2002-06-27  Martin Baulig  <martin@gnome.org>
8048
8049         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
8050         for System.Decimal when compiling corlib.
8051
8052 2002-06-27  Martin Baulig  <martin@gnome.org>
8053
8054         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
8055         switch blocks which contain nothing but a default clause.
8056
8057 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
8058
8059        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
8060
8061 2002-06-27  Martin Baulig  <martin@gnome.org>
8062
8063         * ecore.cs (PropertyExpr.PropertyExpr): Call
8064         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
8065
8066         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
8067         is already a TypeBuilder.
8068
8069 2002-06-27  Martin Baulig  <martin@gnome.org>
8070
8071         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
8072         `target_type == TypeManager.array_type', not IsAssignableFrom() in
8073         the "from an array-type to System.Array" case.  This makes it work
8074         when compiling corlib.
8075
8076 2002-06-27  Martin Baulig  <martin@gnome.org>
8077
8078         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
8079         non-static PropertyExpr, set its InstanceExpression.  This makes
8080         the `ICollection.Count' property work in System/Array.cs.
8081
8082 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
8083
8084         * driver.cs: Made error handling more consistent.  Errors now
8085         tracked by Report class, so many methods which used to return int
8086         now return void.  Main() now prints success/failure and 
8087         errors/warnings message.
8088
8089         Renamed '--probe' compiler argument to '--expect-error'.  Removed
8090         the magic number return values (123 and 124).  Now, if the
8091         expected error occurs, the compiler exits with success (exit value
8092         0).  If the compilation completes without seeing that particular
8093         error, the compiler exits with failure (exit value 1).  The
8094         makefile in mcs/errors has been changed to handle the new behaviour.
8095
8096         * report.cs: Made 'expected error' number a property and renamed
8097         it from 'Probe' to 'ExpectedError'.
8098
8099         * genericparser.cs: Removed error handling support, since it is
8100         now all done by Report class.
8101
8102         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
8103         class, so parse() no longer returns an int.
8104
8105         * namespace.cs: Use Report.Error instead of GenericParser.error
8106
8107 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
8108
8109         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
8110         TypeContainer.AddOperator): At the front of the list put the
8111         explicit implementations, so they get resolved/defined first. 
8112
8113 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
8114
8115         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
8116         interface type is implemented by this TypeContainer.  Used during
8117         explicit interface implementation.
8118
8119         (Property.Define, Indexer.Define, Method.Define): Validate that
8120         the given interface in the explicit implementation is one of the
8121         base classes for the containing type.
8122
8123         Also if we are explicitly implementing an interface, but there is
8124         no match in the pending implementation table, report an error.
8125
8126         (Property.Define): Only define the property if we are
8127         not explicitly implementing a property from an interface.  Use the
8128         correct name also for those properties (the same CSC uses,
8129         although that is really not needed).
8130
8131         (Property.Emit): Do not emit attributes for explicitly implemented
8132         properties, as there is no TypeBuilder.
8133
8134         (Indexer.Emit): ditto.
8135
8136         Hiding then means that we do not really *implement* a pending
8137         implementation, which makes code fail.
8138
8139 2002-06-22  Martin Baulig  <martin@gnome.org>
8140
8141         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
8142         the return value of Object.GetType().  [FIXME: we need to do this whenever
8143         we get a type back from the reflection library].
8144
8145 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
8146
8147         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
8148
8149 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
8150
8151         * attribute.cs: Return null if we can not look up the type.
8152
8153         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
8154         the interface types found.
8155
8156         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
8157         interface types found.
8158
8159         * typemanager.cs (GetInterfaces): Make this routine returns alll
8160         the interfaces and work around the lame differences between
8161         System.Type and System.Reflection.Emit.TypeBuilder in the results
8162         result for GetInterfaces.
8163
8164         (ExpandInterfaces): Given an array of interface types, expand and
8165         eliminate repeated ocurrences of an interface.  This expands in
8166         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
8167         be IA, IB, IC.
8168
8169 2002-06-21  Martin Baulig  <martin@gnome.org>
8170
8171         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
8172         on System.Enum.
8173
8174 2002-06-21  Martin Baulig  <martin@gnome.org>
8175
8176         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
8177         and called with one of the core types, return the corresponding typebuilder for
8178         that type.
8179
8180         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
8181         element type.
8182
8183 2002-06-21  Martin Baulig  <martin@gnome.org>
8184
8185         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
8186         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
8187         (Expression.ConvertReferenceExplicit): Likewise.
8188
8189         * expression.cs (ElementAccess.DoResolve): Likewise.
8190         (ElementAccess.DoResolveLValue): Likewise.
8191
8192 2002-06-10  Martin Baulig  <martin@gnome.org>
8193
8194         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
8195         add the "value" parameter to the parameter list.
8196
8197         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
8198         to our caller.
8199
8200 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
8201
8202         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
8203         the argument to an int, uint, long or ulong, per the spec.  Also
8204         catch negative constants in array creation.
8205
8206 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
8207
8208         * class.cs: do not allow the same interface to appear twice in
8209         the definition list.
8210
8211 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
8212
8213         * ecore.cs: don't use ldlen with System.Array.
8214
8215 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
8216
8217         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
8218
8219 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
8220
8221         * modifiers.cs: produce correct field attributes for protected
8222         internal. Easy fix so miguel can work on ther harder stuff:-)
8223
8224 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
8225
8226         * pending.cs: New file.  Move the code from class.cs here.
8227         Support clearning the pending flag for all methods (when not doing
8228         explicit interface implementation).
8229
8230 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
8231
8232         * rootcontext.cs: added a couple more types needed to bootstrap.
8233
8234 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
8235
8236         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
8237         constructor in the type, instead of any constructor in the type
8238         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
8239         a bug in the Mono runtime when applying the params attribute). 
8240
8241 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
8242         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
8243
8244 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
8245
8246         * expression.cs (Unary.ResolveOperator): Use TypeManager
8247         to resolve the type.
8248
8249 2002-06-13  Ravi Pratap  <ravi@ximian.com>
8250
8251         * cs-parser.jay (enum_member_declaration): Pass in the attributes
8252         attached.
8253
8254         * enum.cs (AddEnumMember): Add support to store the attributes associated 
8255         with each member too.
8256
8257         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
8258         field builders too - this takes care of the enum member case.
8259
8260 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
8261
8262         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
8263         address-of operator on both value types and pointers.
8264
8265 2002-06-10  Martin Baulig  <martin@gnome.org>
8266
8267         * interface.cs (Interface.PopulateIndexer): Add the indexer's
8268         PropertyBuilder to the `property_builders' list.
8269
8270         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
8271         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
8272         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
8273         find any indexers which are inherited from an interface.
8274
8275 2002-06-09  Martin Baulig  <martin@gnome.org>
8276
8277         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
8278         the same type as the constant if necessary.  There's also a test-130.cs
8279         for this.
8280
8281         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
8282
8283         * typemanager.cs (TypeManager.ChangeType): Previously known as
8284         Enum.ChangeEnumType().
8285
8286 2002-06-09  Martin Baulig  <martin@gnome.org>
8287
8288         * expression.cs (Cast.TryReduce): Added support for consts.
8289
8290 2002-06-08  Ravi Pratap  <ravi@ximian.com>
8291
8292         * class.cs (Accessor): Hold attributes information so we can pass
8293         it along.
8294
8295         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
8296         Modify to pass in attributes attached to the methods.
8297
8298         (add_accessor_declaration, remove_accessor_declaration): Ditto.
8299
8300         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
8301         to handle the Accessor kind :-)
8302
8303         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
8304
8305 2002-06-08  Martin Baulig  <martin@gnome.org>
8306
8307         * expression.cs (Unary.TryReduceNegative): Added support for
8308         ULongConstants.
8309
8310 2002-06-08  Martin Baulig  <martin@gnome.org>
8311
8312         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
8313         name can't be found in the `defined_names' - the caller will do a
8314         MemberLookup in this case and thus find methods in System.Enum
8315         such as Enum.IsDefined().
8316
8317 2002-06-08  Martin Baulig  <martin@gnome.org>
8318
8319         * enum.cs (Enum.ChangeEnumType): This is a custom version of
8320         Convert.ChangeType() which works with TypeBuilder created types.
8321         (Enum.LookupEnumValue, Enum.Define): Use it here.
8322
8323         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
8324         `TypeBuilder.BaseType != null' check.
8325         (TypeContainer.FindMembers): Only lookup parent members if we
8326         actually have a parent.
8327         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
8328         (ConstructorInitializer.Resolve): Likewise.
8329
8330         * interface.cs (Interface.FindMembers): Added
8331         `TypeBuilder.BaseType != null' check.
8332
8333         * rootcontext.cs (RootContext.ResolveCore): Added
8334         "System.Runtime.CompilerServices.IndexerNameAttribute" to
8335         classes_second_stage.
8336
8337         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
8338         debug_type and trace_type when compiling with --nostdlib.       
8339
8340 2002-06-07  Martin Baulig  <martin@gnome.org>
8341
8342         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
8343         (AddField): Set it to true when adding a non-static field.
8344         (DefineType): Use `have_nonstatic_fields' to find out whether we
8345         have non-static fields, not `Fields != null'.
8346
8347 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
8348
8349         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
8350         dereferencing a null on the static-field code path)
8351
8352 2002-05-30  Martin Baulig  <martin@gnome.org>
8353
8354         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
8355         to take command line arguments.  Use reflection to call the new
8356         custom `Initialize' function on the symbol writer and pass it the
8357         command line arguments.
8358
8359         * driver.cs (--debug-args): New command line argument to pass command
8360         line arguments to the symbol writer.
8361
8362 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
8363
8364         * assign.cs (DoResolve): Forgot to do the implicit conversion to
8365         the target type for indexers and properties.  Thanks to Joe for
8366         catching this.
8367
8368 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
8369
8370         * typemanager.cs (MethodFlags): returns the method flags
8371         (Obsolete/ShouldIgnore) that control warning emission and whether
8372         the invocation should be made, or ignored. 
8373
8374         * expression.cs (Invocation.Emit): Remove previous hack, we should
8375         not do this on matching a base type, we should do this based on an attribute
8376
8377         Only emit calls to System.Diagnostics.Debug and
8378         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
8379         on the command line.
8380
8381         * rootcontext.cs: Global settings for tracing and debugging.
8382
8383         * cs-tokenizer.cs (define): New utility function to track
8384         defines.   Set the global settings for TRACE and DEBUG if found.
8385
8386 2002-05-25  Ravi Pratap  <ravi@ximian.com>
8387
8388         * interface.cs (Populate*): Pass in the TypeContainer as well as
8389         the DeclSpace as parameters so that we can create EmitContexts and
8390         then use that to apply attributes etc.
8391
8392         (PopulateMethod, PopulateEvent, PopulateProperty)
8393         (PopulateIndexer): Apply attributes everywhere.
8394
8395         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
8396         etc.
8397
8398         (ApplyAttributes): Update accordingly.
8399
8400         We now apply interface attributes for all members too.
8401
8402 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
8403
8404         * class.cs (Indexer.Define); Correctly check if we are explicit
8405         implementation (instead of checking the Name for a ".", we
8406         directly look up if the InterfaceType was specified).
8407
8408         Delay the creation of the PropertyBuilder.
8409
8410         Only create the PropertyBuilder if we are not an explicit
8411         interface implementation.   This means that explicit interface
8412         implementation members do not participate in regular function
8413         lookups, and hence fixes another major ambiguity problem in
8414         overload resolution (that was the visible effect).
8415
8416         (DefineMethod): Return whether we are doing an interface
8417         implementation. 
8418
8419         * typemanager.cs: Temporary hack until we get attributes in
8420         interfaces (Ravi is working on that) and we get IndexerName
8421         support in interfaces.
8422
8423         * interface.cs: Register the indexers as properties.
8424
8425         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
8426         warning, I have verified that this is a bug in the .NET runtime
8427         (JavaScript suffers of the same problem).
8428
8429         * typemanager.cs (MemberLookup): When looking up members for
8430         interfaces, the parent of an interface is the implicit
8431         System.Object (so we succeed in searches of Object methods in an
8432         interface method invocation.  Example:  IEnumerable x;  x.ToString
8433         ()) 
8434
8435 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
8436
8437         * class.cs (Event): Events should also register if they do
8438         implement the methods that an interface requires.
8439
8440         * typemanager.cs (MemberLookup); use the new GetInterfaces
8441         method. 
8442
8443         (GetInterfaces): The code used to lookup interfaces for a type is
8444         used in more than one place, factor it here. 
8445
8446         * driver.cs: Track the errors at the bottom of the file, we kept
8447         on going.
8448
8449         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
8450         instance if the method we are calling is static!
8451
8452 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
8453
8454         * attribute.cs (ApplyAttributes): Make this function filter out
8455         the IndexerName attribute (as that attribute in reality is never
8456         applied) and return the string constant for the IndexerName
8457         attribute. 
8458
8459         * class.cs (TypeContainer.Emit): Validate that all the indexers
8460         have the same IndexerName attribute, and if so, set the
8461         DefaultName attribute on the class. 
8462
8463         * typemanager.cs: The return value might contain other stuff (not
8464         only methods).  For instance, consider a method with an "Item"
8465         property and an Item method.
8466
8467         * class.cs: If there is a problem with the parameter types,
8468         return. 
8469
8470 2002-05-24  Ravi Pratap  <ravi@ximian.com>
8471
8472         * ecore.cs (ImplicitConversionExists): Wrapper function which also
8473         looks at user defined conversion after making a call to 
8474         StandardConversionExists - we need this for overload resolution.
8475
8476         * expression.cs : Update accordingly the various method calls.
8477
8478         This fixes 2 bugs filed against implicit user defined conversions 
8479
8480 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
8481
8482         * statement.cs: Track the result of the assignment.
8483
8484 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * expression.cs (MemberAccess): Improved error reporting for
8487         inaccessible members.
8488
8489 2002-05-22  Martin Baulig  <martin@gnome.org>
8490
8491         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
8492         itself with debugging support.
8493
8494 2002-05-22  Martin Baulig  <martin@gnome.org>
8495
8496         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
8497         Removed, this isn't needed anymore.
8498
8499 2002-05-20  Martin Baulig  <martin@gnome.org>
8500
8501         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
8502         be underlying type for an enum.
8503
8504 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
8505
8506         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
8507         that splits out the loading of just the core types.
8508
8509         * rootcontext.cs (ResolveCore): Split the struct resolution in
8510         two, so we can load the enumeration underlying types before any
8511         enums are used.
8512
8513         * expression.cs (Is): Bandaid until we fix properly Switch (see
8514         bug #24985 for details).
8515
8516         * typemanager.cs (ImplementsInterface): The hashtable will contain
8517         a null if there are no interfaces implemented.
8518
8519 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
8520
8521         * cs-parser.jay (indexer_declarator): It is fine to have array
8522         parameters
8523
8524 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
8525
8526         * typemanager.cs: (RegisterBuilder): New function used to register
8527         TypeBuilders that implement interfaces.  Since
8528         TypeBuilder.GetInterfaces (as usual) does not work with lame
8529         Reflection.Emit. 
8530         (AddUserType): register interfaces.
8531
8532         (ImplementsInterface): Use the builder_to_ifaces hash if we are
8533         dealing with TypeBuilder.  Also, arrays are showing up as
8534         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
8535         methods can not be invoked on them!
8536
8537         * ecore.cs (ExplicitReferenceConversionExists): Made public.
8538         (ImplicitReferenceConversionExists): Split out from
8539         StandardConversionExists. 
8540
8541         * expression.cs (As): We were only implementing one of the three
8542         cases for the as operator.  We now implement them all.
8543         (Is): Implement the various other cases for Is as well.
8544
8545         * typemanager.cs (CACHE): New define used to control if we want or
8546         not the FindMembers cache.  Seems to have a negative impact on
8547         performance currently
8548
8549         (MemberLookup): Nested types have full acess to
8550         enclosing type members
8551
8552         Remove code that coped with instance/static returns for events, we
8553         now catch this in RealFindMembers.
8554
8555         (RealFindMembers): only perform static lookup if the instance
8556         lookup did not return a type or an event.  
8557
8558 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
8559
8560         * assign.cs (CompoundAssign): We pass more semantic information
8561         now to Compound Assignments than we did before: now we have all
8562         the information at hand, and now we resolve the target *before* we
8563         do the expression expansion, which allows the "CacheValue" method
8564         to have the effect we intended (before, a [x] += 1 would generate
8565         two differen ArrayAccess expressions from the ElementAccess,
8566         during the resolution process).
8567
8568         (CompoundAssign.DoResolve): Resolve target and original_source here.
8569
8570 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
8571
8572         * expression.cs (ArrayAccess): dropped debugging information. 
8573
8574         * typemanager.cs: Small bug fix: I was always returning i_members,
8575         instead of one of i_members or s_members (depending on which had
8576         the content).
8577
8578         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
8579         method is invoked before any code generation takes place, and it
8580         is a mechanism to inform that the expression will be invoked more
8581         than once, and that the method should use temporary values to
8582         avoid having side effects
8583
8584         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
8585
8586         * ecore.cs (Expression.CacheTemporaries): Provide empty default
8587         implementation.
8588
8589         * expression.cs (Indirection, ArrayAccess): Add support for
8590         CacheTemporaries in these two bad boys. 
8591
8592         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
8593         ldobj or ldind_ref.  
8594         (StoreFromPtr): Handle stobj as well.
8595
8596         * expression.cs (UnaryMutator): Share more code.
8597
8598         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
8599         down: I was not tracking the Filter function as well, which
8600         was affecting the results of the cache.
8601
8602 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
8603
8604         * attribute.cs: Remove the hack to handle the CharSet property on
8605         StructLayouts. 
8606
8607 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
8608
8609         * attribute.cs (DoResolve): More uglyness, we now only try to
8610         resolve the attribute partially, to extract the CharSet
8611         information (only if we are a StructLayout attribute).  Otherwise 
8612
8613         (GetExtraTypeInfo): Add some code to conditionally kill in the
8614         future this.   I am more and more convinced that the .NET
8615         framework has special code to handle the attribute setting on
8616         certain elements.
8617
8618         * expression.cs (IsParamsMethodApplicable): Revert my previous
8619         foreach change here, it was wrong.
8620
8621 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
8622
8623         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
8624         (pp_expr): do not abort on unknown input, just return.
8625         (eval): abort if there are pending chars.
8626
8627         * attribute.cs (Attribute.Resolve): Positional parameters are
8628         optional.  Deal with that case.
8629
8630         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
8631         the Ansi/Unicode/Auto information for the type.
8632
8633         (TypeContainer.DefineType): instantiate the EmitContext here, as
8634         we will be using it during the type definition (to resolve
8635         attributes) and during the emit phase.
8636
8637         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
8638         to pull type information out of the attributes
8639
8640         (Attribute.Resolve): track the constructor builder, and allow for
8641         multiple invocations (structs and classes will use this).
8642
8643         * ecore.cs (MemberLookupFinal): new version with all the
8644         parameters customizable.
8645
8646         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
8647         constructors.  Return if the result value is null (as the error
8648         would have been flagged already by MemberLookupFinal)
8649
8650         Do not allow instances of abstract classes or interfaces to be
8651         created.
8652
8653         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
8654         We have to compare the assembly property here when dealing with
8655         FamANDAssem and Assembly access modifiers, because we might be
8656         creating an assembly from *modules* (that means that we are not
8657         getting TypeBuilders for types defined in other modules that are
8658         part of this assembly).
8659
8660         (Method.Emit): If the method is marked abstract and has a body,
8661         emit an error. 
8662
8663         (TypeContainer.DefineMembers): If both the defined member and the
8664         parent name match are methods, then do not emit any warnings: let
8665         the Method.Define routine take care of flagging warnings.  But if
8666         there is a mismatch (method overrides something else, or method is
8667         overriwritten by something, then emit warning).
8668
8669         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
8670         set to null, this means `do not check for the return type on the
8671         signature'. 
8672
8673         (Method.Define): set the return type for the method signature to
8674         null, so that we get methods with the same name and parameters and
8675         different return types.  This is used to flag warning 114 (you are
8676         hiding a method, and you probably want to use the new/override
8677         keywords instead).
8678
8679         * typemanager.cs (MemberLookup): Implemented proper access
8680         control, closing a long standing set of bug reports.  The problem
8681         was that the Framework only has two bits: Public and NonPublic,
8682         and NonPublic includes private and protected methods, but we need
8683         to enforce the FamANDAssem, FamOrAssem and Family. 
8684
8685 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
8686
8687         * statement.cs (GotoCase): Return true: Ammounts to giving up
8688         knowledge on whether we return or not, and letting the other case
8689         be responsible for it.
8690
8691 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
8692
8693         * driver.cs: Do not load directories for each file processed, only
8694         do it if there is a pattern.
8695
8696         * ecore.cs: Report readonly assigns here as well, as we might have
8697         been resolved only by MemberAccess.
8698
8699         (SimpleName.SimpleNameResolve): Also be useful for LValue
8700         resolution.   We need this to propagate assign to local readonly variables
8701
8702         * typemanager.cs: Use a ptrhashtable for the criteria, because we
8703         do not want to reuse potential criteria memory.
8704
8705         * class.cs (MyEventBuilder): Set reflected_type;
8706
8707         * ecore.cs (Constantify): Added support for constifying bools.
8708
8709         (RootContext.LookupType): Added a cache for values looked up in
8710         the declaration space.
8711
8712         * typemanager.cs (FindMembers): Now is a front-end to
8713         RealFindMembers, and provides a two-level hashtable-based cache to
8714         the request.  
8715
8716         15% performance improvement: from 22.5 to 19.2 seconds.
8717
8718         * expression.cs (IsParamsMethodApplicable): use foreach.
8719         (Invocation.DoResolve): ditto.
8720         (New.DoResolve): ditto.
8721         (ArrayCreation.DoResolve): ditto.
8722
8723         * ecore.cs (FindMostEncompassingType): use foreach.
8724
8725         * delegate.cs (NewDelegate.DoResolve): Use foreach
8726
8727         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
8728         (RemoveMethods): use foreach.
8729
8730         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
8731         nested foreach statements instead of for, and also break out of
8732         the inner loop once a match is found.
8733
8734         (Invocation.OverloadResolve): Use foreach, simplify the code. 
8735
8736 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
8737
8738         * cfold.cs (BinaryFold): During an enumeration evaluation context,
8739         we actually unwrap the expression to allow for extra information
8740         to be extracted. 
8741
8742         * expression.cs: Use Shr_Un on unsigned operations. 
8743
8744 2002-05-08  Ravi Pratap  <ravi@ximian.com>
8745
8746         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
8747         applicable operators was not being considered correctly. This closes
8748         the bug Miguel reported.
8749
8750 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
8751
8752         * attribute.cs: check that the type derives from System.Attribute
8753         and report the correct error in that case (moved the duplicate code to
8754         its own method, too).
8755
8756 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
8757
8758         * attribute.cs: lookup attribute type name as the spec says: first the
8759         bare attribute name and then name + "Attribute" (nant compiles with
8760         mcs after this fix).
8761
8762 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
8763
8764         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
8765         Because of the way we parse things, we should try to see if a
8766         UIntConstant can fit in an integer.
8767
8768 2002-05-07  Ravi Pratap  <ravi@ximian.com>
8769
8770         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
8771         when we are in an explicit context.
8772
8773         (ConvertReferenceExplicit): When converting from Iface type S to Class
8774         T make sure the rules are implemented as an OR.
8775
8776         * parameter.cs (ParameterType): Make it a property for now although the
8777         purpose really isn't anything immediate.
8778
8779         * expression.cs (Is*Applicable): Do better checking on the parameter type
8780         of a ref/out parameter. The ones from the system assemblies are already 
8781         marked with the correct type so we don't need to do any correction.
8782
8783         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
8784         the object type is standard too so include that.
8785
8786 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
8787
8788         * ecore.cs (StandardConversionExists): Augment with missing code:
8789         deal with IntConstant, LongConstants and Enumerations.
8790
8791         * assign.cs: Report the error, instead of failing silently
8792
8793         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
8794         typecontainer that they are declared, because the
8795         typecontainer/namespace will have the list of using clauses that
8796         need to be applied.
8797
8798         Assembly Attributes were escaping the normal registration
8799         mechanism. 
8800
8801         (EmitCode): Apply attributes within an EmitContext that represents
8802         the container they were declared on.
8803
8804         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
8805
8806 2002-05-06  Ravi Pratap  <ravi@ximian.com>
8807
8808         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
8809         Revamp completely - make much cleaner as we now operate only
8810         on a set of Types.
8811
8812         (FindMostSpecificSource, FindMostSpecificTarget): New methods
8813         to implement the logic detailed in the spec more correctly.
8814
8815         (UserDefinedConversion): Update accordingly.
8816
8817 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
8818
8819         * statement.cs: Return flow analysis information up.
8820
8821         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
8822         and the default.
8823
8824         (token): Do not consume an extra character before calling
8825         decimal_digits.
8826
8827 2002-05-06  Piers Haken <piersh@friskit.com>
8828
8829         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
8830
8831 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
8832
8833         * class.cs (Constructor.Emit): Set the IsStatic flag in the
8834         EmitContext during the instance constructor initializer
8835         resolution, to stop access to instance variables.
8836
8837         This is mandated by the spec, last paragraph of the `constructor
8838         initializers' section. 
8839
8840 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
8841
8842         * cs-parser.jay, class.cs (Accessor): new class used to represent
8843         an accessor (get or set).  In the past we used `null' to represent
8844         a missing accessor.  But this is ambiguous because there was no
8845         way to tell in abstract indexers/properties if one of them was
8846         specified.
8847
8848         Now there is a way of addressing that.
8849
8850         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
8851         instead of FindMembers.
8852
8853         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
8854         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
8855
8856         * attribute.cs: Treat indexers and properties as the same in terms
8857         of applying attributes
8858
8859         * ecore.cs (FindMostEncompassedType): Use statically initialized
8860         EmptyExpressions()s like we do elsewhere to avoid creating useless
8861         objects (and we take this out of the tight loop).
8862
8863         (GetConversionOperators): Move the code to extract the actual
8864         operators to a separate routine to clean things up.
8865
8866 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
8867
8868         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
8869         events are always registered FieldBuilders.
8870
8871         * class.cs (FieldBase): New class shared by Fields 
8872
8873         * delegate.cs: If we are a toplevel delegate, use our full name.
8874         If we are a nested delegate, then only use our tail name.
8875
8876 2002-05-02  Ravi Pratap  <ravi@ximian.com>
8877
8878         * expression.cs (IsApplicable): Ensure that we add the "&" to
8879         ref/out types before comparing it with the type of the argument.
8880
8881         (IsParamsMethodApplicable): Ditto.
8882
8883         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
8884         silly me ;-)
8885
8886         * delegate.cs : Handle the case when we have more than one applicable
8887         method. Flag an error only when we finish checking all.
8888
8889 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
8890
8891         * expression.cs: Add support for boolean static initializers.
8892
8893 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
8894
8895         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
8896
8897         * parameter.cs (ComputeParameterTypes,
8898         ComputeAndDefineParameterTypes): Better error handling: now we
8899         clear the `types' cache if we fail during any of the type lookups.
8900         We also return the status code correctly to our caller
8901
8902         * delegate.cs: If we fail to define a delegate, abort the extra
8903         steps. 
8904
8905         * expression.cs (Binary.ResolveOperator): for
8906         operator==(object,object) and operator !=(object, object) we also
8907         have to verify that there is an implicit conversion from one to
8908         the other.
8909
8910         (ArrayAccess.DoResolve): Array Access can operate on
8911         non-variables. 
8912
8913 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
8914
8915         * assign.cs (CompoundAssign): A new class used as a "flag" that
8916         the assignment actually is happening as part of a compound
8917         assignment operator.
8918
8919         During compound assignment, a few new rules exist to enable things
8920         like:
8921
8922         byte b |= 1 + 2
8923
8924         From the spec:
8925
8926         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
8927         to the type of x) if y is implicitly convertible to the type of x,
8928         and the operator is a builtin operator and the return type of the
8929         operator is explicitly convertible to the type of x. 
8930
8931         * rootcontext.cs: Reset warning level to 2.  4 catches various
8932         "interesting" features in mcs, we must clean this up at some
8933         point, but currently am trying to kill other bugs ;-)
8934
8935         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
8936         in container classes as well.  
8937
8938         * expression.cs (Binary.ResolveOperator): Handle string case
8939         before anything else (as operator overloading does emit an error
8940         before doing anything else).
8941
8942         This code could go away when we move to a table driven model, but
8943         i could not come up with a good plan last night.
8944
8945 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
8946
8947         * typemanager.cs (CSharpName): reimplementation using regex.
8948         * class.cs: added null check for fields in Emit
8949         * rootcontext.cs: set warninglevel to 4
8950
8951 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
8952
8953         * typemanager.cs (CSharpName): reimplemented with Lupus
8954         suggestion.
8955
8956 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
8957
8958         * statement.cs (If): correclty implement Resolve, because we were
8959         not catching sem errors in there.  The same process is needed
8960         everywhere else. 
8961         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
8962
8963
8964         (Statement.Warning_DeadCodeFound): Factorize code.
8965         (While): Report dead code here too.
8966
8967         (Statement): Added Resolve virtual method to allow
8968         for resolution split from the emit code.
8969
8970 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
8971
8972         * statement.cs (EmitBoolExpression): No longer try to resolve the
8973         expression here.    
8974         (MakeBoolean): New utility function that resolve, implicitly
8975         converts to boolean and tags the expression. 
8976
8977
8978         (If, Do): Implement dead code elimination.
8979         (While): Implement loop inversion
8980
8981         (Do, While, For, If): Resolve the expression prior to calling our
8982         code generation.
8983
8984 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
8985
8986         * class.cs:
8987           - added method Report28 (warning: program has more than one entry point)
8988           - added method IsEntryPoint, implements paragraph 10.1 of the spec
8989           - modified method Method.Define, the part at the end of the method
8990
8991         * rootcontext.cs: added static public Location EntryPointLocation;
8992           
8993         * ../errors/cs0028.cs : Add test case for the above warning.              
8994
8995         * typemanager.cs:
8996           - modified method CSharpName to allow arrays of primitive type to
8997             be printed nicely (e.g. instead of System.Int32[][] it now prints
8998             int[][])
8999           - added method CSharpSignature: returns the signature of a method
9000             in string format to be used in reporting errors, warnings, etc.
9001
9002         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
9003         with String.Empty.
9004
9005 2002-04-26  Ravi Pratap  <ravi@ximian.com>
9006
9007         * delegate.cs (Define): Fix extremely silly bug where I was
9008         setting the type of the 'object' parameter of the BeginInvoke
9009         method to System.IAsyncResult instead of System.Object ;-)
9010
9011 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
9012
9013         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
9014         here. 
9015
9016         (Constructor.Emit): return if we fail to initialize the
9017         constructor.  Another door closed!  
9018
9019         * expression.cs (New.DoResolve): Improve error message (from -6 to
9020         1501).  Use DeclaredOnly lookup to find the exact constructor.
9021
9022         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
9023         loop.  This is useful.
9024
9025         * cs-parser.jay: Adjust the default parameters so that destructors
9026         have the proper signature.
9027
9028 2002-04-26  Martin Baulig  <martin@gnome.org>
9029
9030         * driver.cs (LoadAssembly): If `assembly' contains any characters
9031         which are only valid in path names and not in assembly names
9032         (currently slash, backslash and point), use Assembly.LoadFrom ()
9033         instead of Assembly.Load () on the `assembly' (before iteration
9034         over the link_paths).
9035
9036 2002-04-26  Martin Baulig  <martin@gnome.org>
9037
9038         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
9039
9040 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
9041
9042         * class.cs (Property): use the new typemanager.MemberLookup
9043
9044         (TypeContainer.MemberLookup): Implement using the
9045         TypeManager.MemberLookup now. 
9046
9047         * typemanager.cs: Make MemberLookup a function of the TypeManager,
9048         and return MemberInfos, so that these can be used without an
9049         EmitContext (what we had before).
9050
9051 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
9052
9053         * expression.cs: Fix the case where the argument to params if the
9054         type of the params.  I omitted handling this before.   Fixed
9055
9056 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
9057
9058         * driver.cs: Call BootCorlib_PopulateCoreType
9059
9060         * class.cs (Property.CheckBase): Check for properties only, not
9061         for all members. 
9062
9063         * interface.cs: Temporary hack: try/catch around the
9064         CustomAttributeBuilder, because I am getting an exception that I
9065         do not understand.
9066
9067         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
9068         types whose definitions are required to be there (attributes are
9069         defined before standard types).
9070
9071         Compute definitions as we boot the various types, as they are used
9072         immediately (value_type class will need object_type, but if we do
9073         not initialize object_type, we will pass a null, which will let
9074         the runtime pick the System.Object from the existing corlib, which
9075         is not what we want).
9076
9077 2002-04-22  Patrik Torstensson <totte@labs2.com>
9078
9079         * cs-tokenizer.cs: fixed a number of trim() issues.
9080
9081 2002-04-22  Ravi Pratap  <ravi@ximian.com>
9082
9083         * expression.cs (Argument.Type): Ensure that we return the correct
9084         type when we have out or ref parameters [in which case we 
9085         append a "&"].
9086
9087 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
9088
9089         * class.cs (Property, Indexer): Allow extern modifier in there. 
9090
9091         * typemanager.cs (InitBaseTypes): Initializes object_type and
9092         value_type, since those will be used early on during the bootstrap
9093         process to compile corlib.
9094
9095         (InitCoreTypes): Move code from here to InitBaseTypes.
9096
9097 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
9098
9099         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
9100         single-dimension arrays as using the ldlen opcode.  
9101
9102         Daniel Lewis discovered this optimization.  
9103
9104         * typemanager.cs: Add signature for System.Array::get_Length
9105
9106 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9107
9108         * statement.cs: report the error when the foreach does not apply to an
9109         array nor a collection.
9110
9111 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
9112
9113         * expression.cs: Add implicit conversions to the operator ~.
9114
9115         * constant.cs (DecimalConstant.Emit): Emit decimal value.
9116
9117         * typemanager.cs: Locate the decimal constructor.
9118
9119 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9120
9121         * attribute.cs: use the new property of TypeOf.
9122         * expression.cs: added 'get' property around typearg.
9123
9124         These changes fix a build breaker reported by NickD. Is this the
9125         correct way to fix?  If not, please, revert my changes and make it
9126         work :-).
9127
9128 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
9129
9130         * attribute.cs: Add support for typeof in attribute invocations.
9131         I am not sure that this is right though.
9132
9133 2002-04-14  Duncan Mak  <duncan@ximian.com>
9134
9135         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
9136         Binary.Operator.Division case.
9137
9138 2002-04-13  Ravi Pratap  <ravi@ximian.com>
9139
9140         * class.cs (DefineType): Ensure that we do a proper check on
9141         attribute types and also register it with the TypeManager.
9142
9143         (TypeContainer.Targets): The default for attribute types is
9144         AttributeTargets.All.
9145
9146         * attribute.cs (ApplyAttributes): Registering the attribute type
9147         is done elsewhere, not when we discover we have a Usage attribute.
9148
9149 2002-04-12  Ravi Pratap  <ravi@ximian.com>
9150
9151         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
9152         and get rid of is_delegate parameter.
9153
9154         * everywhere : update.
9155
9156 2002-04-12  Ravi Pratap  <ravi@ximian.com>
9157
9158         * cs-parser.jay (compilation_unit): Revamp completely to use
9159         some new ideas that I got from Rhys' grammar to solve the problems
9160         with assembly level attributes.
9161
9162         (outer_declaration): New grammar production.
9163
9164         (attribute_sections): Add.
9165
9166         (opt_attributes): Base on attribute_sections
9167
9168         (namespace_declaration): Allow opt_attributes to tackle the case
9169         when we have assembly level attributes - we are clever in this
9170         regard now ;-)
9171
9172         * attribute.cs (ApplyAttributes): Do not worry about assembly 
9173         attributes in the non-global context.
9174
9175         * rootcontext.cs (AddGlobalAttributes): Go back to using this
9176         instead of SetGlobalAttributes.
9177
9178         * class.cs, rootcontext.cs : Ensure we define and generate 
9179         attribute types before anything else.
9180
9181         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
9182         and flag the new error -20 for the case when the attribute type
9183         does not have valid targets specified. csc does not catch this.
9184
9185         * ../errors/errors.txt : update for error # -20
9186
9187 2002-04-11  Ravi Pratap  <ravi@ximian.com>
9188
9189         * support.cs (InternalParameters.ParameterModifier): Do some null
9190         checking and return sane values.
9191
9192         * class.cs (Method.Define): If we are a PInvoke method, ensure
9193         that we are static and extern. Report error # 601
9194
9195         * ../errors/cs0601.cs : Add test case for the above error.
9196
9197 2002-04-07  Ravi Pratap  <ravi@ximian.com>
9198
9199         * rootcontext.cs (attribute_types): We need to keep type of
9200         all attribute types separately and emit code for them first.
9201
9202         (RegisterAttribute) : Implement.
9203
9204         * class.cs (DefineType): Check if the current Type is a custom
9205         attribute type and register it accordingly.
9206
9207         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
9208         adding the first attribute twice and rename to
9209
9210         (SetGlobalAttributes): this.
9211
9212         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
9213         lookups.
9214
9215         * attribute.cs (ApplyAttributes): Take an additional argument telling us
9216         if we are processing global arguments. Hmm, I am unsure of this.
9217
9218 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9219
9220         * expression.cs: added static array of strings to avoid calling
9221         Enum.ToString () for Operator in Binary. Significant recover of
9222         performance.
9223
9224 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
9225
9226         * class.cs (FindMembers): Allow the Builders of the various
9227         members to be null.  If they are skip them.  This only happens
9228         during the PInvoke declaration.
9229
9230 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
9231
9232         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
9233         failure, so we do not keep going afterwards.
9234
9235         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
9236         wanted to pass `false' as the `is_delegate' argument.  If this is
9237         the case, why not use delegate_type == null to mean `is_delegate =
9238         false' and anything else as is_delegate = true.
9239
9240 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
9241
9242         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
9243         code for the section, not the beginning of the tests.
9244
9245 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
9246
9247         * cfold.cs: Handle operator + (Enum x, Underlying x) 
9248
9249         * expression.cs (Binary): same.  Warn about errors where we have
9250         Enum/Enum in operator + as well.
9251
9252 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
9253
9254         * statement.cs:
9255                 - added support for switch(bool)
9256                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
9257                 - add TableSwitchEmit() to handle table-based switch statements
9258
9259 2002-04-05  Ravi Pratap  <ravi@ximian.com>
9260
9261         * expression.cs (Invocation.OverloadResolve): Factor out code which
9262         does parameter compatibility checking with arguments so that we can 
9263         re-use the code even from Delegate.VerifyApplicability
9264
9265         (VerifyArgumentsCompat): Move above code here.
9266
9267         * delegate.cs (VerifyApplicability): Get rid of duplicate code
9268         and instead make a call to the above method.
9269
9270 2002-03-31  Ravi Pratap  <ravi@ximian.com>
9271
9272         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
9273         We use it to keep track of classes which are attribute types.
9274
9275 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
9276
9277         * delegate.cs (Delegate.Define): Correctly define the types in the
9278         presence of fixed and array parameters.
9279
9280         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
9281         doing FindMembers.
9282
9283         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
9284         include NonPublic after the first iteration.
9285
9286         * class.cs (Indexer.CheckBase): Only check if both parents are
9287         non-null. 
9288
9289         * cs-parser.jay (accessor_body): If empty, set to null.
9290
9291         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
9292         same code path here to resolve constants names that we did have in
9293         MemberAccess.DoResolve.  There is too much code duplicated here.
9294
9295 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
9296
9297         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
9298
9299         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
9300         to MakeUnionSet.
9301
9302         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
9303         tokens, numbers and strings.
9304
9305         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
9306         parenthesis.
9307
9308         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
9309         asyncronous parameters and the regular parameters.  
9310
9311         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
9312         specify the target directory.
9313
9314         * expression.cs: (This.DoResolve): Simplify
9315         (As.Emit): Optimize, do not generate IsInst if the expression is
9316         always of the given type.
9317
9318         (Is.DoResolve): Bug fix, we were reporting both always/never for
9319         the is expression.
9320
9321         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
9322         creating too many unnecessary arrays.
9323
9324 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * class.cs (EmitFieldInitializer): Use Assign expression to assign
9327         fields instead of rolling our own initializer.   Takes care of all
9328         implicit conversions, and drops unnecessary static checks/argument.
9329
9330 2002-03-31  Dick Porter  <dick@ximian.com>
9331
9332         * driver.cs: use the GetDirectories() return values properly, and
9333         use "/" as path separator.
9334
9335 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * expression.cs (Unary): Optimize - - expr into expr.
9338         (Binary): Optimize a + (-b) into a -b.
9339
9340         * codegen.cs (CodeGen): Made all methods static.
9341
9342 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
9343
9344         * rootcontext.cs: 
9345
9346         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
9347         TypeBuilder property.
9348
9349         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
9350         instead. 
9351
9352         * tree.cs: Removed the various RecordXXXX, and replaced with a
9353         single RecordDecl.  Removed all the accessor methods, and just
9354         left a single access point Type 
9355
9356         * enum.cs: Rename DefineEnum to DefineType.
9357
9358         * decl.cs: New abstract method `DefineType' used to unify the
9359         Defines for Enumerations, Interfaces, TypeContainers and
9360         Delegates.
9361
9362         (FindType): Moved LookupInterfaceOrClass here.  Moved the
9363         LookupBaseClasses method that used to live in class.cs and
9364         interface.cs here, and renamed to FindType.
9365
9366         * delegate.cs: Implement DefineType.  Take advantage of the
9367         refactored pattern for locating the parent builder without taking
9368         the parent_builder argument (which we know does not work if we are
9369         nested, and triggering a toplevel definition).
9370
9371 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
9372
9373         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
9374         accessibility of a member has changed during override and report
9375         an error if so.
9376
9377         * class.cs (Method.Define, Property.Define): Only complain on
9378         overrides if the method is private, any other accessibility is
9379         fine (and since we just checked the permission is the same, we are
9380         good to go).
9381
9382         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
9383         and elif are processed always.  The other pre-processing
9384         directives are only processed if we are "taking" the path
9385
9386 2002-03-29  Martin Baulig  <martin@gnome.org>
9387
9388         * class.cs (Method.Emit): Only emit symbolic debugging info if the
9389         current location is not Null.
9390
9391         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
9392         a separate method so we can profile it.
9393
9394         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
9395         `span.Seconds' are just seconds, but no minutes or hours.
9396         (MainDriver): Profile the CodeGen.SaveSymbols calls.
9397
9398 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
9401         Remove the gratuitous set of Final:
9402
9403                                 // If an interface implementation, then we can set Final.
9404                                 if (((flags & MethodAttributes.Abstract) == 0) &&
9405                                     implementing.DeclaringType.IsInterface)
9406                                         flags |= MethodAttributes.Final;
9407
9408         I do not know what I was smoking when I used that.
9409
9410
9411         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
9412         step into fixing the name resolution issues for delegates and
9413         unifying the toplevel name resolution.
9414
9415 2002-03-28  Martin Baulig  <martin@gnome.org>
9416
9417         * class.cs (Method.Emit): If we have a symbol writer, call its
9418         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
9419         tell it about the current method.
9420
9421         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
9422         writer that we're going to emit the first byte of IL code for a new
9423         statement (a new source line).
9424         (EmitContext.EmitTopBlock): If we have a symbol writer, call
9425         EmitContext.Mark() before emitting any code.
9426
9427         * location.cs (SymbolDocument): Return null when we're Null.
9428
9429         * statement.cs (Statement): Moved the `Location loc' variable here.
9430         (Statement.EmitBoolExpression): If we have a symbol writer, call
9431         ec.Mark() before emitting any code to tell it that we're at the
9432         beginning of a new statement.
9433         (StatementExpression): Added `Location' argument to the constructor.
9434         (Block): Added public readonly variable `StartLocation' and public
9435         variable `EndLocation'.  The latter is to be set using SetEndLocation().
9436         (Block): Added constructor which takes a start and end location.
9437         (Block.SetEndLocation): New method. This sets the end location.
9438         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
9439         local variables we create.
9440         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
9441         each statement and do also mark the begin and end of the block.
9442
9443         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
9444         tell it the current lexer.Location, use Location.Null for the end of the
9445         block.
9446         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
9447         current block, set its end location using SetEndLocation().
9448         (statement_expression): StatementExpression constructor now takes the
9449         lexer.Location as additional argument.
9450         (for_statement, declare_local_variables): Likewise.
9451         (declare_local_variables): When creating a new implicit block, use the
9452         new Block constructor and pass it the lexer.Location.
9453
9454 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
9455
9456         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
9457         members also on the parent interfaces recursively.
9458
9459 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
9460
9461         * report.cs: Use new formats, since Gonzalo finished the missing
9462         bits. 
9463
9464         * expression.cs (Binary.ResolveOperator): added missing operator|
9465         operator& and operator^ for bool/bool.
9466
9467         * cs-parser.jay: CheckDef now takes a Location argument that is
9468         used to report errors more precisly (instead of reporting the end
9469         of a definition, we try to track something which is a lot closer
9470         to the source of the problem).
9471
9472         * cs-tokenizer.cs: Track global token use, so we can properly flag
9473         the use of #define/#undef after the first token has been seen.
9474
9475         Also, rename the reportXXXX to Error_DescriptiveName
9476
9477         * decl.cs (DeclSpace.IsTopLevel): Move property here from
9478         TypeContainer, so that Enum and Interface can use this too.
9479
9480         * class.cs (TypeContainer.LookupInterfaceOrClass,
9481         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
9482         `builder' argument.  Typically this was used to pass the parent
9483         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
9484         the definition).  
9485
9486         The problem is that a nested class could trigger the definition of
9487         a toplevel class, and the builder would be obviously wrong in that
9488         case. 
9489
9490         So we drop this argument, and we compute dynamically the
9491         TypeBuilder/ModuleBuilder (the correct information was available
9492         to us anyways from DeclSpace.Parent)
9493
9494         * interface.cs (Interface.DefineInterface): Drop builder
9495         parameter cleanup like class.cs
9496
9497         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
9498         like class.cs
9499
9500         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
9501         values. 
9502
9503         (Try.Emit): Propagate the returns value from the statement.
9504
9505         (Return.Emit): Even if we are leavning 
9506
9507         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
9508
9509         * modifiers.cs: Fix the computation of MethodAttributes flags.
9510
9511 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
9512
9513         * driver.cs: allow compilation of files that start with '/'.
9514         Add a default case when checking the argument of --target.
9515
9516 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
9517
9518         * interface.cs: Implement the same search algorithm for types in
9519         the interface code.
9520
9521         * delegate.cs: Do not allow multiple definition.
9522
9523         * Recovered ChangeLog that got accidentally amputated
9524
9525         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
9526
9527         * rootcontext.cs: Load manually enum to allow core classes to
9528         contain enumerations.
9529
9530         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
9531         Update to new static methods in TypeManager.
9532
9533         * typemanager.cs (GetMethod, GetConstructor): Use our
9534         implementation of FindMembers to find the members, since during
9535         corlib compilation, the types are TypeBuilders and GetMethod and
9536         GetConstructor do not work.
9537
9538         Make all methods in TypeManager static.
9539
9540         (InitCodeHelpers): Split the functionality from
9541         the InitCodeTypes function.
9542
9543         * driver.cs: Call InitCodeHelpers after we have populated the
9544         types. 
9545
9546         * cs-parser.jay (delegate_declaration): we did not used to compute
9547         the delegate name correctly for void delegates.
9548
9549 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
9550
9551         * rootcontext.cs (RootContext): Init the interface_resolve_order
9552         and type_container_resolve_order always.
9553
9554         (ResolveCore, BootstrapCorlib_ResolveClass,
9555         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
9556         compiler when compiling with --nostdlib
9557
9558         * class.cs (TypeContainer.DefineType): Check that our parent is
9559         not null.  This test is most important when we are bootstraping
9560         the core types.
9561
9562         * codegen.cs: Split out the symbol writing code.
9563
9564 2002-03-25  Martin Baulig  <martin@gnome.org>
9565
9566         * driver.cs (-g): Made -g an alias for --debug.
9567
9568 2002-03-24  Martin Baulig  <martin@gnome.org>
9569
9570         * codegen.cs (SymbolWriter): New public variable. Returns the
9571         current symbol writer.
9572         (CodeGen): Added `bool want_debugging_support' argument to the
9573          constructor. If true, tell the ModuleBuild that we want debugging
9574         support and ask it for the ISymbolWriter.
9575         (Save): If we have a symbol writer, call it's Close() method after
9576         saving the assembly.
9577
9578         * driver.c (--debug): New command line argument to create a
9579         debugger information file.
9580
9581         * location.cs (SymbolDocument): New public property. Returns an
9582         ISymbolDocumentWriter object for the current source file or null
9583         if we don't have a symbol writer.
9584
9585 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
9586
9587         * driver.cs (LoadAssembly): Correctly return when all the paths
9588         have been tried and not before.
9589
9590         * statement.cs (Switch.Emit): return the actual coverage for this
9591         statement (returns/not-returns)
9592
9593         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
9594         switch of the statement if we are the last switch section.  That
9595         kills two problems: try/catch problems (we used to emit an empty
9596         nop at the end) and switch statements where all branches would
9597         return. 
9598
9599 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
9600
9601         * driver.cs: Add default assemblies (the equivalent to the
9602         Microsoft CSC.RSP file)
9603
9604         * cs-tokenizer.cs: When updating `cols and setting it to zero,
9605         also update tokens_seen and set it to false.
9606
9607         * driver.cs: Implement --recurse for Mike.
9608
9609         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
9610         correctly splitting out the paths.
9611
9612 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
9613
9614         * interface.cs (Interface.PopulateProperty): Instead of using
9615         `parent' as the declaration space for the set parameters, use
9616         `this' 
9617
9618         * support.cs (InternalParameters): InternalParameters constructor
9619         takes a DeclSpace instead of a TypeContainer.
9620
9621         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
9622         types are being initialized, load the address of it before calling
9623         the function.  
9624
9625         (New): Provide a mechanism to disable the generation of local
9626         value type temporaries when the caller will be providing us with
9627         an address to store it.
9628
9629         (ArrayCreation.EmitDynamicInitializers): Use it.
9630
9631 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * expression.cs (Invocation.EmitArguments): Only probe for array
9634         property if there is more than one argument.  Sorry about that.
9635
9636         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
9637         empty param arrays.
9638
9639         * class.cs (Method.LabelParameters): Fix incorrect code path that
9640         prevented the `ParamArrayAttribute' from being applied to the
9641         params attribute.
9642
9643 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
9644
9645         * support.cs (ReflectionParameters): Correctly compute whether the
9646         last argument is a params array.  Fixes the problem with
9647         string.Split ('a')
9648
9649         * typemanager.cs: Make the assemblies array always be non-null
9650         (empty, but non-null)
9651
9652         * tree.cs (RecordDecl): New function that abstracts the recording
9653         of names.  This reports error 101, and provides a pointer to the
9654         previous declaration.  Fixes a crash in the compiler.
9655
9656         * cs-parser.jay (constructor_declaration): Update to new grammar,
9657         and provide a constructor_body that can be empty.
9658
9659 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
9660
9661         * driver.cs: Add support for --resources.
9662
9663         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
9664         Make all types for the various array helper methods be integer.
9665
9666         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
9667         CheckState to ConvCast.
9668
9669         (ConvCast): Now it takes a `checked' state argument, to avoid
9670         depending on the emit context for the conversion, and just using
9671         the resolve time setting.
9672
9673         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
9674         instead of Invocation.EmitArguments.  We do not emit the original
9675         arguments, instead we emit those which have been converted to
9676         unsigned int expressions.
9677
9678         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
9679
9680         * codegen.cs: ditto.
9681
9682         * expression.cs (LocalVariableReference): Drop the use of the
9683         Store function that depended on the variable index.
9684
9685         * statement.cs (VariableInfo): Drop the `Idx' property from this
9686         class, as this is not taking into account the indexes for
9687         temporaries tat we generate during the execution, getting the
9688         indexes wrong.
9689
9690         * class.cs: First emit class initializers, then call the parent
9691         constructor. 
9692
9693         * expression.cs (Binary): Fix opcode emision.
9694         (UnaryMutator.EmitCode): Support checked code generation
9695
9696         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
9697         matches for events for both the Static and Instance scans,
9698         pointing to the same element.   Fix that.
9699
9700 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
9701
9702         * rootcontext.cs (ResolveTree): Always set the
9703         interface_resolve_order, because nested interfaces will be calling
9704         into us.
9705
9706         * class.cs (GetInterfaceOrClass): Track the same resolution
9707         process used by TypeManager.LookupType.  This fixes the nested
9708         type lookups in class declarations (separate path from
9709         LookupType). 
9710
9711         (TypeContainer.DefineType): Also define nested interfaces.
9712         (TypeContainer.RegisterOrder): New public function used to
9713         register the order in which child interfaces need to be closed.
9714
9715         Nested interfaces need to be closed after their parents have been
9716         created. 
9717
9718         * interface.cs (InterfaceAttr): Put all the logic for computing
9719         the interface attribute here. 
9720
9721         (DefineInterface): Register our interface order with the
9722         RootContext or with the TypeContainer depending on the case.
9723
9724 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
9725
9726         * cs-parser.jay: rework foreach statement to work with the new
9727         changes to the policy on SimpleNames.
9728
9729         * report.cs: support Stacktrace on warnings as well.
9730
9731         * makefile: drop --unsafe and /unsafe from the compile.
9732
9733 2002-03-13  Ravi Pratap  <ravi@ximian.com>
9734
9735         * ecore.cs (StandardConversionExists): Modify to take an Expression
9736         as the first parameter. Ensure we do null -> reference type conversion
9737         checking.
9738
9739         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
9740         temporary Expression objects.
9741
9742 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
9743
9744         * interface.cs: workaround bug in method overloading resolution
9745         (there is already a bugzilla bug for it).
9746
9747 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
9748
9749         We could also solve this problem by having a separate path for
9750         performing type lookups, instead of DoResolve, we could have a
9751         ResolveType entry point, and only participating pieces of the
9752         production (simplename, deref, array) would implement this. 
9753
9754         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
9755         signal SimpleName to only resolve type names and not attempt to
9756         resolve anything else.
9757
9758         * expression.cs (Cast): Set the flag.
9759
9760         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
9761
9762         * class.cs: Only report 108 if there is no `new' modifier.
9763
9764         * cs-parser.jay: rework foreach statement to work with the new
9765         changes to the policy on SimpleNames.
9766
9767         * report.cs: support Stacktrace on warnings as well.
9768
9769         * makefile: drop --unsafe and /unsafe from the compile.
9770
9771 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
9772
9773         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
9774         lookups here, instead of doing that at parse time.  This means
9775         that our grammar will not introduce `LocalVariableReferences' as
9776         expressions at this point.  That solves the problem of code like
9777         this:
9778
9779         class X {
9780            static void Main ()
9781            { int X = 1;
9782             { X x = null }}}
9783
9784         This is only half the fix.  The full fix requires parameters to
9785         also be handled in this way.
9786
9787         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
9788         makes the use more obvious of the DeclSpace.  The
9789         ec.TypeContainer.TypeBuilder is now only used to pull the
9790         TypeBuilder for it.
9791
9792         My theory is that I can get rid of the TypeBuilder completely from
9793         the EmitContext, and have typecasts where it is used (from
9794         DeclSpace to where it matters).  
9795
9796         The only pending problem is that the code that implements Aliases
9797         is on TypeContainer, and probably should go in DeclSpace.
9798
9799         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
9800         lookups here, instead of doing that at parse time.  This means
9801         that our grammar will not introduce `LocalVariableReferences' as
9802         expressions at this point.  That solves the problem of code like
9803         this:
9804
9805         class X {
9806            static void Main ()
9807            { int X = 1;
9808             { X x = null }}}
9809
9810         This is only half the fix.  The full fix requires parameters to
9811         also be handled in this way.
9812
9813         * class.cs (Property.DefineMethod): When implementing an interface
9814         method, set newslot, when implementing an abstract method, do not
9815         set the flag (before we tried never setting it, or always setting
9816         it, which is the difference).
9817         (Indexer.DefineMethod): same.
9818         (Method.DefineMethod): same.
9819
9820         * ecore.cs: Only set the status used flag if we get back a Field.
9821
9822         * attribute.cs: Temporary hack, so Paolo can keep working.
9823
9824 2002-03-08  Ravi Pratap  <ravi@ximian.com>
9825
9826         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
9827         the unmanaged type in the case we have a MarshalAs attribute.
9828
9829         (Resolve): Handle the case when we are parsing the special MarshalAs
9830         attribute [we need to store the unmanaged type to use later]
9831
9832         * typemanager.cs (marshal_as_attr_type): Built in type for the 
9833         MarshalAs Attribute.
9834
9835         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
9836         on parameters and accordingly set the marshalling info.
9837
9838 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
9839
9840         * class.cs: Optimizing slightly by removing redundant code after
9841         we switched to the `NoTypes' return value.
9842         (Property.DefineMethod): use NoTypes here too.
9843
9844         This fixes the bug I introduced in my last batch of changes.
9845
9846 2002-03-05  Ravi Pratap  <ravi@ximian.com>
9847
9848         * tree.cs (RecordEnum): Add. We now keep track of enums too.
9849
9850         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
9851         Enums since those are types too. 
9852
9853         * cs-parser.jay (enum_declaration): Record enums as we parse them.
9854
9855         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
9856         thanks to a call during the lookup process.
9857
9858 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
9859
9860         * statement.cs (Foreach): Lots of work to accomodate a particular
9861         kind of foreach statement that I had not kept in mind.  It is
9862         possible to have foreachs on classes that provide a GetEnumerator
9863         method that return objects that implement the "pattern" for using
9864         a foreach, there is no need to support GetEnumerator
9865         specifically. 
9866
9867         This is needed to compile nant.
9868
9869         * decl.cs: Only report 114 if the member is not `Finalize' and if
9870         the warning level is at least 2.
9871
9872         * class.cs: Moved the compare function from Method to
9873         MethodSignature. 
9874
9875         (MethodSignature.InheritableMemberSignatureCompare): Add new
9876         filter function that is used to extract inheritable methods from a
9877         class. 
9878
9879         (Method.Define): Use the new `inheritable_method_signature_filter'
9880         delegate
9881
9882         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
9883         command. 
9884
9885 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
9886
9887         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
9888
9889         * cs-parser.jay: Add opt_semicolon to the interface declaration.
9890
9891         * expression.cs: Pass location information to
9892         ConvertImplicitStandard. 
9893
9894         * class.cs: Added debugging code to track return values from
9895         interfaces. 
9896
9897 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
9898
9899         * expression.cs (Is.DoResolve): If either side of the `is' is an
9900         interface, do not flag the warning.
9901
9902         * ecore.cs (ImplicitReferenceConversion): We need a separate test
9903         for interfaces
9904
9905         * report.cs: Allow for --fatal to be used with --probe.
9906
9907         * typemanager.cs (NoTypes): Move the definition for the empty Type
9908         array here. 
9909
9910         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
9911         properties. 
9912         (TypeContainer.DefineProxy): New function used to proxy to parent
9913         implementations when implementing interfaces.
9914         (TypeContainer.ParentImplements): used to lookup if our parent
9915         implements a public function that is required by an interface.
9916         (TypeContainer.VerifyPendingMethods): Hook this up.
9917
9918         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
9919         `modules' and `assemblies' arraylists into arrays.  We only grow
9920         these are the very early start up of the program, so this improves
9921         the speedof LookupType (nicely measured).
9922
9923         * expression.cs (MakeByteBlob): Replaced unsafe code with
9924         BitConverter, as suggested by Paolo.
9925
9926         * cfold.cs (ConstantFold.Binary): Special case: perform constant
9927         folding of string concatenation, but if either side is a string,
9928         and the other is not, then return null, and let the runtime use
9929         the concatenation on the string plus the object (using
9930         `Object.ToString'). 
9931
9932 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
9933
9934         Constant Folding has been implemented now.
9935
9936         * expression.cs (Unary.Reduce): Do not throw an exception, catch
9937         the error instead on types that are not supported in one's
9938         complement. 
9939
9940         * constant.cs (Constant and all children): New set of functions to
9941         perform implict and explicit conversions.
9942
9943         * ecore.cs (EnumConstant): Implement the new functions to perform
9944         conversion by proxying to the child expression.
9945
9946         * codegen.cs: (ConstantCheckState): Constant evaluation has its
9947         own separate setting that can not be turned off from the command
9948         line using --unchecked or --checked and is only controlled using
9949         the checked/unchecked statements and expressions.  This setting is
9950         used by the constant folder to flag errors.
9951
9952         * expression.cs (CheckedExpr, UncheckedExpr): Set the
9953         ConstantCheckState as well.   
9954
9955         During Resolve, they also have to flag the state, because the
9956         constant folder runs completely in the Resolve phase.
9957
9958         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
9959         well.
9960
9961 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
9962
9963         * cfold.cs: New file, this file contains the constant folder.
9964
9965         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
9966         argument to track whether we are using the resulting address to
9967         load or store a value and provide better error messages. 
9968
9969         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
9970         new AddressOf arguments.
9971
9972         * statement.cs (Foreach.EmitCollectionForeach): Update
9973
9974         * expression.cs (Argument.Emit): Call AddressOf with proper
9975         arguments to track usage.
9976
9977         (New.DoEmit): Call AddressOf with new arguments.
9978
9979         (Unary.Emit): Adjust AddressOf call.
9980
9981 2002-03-01  Ravi Pratap  <ravi@ximian.com>
9982
9983         * cs-parser.jay (member_access): Change the case for pre-defined types
9984         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
9985         this suggestion.
9986
9987         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
9988         a method body.
9989
9990         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
9991         essentially like methods and apply attributes like MethodImplOptions to them too.
9992
9993         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
9994         not being null.
9995
9996         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
9997         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
9998         is the DeclSpace.
9999
10000         * Update code everywhere accordingly.
10001
10002         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
10003
10004         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
10005
10006 2002-02-28  Ravi Pratap  <ravi@ximian.com>
10007
10008         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
10009         try performing lookups against those instead of jumping straight into using
10010         the 'using' clauses.
10011
10012         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
10013
10014         (LookupType): Perform lookups in implicit parents too.
10015
10016         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
10017         sequence as RootContext.LookupType. 
10018
10019         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
10020         the various cases of namespace lookups into this method.
10021
10022 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
10023
10024         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
10025         in positional arguments)
10026
10027         * class.cs (Operator): Update the AllowedModifiers to contain
10028         extern. 
10029
10030         * cs-parser.jay: Update operator declaration to allow for the
10031         operator body to be empty.
10032
10033         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
10034         values. 
10035
10036 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
10037
10038         * class.cs (Method.Emit): Label parameters.
10039
10040         * driver.cs: Return 1 or 0 as the program exit code.
10041
10042 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
10043
10044         * expression.cs: Special case the `null' object when trying to
10045         auto-compute the type, as anything can be explicitly converted to
10046         that. 
10047
10048         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
10049         spotting this Paolo.
10050
10051         (Expression.ImplicitNumericConversion): Perform comparissions of
10052         the type using the underlying type in the case of an enumeration
10053         rather than using the enumeration type for the compare.
10054
10055         Cope with the underlying == type case, which is not possible to
10056         catch before. 
10057
10058         (Expression.ConvertNumericExplicit): Perform comparissions of
10059         the type using the underlying type in the case of an enumeration
10060         rather than using the enumeration type for the compare.
10061
10062         * driver.cs: If the user does not supply an extension, assume .exe
10063
10064         * cs-parser.jay (if_statement): Rewrote so that we can track the
10065         location for the if statement.
10066
10067         * expression.cs (Binary.ConstantFold): Only concat strings when
10068         the operation is "+", not everything ;-)
10069
10070         * statement.cs (Statement.EmitBoolExpression): Take a location
10071         argument. 
10072         (If, While, Do): Track location.
10073
10074         * expression.cs (Binary.ResolveOperator): In the object + string
10075         case, I was missing a call to ConvertImplicit
10076
10077 2002-02-25  Ravi Pratap  <ravi@ximian.com>
10078
10079         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
10080         Location arguments. Ensure we use RootContext.LookupType to do our work
10081         and not try to do a direct Type.GetType and ModuleBuilder.GetType
10082
10083         * interface.cs (PopulateMethod): Handle the type of the parameter being
10084         null gracefully.
10085
10086         * expression.cs (Invocation.BetterFunction): Handle the case when we 
10087         have a params method with no fixed arguments and a call is made with no
10088         arguments.
10089
10090 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
10091
10092         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
10093         the verbatim-string-literal
10094
10095         * support.cs (InternalParameters.ParameterModifier): handle null
10096         fixed parameters.
10097         (InternalParameters.ParameterType): ditto.
10098
10099         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
10100         duplicating the name of the variable parameter.
10101         (GetParameterByName): Fix bug where we were not looking up array
10102         paramters if they were the only present (thanks Paolo!).
10103         (GetParameterInfo): We only have an empty set of types if both
10104         fixed and array are set to null.
10105         (GetParameterInfo-idx): Handle FixedParameter == null
10106
10107         * cs-parser.jay: Handle the case where there is no catch
10108         statements (missing null test).
10109
10110 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
10111
10112         * driver.cs (MainDriver): Be conservative on our command line
10113         handling.
10114
10115         Catch DirectoryNotFoundException when calling GetFiles.
10116
10117         (SplitPathAndPattern): Used to split the input specification into
10118         a path and a pattern that we can feed to Directory.GetFiles.
10119
10120 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
10121
10122         * statement.cs (Fixed): Implement the last case of the Fixed
10123         statement (string handling).
10124
10125         * expression.cs (StringPtr): New class used to return a char * to
10126         a string;  Used by the Fixed statement.
10127
10128         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
10129
10130         * expression.cs (Binary.ResolveOperator): Remove redundant
10131         MemberLookup pn parent type.
10132         Optimize union call, we do not need a union if the types are the same.
10133         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
10134         type.
10135
10136         Specialize the use of MemberLookup everywhere, instead of using
10137         the default settings. 
10138
10139         (StackAlloc): Implement stackalloc keyword.
10140
10141         * cs-parser.jay: Add rule to parse stackalloc.
10142
10143         * driver.cs: Handle /h, /help, /?
10144
10145         * expression.cs (MakeByteBlob): Removed the hacks we had in place
10146         before we supported unsafe code.
10147
10148         * makefile: add --unsafe to the self compilation of mcs.
10149
10150 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
10151
10152         * expression.cs (PointerArithmetic): New class that is used to
10153         perform pointer arithmetic.
10154         (Binary.Resolve): Handle pointer arithmetic
10155         Handle pointer comparission.
10156         (ArrayPtr): Utility expression class that is used to take the
10157         address of an array.
10158
10159         (ElementAccess): Implement array access for pointers
10160
10161         * statement.cs (Fixed): Implement fixed statement for arrays, we
10162         are missing one more case before we are done.
10163
10164         * expression.cs (Indirection): Implement EmitAssign and set the
10165         ExprClass to Variable.  This allows pointer dereferences to be
10166         treated as variables, and to have values assigned to them.
10167
10168         * ecore.cs (Expression.StoreFromPtr): New utility function to
10169         store values dereferencing.
10170
10171 2002-02-20  Ravi Pratap  <ravi@ximian.com>
10172
10173         * expression.cs (Binary.ResolveOperator): Ensure that we are
10174         not trying to operate on a void type - this fixes the reported
10175         bug.
10176
10177         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
10178         the parent implementation is sealed.
10179
10180         * ../errors/cs0239.cs : Add.
10181
10182         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
10183
10184         * typemanager.cs (unverifiable_code_type): Corresponds to 
10185         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
10186         which have unsafe code in them.
10187
10188         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
10189         unsafe context.
10190
10191 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
10192
10193         * cs-tokenizer.cs: Add support for @"litreal strings"
10194
10195         Make tokenizer accept pre-processor directives
10196         on any column (remove the old C-like limitation). 
10197
10198         * rootcontext.cs (EmitCode): Emit any global attributes.
10199         (AddGlobalAttributes): Used to keep track of assembly attributes. 
10200
10201         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
10202
10203         * cs-parser.jay: Add support for global attributes.  
10204
10205 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * expression.cs (Indirection): New helper class.  Unary will
10208         create Indirection classes to be able to implement the
10209         IMemoryLocation interface on it.
10210
10211 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
10212
10213         * cs-parser.jay (fixed_statement): reference the right statement.
10214
10215         * statement.cs (Fixed.Emit): Finish implementing the fixed
10216         statement for the &x case.
10217
10218 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
10219
10220         * class.cs (Property.Define, Method.Define): Remove newslot when
10221         `implementing'.  
10222
10223         * modifiers.cs: My use of NewSlot when `Abstract' was set was
10224         wrong.  NewSlot should only be used if the `new' keyword is present.
10225
10226         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
10227         locating our system dir.  Sorry about this.
10228
10229 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
10230
10231         * driver.cs (GetSystemDir): Compute correctly the location of our
10232         system assemblies.  I was using the compiler directory instead of
10233         the library directory.
10234
10235 2002-02-13  Ravi Pratap  <ravi@ximian.com>
10236
10237         * expression.cs (BetterFunction): Put back in what Miguel commented out
10238         since it is the correct fix. The problem is elsewhere ;-)
10239
10240         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
10241         parameters of the parms method are themselves compatible or not !
10242
10243         (StandardConversionExists): Fix very dangerous bug where we were forgetting
10244         to check that a class implements an interface before saying that an implicit
10245         conversion was allowed. Use ImplementsInterface to do the checking.
10246
10247 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
10248
10249         * class.cs (Method.Define): Track whether we are an explicit
10250         implementation or not.  And only call DefineMethodOverride if we
10251         are an explicit implementation.
10252
10253         (Property.DefineMethod): Ditto.
10254
10255 2002-02-11  Ravi Pratap  <ravi@ximian.com>
10256
10257         * expression.cs (BetterFunction): Catch hideous bug which was
10258          preventing us from detecting ambiguous calls due to implicit casts i.e
10259         cs0121.
10260
10261 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * support.cs (Pair): Remove un-needed method.  I figured why I was
10264         getting the error in cs-parser.jay, the variable in a foreach loop
10265         is readonly, and the compiler does not really treat this as a variable.
10266
10267         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
10268         instead of EQUALS in grammar.  
10269
10270         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
10271
10272         * expression.cs (Unary.DoResolve): Check whether the argument is
10273         managed or not.
10274
10275 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
10276
10277         * support.cs: Api for Pair to set a value.  Despite the fact that
10278         the variables are public the MS C# compiler refuses to compile
10279         code that accesses the field if the variable is part of a foreach
10280         statement. 
10281
10282         * statement.cs (Fixed): Begin implementation of the fixed
10283         statement.
10284
10285         (Block.AddVariable): Return the VariableInfo on success and null
10286         on failure instead of true/false. 
10287
10288         * cs-parser.jay (foreach): Catch errors on variables already
10289         defined (we were ignoring this value before) and properly unwind
10290         the block hierarchy
10291
10292         (fixed_statement): grammar for the fixed statement.
10293
10294 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
10295
10296         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
10297         pointer types to be incretemented.
10298
10299         (SizeOf): Implement.
10300
10301         * cs-parser.jay (pointer_member_access): Implement
10302         expr->IDENTIFIER production.
10303
10304         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
10305         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
10306         on safe contexts.
10307
10308         (Unary): Implement indirection.
10309
10310         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
10311         use in non-unsafe context).
10312
10313         (SimpleName.DoResolve): Check for pointers in field access on safe
10314         contexts. 
10315
10316         (Expression.LoadFromPtr): Factor the load-indirect code in this
10317         function.  This was duplicated in UnboxCast and ParameterReference
10318
10319 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
10320
10321         * expression.cs (ComposedCast): report an error if a pointer cast
10322         is used in a safe region.
10323
10324         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
10325         pointer type casts in unsafe context.
10326
10327         * codegen.cs (EmitContext): Set up IsUnsafe.
10328
10329         * cs-parser.jay (non_expression_type): Add productions for pointer
10330         casts. 
10331
10332         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
10333         code.  We should not use force into static mode if the method is
10334         not virtual.  Fixes bug in MIS
10335
10336         * statement.cs (Do.Emit, While.Emit, For.Emit,
10337         Statement.EmitBoolExpression): Add support to Do and While to
10338         propagate infinite loop as `I do return' semantics.
10339
10340         Improve the For case to also test for boolean constants.
10341
10342         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
10343         to the list of attributes we can add.
10344
10345         Remove `EmitContext' argument.
10346
10347         * class.cs (Method.Define): Apply parameter attributes.
10348         (Constructor.Define): Apply parameter attributes.
10349         (MethodCore.LabelParameters): Move here the core of labeling
10350         parameters. 
10351
10352         * support.cs (ReflectionParameters.ParameterModifier,
10353         InternalParameters.ParameterModifier): Use IsByRef on the type and
10354         only return the OUT bit for these parameters instead of in/out/ref
10355         flags.
10356
10357         This is because I miss-understood things.  The ParameterInfo.IsIn
10358         and IsOut represent whether the parameter has the [In] and [Out]
10359         attributes set.  
10360
10361 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
10362
10363         * ecore.cs (FieldExpr.Emit): Release temporaries.
10364
10365         * assign.cs (LocalTemporary.Release): new function.
10366
10367         * codegen.cs (EmitContext.GetTemporaryStorage,
10368         EmitContext.FreeTemporaryStorage): Rework the way we deal with
10369         temporary storage.  Now we can "put back" localbuilders when we
10370         are done with them
10371
10372 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
10373
10374         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
10375         need to make a copy of the variable to generate verifiable code.
10376
10377 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * driver.cs: Compute dynamically the system directory.
10380
10381         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
10382         Slower, but more generally useful.  Used by the abstract
10383         registering implementation. 
10384
10385         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
10386         the rules for the special rule on Type/instances.  First check if
10387         we have the same name, and if so, try that special static path
10388         rather than the instance path.
10389
10390 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
10391
10392         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
10393         for, while and if.
10394
10395         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
10396         Enum, ValueType, Delegate or Array for non-corlib compiles.
10397
10398         * cs-tokenizer.cs: Catch long identifiers (645)
10399
10400         * typemanager.cs (IndexerPropetyName): Ravi never tested this
10401         piece of code.
10402
10403         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
10404         fix, we were returning too early, so we were not registering
10405         pending methods from abstract classes.
10406
10407         Do not register pending methods if the class is abstract.
10408
10409         * expression.cs (Conditional.DoResolve): Report circular implicit
10410         conversions when we neecd to compute it for conditional
10411         expressions. 
10412
10413         (Is.DoResolve): If the expression is always of the provided type,
10414         flag warning 183.  If the expression can not ever be of the
10415         provided type flag warning 184.
10416
10417         * class.cs: Catch 169 as well.
10418
10419         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
10420         read. 
10421
10422 2002-01-18  Nick Drochak  <ndrochak@gol.com>
10423
10424         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
10425
10426 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
10427
10428         * interface.cs: (PopulateMethod): Check for pointers being defined
10429         only if the unsafe context is active.
10430         (PopulateProperty): ditto.
10431         (PopulateIndexer): ditto.
10432
10433         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
10434         specified.  If pointers are present, make sure that they are
10435         present in an unsafe context.
10436         (Constructor, Constructor.Define): ditto.
10437         (Field, Field.Define): ditto.
10438         (Property, Property.Define): ditto.
10439         (Event, Event.Define): ditto.
10440
10441         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
10442         hashtable if there are classes or structs defined.
10443
10444         * expression.cs (LocalVariableReference.DoResolve): Simplify this
10445         code, as the constant resolution moved.
10446
10447         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
10448         the metadata, so we can flag error 133. 
10449
10450         * decl.cs (MemberCore.UnsafeOK): New function to test that a
10451         pointer is being declared in an unsafe context.
10452
10453 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * modifiers.cs (Modifiers.Check): Require a Location argument.
10456         Report error 227 for Unsafe use.
10457
10458         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
10459
10460         * statement.cs (For.Emit): If the test is null, then report that
10461         we do `return', as we wont reach anything afterwards.
10462
10463         (Switch.SwitchGoverningType): Track the expression that matched
10464         the conversion.
10465
10466         * driver.cs: Allow negative numbers as an error code to flag.
10467
10468         * cs-parser.jay: Handle 1551.
10469
10470         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
10471
10472 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
10473
10474         * cs-parser.jay: Report 1518 (type declaration can only contain
10475         class, struct, interface, enum or delegate)
10476
10477         (switch_label): Report 1523 (keywords `case' or `default' must
10478         preced code)
10479
10480         (opt_switch_sections): Report 1522 (empty switch)
10481
10482         * driver.cs: Report 1515 (response file specified multiple times)
10483         Report 1516 (Source file specified multiple times).
10484
10485         * expression.cs (Argument.Resolve): Signal 1510
10486
10487         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
10488         access not allowed in static code)
10489
10490 2002-01-11  Ravi Pratap  <ravi@ximian.com>
10491
10492         * typemanager.cs (IsPointerType): Utility method which we are going
10493         to need a lot.
10494
10495         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
10496         the object type, so we take care of that.
10497
10498         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
10499
10500         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
10501         added to non-params parameters :-)
10502
10503         * typemanager.cs (CSharpName): Include 'void' type too. 
10504
10505         (void_ptr_type): Include in the set of core types.
10506
10507         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
10508         duplicating code.
10509
10510         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
10511         an unsafe context.
10512
10513         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
10514         completely forgotten about it.
10515
10516 2002-01-10  Ravi Pratap  <ravi@ximian.com>
10517
10518         * cs-parser.jay (pointer_type): Add. This begins our implementation
10519         of parsing rules for unsafe code.
10520
10521         (unsafe_statement): Implement.
10522
10523         (embedded_statement): Modify to include the above.
10524
10525         * statement.cs (Unsafe): Implement new class for unsafe blocks.
10526
10527         * codegen.cs (EmitContext.InUnsafe): Add. This determines
10528         if the current context is an unsafe one.
10529
10530         * cs-parser.jay (local_variable_pointer_type): Since local variable types
10531         are handled differently, we need separate rules for them.
10532
10533         (local_variable_declaration): Update to use local_variable_pointer_type
10534         to allow variable declarations of unmanaged pointer types.
10535
10536         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
10537         in unsafe contexts.
10538
10539         * ../errors/cs0214.cs : Add.
10540
10541 2002-01-16  Nick Drochak  <ndrochak@gol.com>
10542
10543         * makefile: remove 'response' file when cleaning.
10544
10545 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
10546
10547         * cs-parser.jay: Report 1524.
10548
10549 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
10550
10551         * typemanager.cs (RegisterMethod): drop checking if we have
10552         registered this from here
10553
10554 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
10555
10556         * class.cs (Method.EmitDestructor): Implement calling our base
10557         destructor. 
10558
10559         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
10560         value of InFinally.
10561
10562         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
10563         this routine and will wrap the call in a try/catch block.  Deal
10564         with the case.
10565
10566 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
10567
10568         * ecore.cs (Expression.MemberLookup): instead of taking a
10569         parameter `same_type' that was used to tell whether we could
10570         access private members we compute our containing type from the
10571         EmitContext.
10572
10573         (FieldExpr): Added partial support for volatile fields.  This does
10574         not work for volatile fields exposed from assemblies, as I can not
10575         figure out how to extract the modreq from it.
10576
10577         Updated all the source files to use this.
10578
10579         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
10580         because it is referenced by MemberLookup very often. 
10581
10582 2002-01-09  Ravi Pratap  <ravi@ximian.com>
10583
10584         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
10585         TypeBuilder.GetCustomAttributes to retrieve what we need.
10586
10587         Get rid of redundant default_member_attr_type as this is the same as
10588         default_member_type which already exists.
10589
10590         * interface.cs, attribute.cs : Update accordingly.
10591
10592 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
10593
10594         * typemanager.cs: Enable IndexerPropertyName again.  It does not
10595         work for TYpeBuilders though.  Ravi, can you please fix this?
10596
10597         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
10598
10599         * expression.cs (Argument.Emit): Handle the case of ref objects
10600         being passed to ref functions;  
10601
10602         (ParameterReference.EmitLoad): Loads the content of the pointer
10603         without dereferencing.
10604
10605 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
10606
10607         * cs-tokenizer.cs: Implemented the pre-processing expressions.
10608
10609 2002-01-08  Ravi Pratap  <ravi@ximian.com>
10610
10611         * class.cs (Indexer.DefineMethod): Incorporate the interface
10612         type in the name of the method if we are doing explicit interface
10613         implementation.
10614
10615         * expression.cs (ConversionExists): Remove as it is completely obsolete.
10616
10617         (BetterConversion): Fix extremely trivial bug where we were referring to
10618         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
10619         again !
10620
10621         * ../errors/bug16.cs : Add although we have fixed it.
10622
10623 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
10624
10625         * expression.cs (BaseIndexer): Begin implementation.
10626
10627         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
10628
10629         * cs-parser.jay (indexer_declarator): Use qualified_identifier
10630         production directly to remove a shift/reduce, and implement
10631         explicit interface implementation.
10632
10633         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
10634         after a floating point suffix.
10635
10636         * expression.cs (DoNumericPromotions): Improved the conversion for
10637         uint/uint.  If we have a constant, we avoid doing a typecast to a
10638         larger type.
10639
10640         * class.cs (Indexer): Implement explicit interface implementation
10641         for indexers.
10642
10643 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
10644
10645         * class.cs: make the default instance constructor public and hidebysig.
10646
10647 2001-01-03  Ravi Pratap  <ravi@ximian.com>
10648
10649         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
10650         so we can call it from elsewhere.
10651
10652         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
10653         we emit it internally if the class has a defined indexer; otherwise the user
10654         emits it by decorating the class definition with the DefaultMemberAttribute.
10655
10656         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
10657         attribute is not used on a type which defines an indexer.
10658
10659         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
10660         character when we skip whitespace.
10661
10662         * ../errors/cs0646.cs : Add.
10663
10664 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
10665
10666         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
10667         again. 
10668
10669         * makefile: Add practical target `mcs3.exe' which builds the third
10670         generation compiler. 
10671
10672         * expression.cs (New): Fix structures constructor calling.
10673
10674         * class.cs (Property, Method, Indexer): Emit Final flag on the
10675         method if we are an interface implementation and we are not
10676         abstract. 
10677
10678         * ecore.cs (PropertyExpr): New public field `IsBase', tells
10679         whether this property is referencing a `base' method.
10680
10681         * expression.cs (Invocation.EmitCall): take an extra argument:
10682         is_base, this is used to determine whether the `call' or
10683         `callvirt' opcode should be used.
10684
10685
10686         * delegate.cs: update EmitCall.
10687
10688         * class.cs (Method.Define): Set NewSlot for the cases where we are
10689         not implementing an interface method.
10690
10691         (Property.Define): ditto.
10692
10693 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
10696         'r'.  Allows mcs to parse itself fully.
10697
10698 2002-01-02  Ravi Pratap  <ravi@ximian.com>
10699
10700         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
10701         of the number of initializers that require the InitializeArray method.
10702
10703         (CheckIndices): Store the Expression in all cases - not the plain value. Also
10704         update the above field where necessary.
10705
10706         (MakeByteBlob): Update accordingly.
10707
10708         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
10709         greater than 2.
10710
10711         (EmitDynamicInitializers): Update in accordance with the new optimization.
10712
10713         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
10714         same OpCode applies.
10715
10716         * cs-parser.jay : Fix some glaring errors I introduced.
10717
10718 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
10719
10720         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
10721         so that we can check for name clashes there too.
10722
10723         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
10724         for interface indexers.
10725
10726         * interfaces.cs (Define): Emit the default member attribute.
10727
10728         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
10729         variable was being referred to while setting the value ;-)
10730
10731 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
10732
10733         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
10734         byte-by-byte information when we know the data is zero.
10735
10736         Make the block always a multiple of 4, because
10737         DefineInitializedData has a bug.
10738
10739         * assign.cs: Fix, we should assign from the temporary, not from
10740         the source. 
10741
10742         * expression.cs (MakeByteBlob): Fix my incorrect code.
10743
10744 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
10745
10746         * typemanager.cs (EnumToUnderlying): This function is used to get
10747         the underlying type from an enumeration, because it does not
10748         always work. 
10749
10750         * constant.cs: Use the I4_S form for values between -128 and 127.
10751
10752         * statement.cs (Block.LookupLabel): Looks up a label.
10753         (Block): Drop support for labeled blocks.
10754
10755         (LabeledStatement): New kind of statement that represents a label
10756         only.
10757
10758         (Goto): Finally implement this bad boy.
10759
10760         * cs-parser.jay: Update to reflect new mechanism to implement
10761         labels.
10762
10763 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
10764
10765         * codegen.cs (EmitContext.This): a codegen property that keeps the
10766         a single instance of this instead of creating many different this
10767         instances. 
10768
10769         * delegate.cs (Delegate.DoResolve): Update to use the property;
10770
10771         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
10772
10773         * expression.cs (BaseAccess.DoResolve): Ditto.
10774
10775 2001-12-29  Ravi Pratap  <ravi@ximian.com>
10776
10777         * typemanager.cs (methodimpl_attr_type): Add to hold the type
10778         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
10779
10780         (InitCoreTypes): Update accordingly.
10781
10782         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
10783         so we can quickly store the state.
10784
10785         (ApplyAttributes): Set the correct implementation flags
10786         for InternalCall methods.
10787
10788 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
10789
10790         * expression.cs (EmitCall): if a method is not virtual, then do
10791         not use callvirt on it.
10792
10793         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
10794         user defined stuff) requires the use of stobj, which takes an
10795         address on the stack instead of an array and an index.  So emit
10796         the Ldelema operation for it.
10797
10798         (EmitStoreOpcode): Use stobj for valuetypes.
10799
10800         (UnaryMutator.EmitCode): Use the right 1 value depending on
10801         whether we are dealing with int64/uint64, float or doubles.
10802
10803         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
10804         constructors that I implemented last night.
10805
10806         (Constructor.IsDefault): Fix to work properly for static
10807         constructors.
10808
10809         * cs-parser.jay (CheckDef): report method signature errors.
10810         Update error number 103 to be 132.
10811
10812         * decl.cs: New AdditionResult enumeration value: MethodExists.
10813         Although we do this check for methods later on in the semantic
10814         analysis, catching repeated default constructors is so easy that
10815         we catch these here. 
10816
10817         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
10818         promotions code.
10819
10820         (ParameterReference.EmitAssign, Emit): handle
10821         bools as bytes.
10822
10823         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
10824         (ArrayAccess.EmitStoreOpcode): ditto.
10825
10826         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
10827
10828         * expression.cs (MakeByteBlob): Complete all the missing types
10829         (uint, short, ushort, byte, sbyte)
10830
10831         * class.cs: Only init instance field initializers on instance
10832         constructors. 
10833
10834         Rename `constructors' to instance_constructors. 
10835
10836         (TypeContainer.AddConstructor): Only add constructors to the list
10837         if it is not static.
10838
10839         Make sure that we handle default_static_constructor independently
10840         everywhere where we handle instance_constructors
10841
10842 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * class.cs: Do not lookup or create a base initializer for a
10845         static constructor.
10846
10847         (ConstructorInitializer.Resolve): use the proper type to lookup
10848         for constructors.
10849
10850         * cs-parser.jay: Report error 1585 (modifiers between type and name).
10851
10852         * enum.cs, interface.cs: Remove CloseType, this is taken care by
10853         in DeclSpace. 
10854
10855         * decl.cs: CloseType is now an virtual method, the default
10856         implementation just closes this type.
10857
10858 2001-12-28  Ravi Pratap  <ravi@ximian.com>
10859
10860         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
10861         to PreserveSig by default. Also emit HideBySig on such methods.
10862
10863         Basically, set the defaults to standard values.
10864
10865         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
10866         argument, if candidate is better, it can't be worse than the best !
10867
10868         (Invocation): Re-write bits to differentiate between methods being
10869         applicable in their expanded form and their normal form - for params
10870         methods of course.
10871
10872         Get rid of use_standard everywhere as only standard conversions are allowed
10873         in overload resolution. 
10874
10875         More spec conformance.
10876
10877 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
10878
10879         * driver.cs: Add --timestamp, to see where the compiler spends
10880         most of its time.
10881
10882         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
10883         `this' in static code.
10884
10885         (SimpleName.DoResolve): Implement in terms of a helper function
10886         that allows static-references to be passed upstream to
10887         MemberAccess.
10888
10889         (Expression.ResolveWithSimpleName): Resolve specially simple
10890         names when called by MemberAccess to implement the special
10891         semantics. 
10892
10893         (Expression.ImplicitReferenceConversion): Handle conversions from
10894         Null to reference types before others, as Null's type is
10895         System.Object. 
10896
10897         * expression.cs (Invocation.EmitCall): Handle the special case of
10898         calling methods declared on a reference type from a ValueType
10899         (Base classes System.Object and System.Enum)
10900
10901         (MemberAccess.Resolve): Only perform lookups on Enumerations if
10902         the left hand side is a TypeExpr, not on every enumeration. 
10903
10904         (Binary.Resolve): If types are reference types, then do a cast to
10905         object on operators != and == of both arguments.
10906
10907         * typemanager.cs (FindMembers): Extract instance and static
10908         members if requested.
10909
10910         * interface.cs (PopulateProperty): Use void_type instead of null
10911         as the return type for the setter method.
10912
10913         (PopulateIndexer): ditto.
10914
10915 2001-12-27  Ravi Pratap  <ravi@ximian.com>
10916
10917         * support.cs (ReflectionParameters): Fix minor bug where we
10918         were examining the wrong parameter for the ParamArray attribute.
10919
10920         Cope with requests for the type of the parameter at position
10921         greater than the params parameter's. We now return the element
10922         type of the params array as that makes more sense.
10923
10924         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
10925         accordingly as we no longer have to extract the element type
10926         ourselves.
10927
10928         (Invocation.OverloadResolve): Update.
10929
10930 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
10931
10932         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
10933         against IEnumerator, test whether the return value is a descendant
10934         of the IEnumerator interface.
10935
10936         * class.cs (Indexer.Define): Use an auxiliary method to implement
10937         the other bits of the method definition.  Begin support for
10938         explicit interface implementation.
10939
10940         (Property.DefineMethod): Use TypeManager.void_type instead of null
10941         for an empty return value.
10942
10943 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
10944
10945         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
10946         dealing with a FieldExpr which is composed of a FieldBuilder, in
10947         the code path we did extract the constant, but we should have
10948         obtained the underlying value to be able to cast it (otherwise we
10949         end up in an infinite loop, this is what Ravi was running into).
10950
10951         (ArrayCreation.UpdateIndices): Arrays might be empty.
10952
10953         (MemberAccess.ResolveMemberAccess): Add support for section
10954         14.5.4.1 that deals with the special case of E.I when E is a type
10955         and something else, that I can be a reference to a static member.
10956
10957         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
10958         handle a particular array type to create byte blobs, it is just
10959         something we dont generate byteblobs for.
10960
10961         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
10962         arguments. 
10963
10964         * location.cs (Push): remove the key from the hashtable that we
10965         are about to add.   This happens for empty files.
10966
10967         * driver.cs: Dispose files after we have parsed them.
10968
10969         (tokenize): new function that only runs the tokenizer on its
10970         input, for speed testing.
10971
10972 2001-12-26  Ravi Pratap  <ravi@ximian.com>
10973
10974         * class.cs (Event.Define): Define the private field only if there
10975         are no accessors defined.
10976
10977         * expression.cs (ResolveMemberAccess): If there is no associated
10978         field with the event, that means we have an event defined with its
10979         own accessors and we should flag error cs0070 since transforming
10980         ourselves into a field is not valid in that case.
10981
10982         * ecore.cs (SimpleName.DoResolve): Same as above.
10983
10984         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
10985         and charset to sane values.
10986
10987 2001-12-25  Ravi Pratap  <ravi@ximian.com>
10988
10989         * assign.cs (DoResolve): Perform check on events only if they 
10990         are being accessed outside the declaring type.
10991
10992         * cs-parser.jay (event_declarations): Update rules to correctly
10993         set the type of the implicit parameter etc.
10994
10995         (add_accessor, remove_accessor): Set current local parameters.
10996
10997         * expression.cs (Binary): For delegate addition and subtraction,
10998         cast the return value from the method into the appropriate delegate
10999         type.
11000
11001 2001-12-24  Ravi Pratap  <ravi@ximian.com>
11002
11003         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
11004         of these as the workaround is unnecessary.
11005
11006         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
11007         delegate data - none of that is needed at all.
11008
11009         Re-write bits to extract the instance expression and the delegate method
11010         correctly.
11011
11012         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
11013         on delegates too.
11014
11015         * attribute.cs (ApplyAttributes): New method to take care of common tasks
11016         of attaching attributes instead of duplicating code everywhere.
11017
11018         * everywhere : Update code to do attribute emission using the above method.
11019
11020 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
11021
11022         * expression.cs (IsParamsMethodApplicable): if there are not
11023         parameters, return immediately.
11024
11025         * ecore.cs: The 0 literal can be implicity converted to an enum
11026         type. 
11027
11028         (SimpleName.DoResolve): First lookup the type, then lookup the
11029         members. 
11030
11031         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
11032         want to get its address.  If the InstanceExpression is not
11033         addressable, store the result in a temporary variable, then get
11034         the address of it.
11035
11036         * codegen.cs: Only display 219 errors on warning level or above. 
11037
11038         * expression.cs (ArrayAccess): Make it implement the
11039         IMemoryLocation interface.
11040
11041         (Binary.DoResolve): handle the operator == (object a, object b)
11042         and operator != (object a, object b) without incurring into a
11043         BoxedCast (because 5 != o should never be performed).
11044
11045         Handle binary enumerator operators.
11046
11047         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
11048         value type, otherwise use Ldelem_ref.
11049
11050         Use precomputed names;
11051
11052         (AddressOf): Implement address of
11053
11054         * cs-parser.jay (labeled_statement): Fix recursive block
11055         addition by reworking the production.
11056
11057         * expression.cs (New.DoEmit): New has a special case:
11058                 
11059                  If we are dealing with a ValueType, we have a few
11060                  situations to deal with:
11061                 
11062                     * The target of New is a ValueType variable, that is
11063                       easy, we just pass this as the variable reference
11064                 
11065                     * The target of New is being passed as an argument,
11066                       to a boxing operation or a function that takes a
11067                       ValueType.
11068                 
11069                       In this case, we need to create a temporary variable
11070                       that is the argument of New.
11071
11072
11073 2001-12-23  Ravi Pratap  <ravi@ximian.com>
11074
11075         * rootcontext.cs (LookupType): Check that current_type is not null before
11076         going about looking at nested types.
11077
11078         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
11079         not implement the IAssignMethod interface any more.
11080
11081         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
11082         where we tranform them into FieldExprs if they are being resolved from within
11083         the declaring type.
11084
11085         * ecore.cs (SimpleName.DoResolve): Do the same here.
11086
11087         * assign.cs (DoResolve, Emit): Clean up code considerably. 
11088
11089         * ../errors/bug10.cs : Add.
11090
11091         * ../errors/cs0070.cs : Add.
11092
11093         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
11094
11095         * assign.cs : Get rid of EventIsLocal everywhere.
11096
11097 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
11098
11099         * ecore.cs (ConvertIntLiteral): finished the implementation.
11100
11101         * statement.cs (SwitchLabel): Convert the value we are using as a
11102         key before looking up the table.
11103
11104 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * codegen.cs (EmitTopBlock): Require a Location argument now.
11107
11108         * cs-parser.jay (constructor_declarator): We need to setup
11109         current_local_parameters before we parse the
11110         opt_constructor_initializer, to allow the variables to be bound
11111         to the constructor arguments.
11112
11113         * rootcontext.cs (LookupType): First lookup nested classes in our
11114         class and our parents before we go looking outside our class.
11115
11116         * expression.cs (ConstantFold): Extract/debox the values at the
11117         beginnning. 
11118
11119         * rootcontext.cs (EmitCode): Resolve the constants first before we
11120         resolve the types.  This is not really needed, but it helps debugging.
11121
11122         * statement.cs: report location.
11123
11124         * cs-parser.jay: pass location to throw statement.
11125
11126         * driver.cs: Small bug fix.
11127
11128         * report.cs: Updated format to be 4-zero filled digits.
11129
11130 2001-12-22  Ravi Pratap  <ravi@ximian.com>
11131
11132         * expression.cs (CheckIndices): Fix minor bug where the wrong
11133         variable was being referred to ;-)
11134
11135         (DoEmit): Do not call EmitStaticInitializers when the 
11136         underlying type is System.Object.
11137
11138 2001-12-21  Ravi Pratap  <ravi@ximian.com>
11139
11140         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
11141         and do the usual workaround for SRE.
11142
11143         * class.cs (MyEventBuilder.EventType): New member to get at the type
11144         of the event, quickly.
11145
11146         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
11147
11148         * assign.cs (Assign.DoResolve): Handle the case when the target
11149         is an EventExpr and perform the necessary checks.
11150
11151         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
11152         interface.
11153
11154         (SimpleName.MemberStaticCheck): Include check for EventExpr.
11155
11156         (EventExpr): Set the type in the constructor itself since we 
11157         are meant to be born fully resolved.
11158
11159         (EventExpr.Define): Revert code I wrote earlier.
11160                 
11161         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
11162         instance expression is null. The instance expression is a This in that case
11163         or a null, depending on whether it is a static method or not.
11164
11165         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
11166         refers to more than one method.
11167
11168         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
11169         and accordingly flag errors.
11170
11171 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
11172
11173         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
11174
11175 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
11176
11177         * location.cs (ToString): Provide useful rutine.
11178
11179 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
11180
11181         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
11182         objects, return the actual integral boxed.
11183
11184         * statement.cs (SwitchLabel): define an ILLabel for each
11185         SwitchLabel. 
11186
11187         (Switch.CheckSwitch): If the value is a Literal, extract
11188         the underlying literal.
11189
11190         Also in the unused hashtable we had, add the SwitchLabel so we can
11191         quickly look this value up.
11192
11193         * constant.cs: Implement a bunch of new constants.  Rewrite
11194         Literal based on this.  Made changes everywhere to adapt to this.
11195
11196         * expression.cs (Expression.MakeByteBlob): Optimize routine by
11197         dereferencing array only once, and also copes with enumrations.
11198
11199         bytes are two bytes wide, not one.
11200
11201         (Cast): Perform constant conversions.
11202
11203         * ecore.cs (TryImplicitIntConversion): Return literals instead of
11204         wrappers to the literals here.
11205
11206         * expression.cs (DoNumericPromotions): long literals can converted
11207         to ulong implicity (this is taken care of elsewhere, but I was
11208         missing this spot).
11209
11210         * ecore.cs (Expression.Literalize): Make the return type Literal,
11211         to improve type checking.
11212
11213         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
11214
11215 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
11216
11217         * literal.cs: Revert code from ravi that checked the bounds.  The
11218         bounds are sane by the definition of the type itself. 
11219
11220         * typemanager.cs: Fix implementation of ImplementsInterface.  We
11221         need to actually look up in our parent hierarchy for interfaces
11222         implemented. 
11223
11224         * const.cs: Use the underlying type for enumerations
11225
11226         * delegate.cs: Compute the basename for the delegate creation,
11227         that should fix the delegate test case, and restore the correct
11228         Type Lookup semantics in rootcontext
11229
11230         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
11231         referencing a nested type with the Reflection API is using the "+"
11232         sign. 
11233
11234         * cs-parser.jay: Do not require EOF token at the end.
11235
11236 2001-12-20  Ravi Pratap  <ravi@ximian.com>
11237
11238         * rootcontext.cs (LookupType): Concatenate type names with
11239         a '.' instead of a '+' The test suite passes again.
11240
11241         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
11242         field of the enumeration.
11243
11244         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
11245         the case when the member is an EventExpr.
11246
11247         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
11248         static has an associated instance expression.
11249
11250         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
11251
11252         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
11253
11254         * class.cs (Event.Define): Register event and perform appropriate checks
11255         for error #111.
11256
11257         We define the Add and Remove methods even if the use provides none because
11258         in that case, we provide default implementations ourselves.
11259
11260         Define a private field of the type of the event. This is done by the CSC compiler
11261         and we should be doing it too ;-)
11262
11263         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
11264         More methods we use in code we generate.
11265
11266         (multicast_delegate_type, delegate_type): Two separate types since the distinction
11267         is important.
11268
11269         (InitCoreTypes): Update accordingly for the above.
11270
11271         * class.cs (Event.Emit): Generate code for default accessors that we provide
11272
11273         (EmitDefaultMethod): Do the job in the above.
11274
11275         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
11276         appropriate place.
11277
11278 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
11279
11280         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
11281         builders even if we were missing one.
11282
11283         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
11284         pass the Basename as our class name instead of the Name.  The
11285         basename will be correctly composed for us.
11286
11287         * parameter.cs (Paramters): Now takes a Location argument.
11288
11289         * decl.cs (DeclSpace.LookupType): Removed convenience function and
11290         make all the code call directly LookupType in RootContext and take
11291         this chance to pass the Location information everywhere.
11292
11293         * Everywhere: pass Location information.
11294
11295 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
11296
11297         * class.cs (Constructor.Define): Updated way of detecting the
11298         length of the parameters.
11299
11300         (TypeContainer.DefineType): Use basename as the type name for
11301         nested types.
11302
11303         (TypeContainer.Define): Do not recursively define types here, as
11304         definition is taken care in order by the RootContext.
11305
11306         * tree.cs: Keep track of namespaces in a per-file basis.
11307
11308         * parameter.cs (Parameter.ComputeSignature): Update to use
11309         DeclSpace. 
11310
11311         (Parameters.GetSignature): ditto.
11312
11313         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
11314         instead of a TypeContainer.
11315
11316         (Interface.SemanticAnalysis): Use `this' instead of our parent to
11317         resolve names.  Because we need to be resolve in our context, not
11318         our parents.
11319
11320         * driver.cs: Implement response files.
11321
11322         * class.cs (TypeContainer.DefineType): If we are defined, do not
11323         redefine ourselves.
11324
11325         (Event.Emit): Emit the code for add/remove handlers.
11326         (Event.Define): Save the MethodBuilders for add/remove.
11327
11328         * typemanager.cs: Use pair here too.
11329
11330         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
11331         DictionaryEntry requires the first argument to be non-null.  
11332
11333         (enum_declaration): Compute full name for registering the
11334         enumeration.
11335
11336         (delegate_declaration): Instead of using
11337         formal_parameter_list, use opt_formal_parameter_list as the list
11338         can be empty.
11339
11340         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
11341         (EventParsing): New property that controls whether `add' and
11342         `remove' are returned as tokens or identifiers (for events);
11343
11344 2001-12-19  Ravi Pratap  <ravi@ximian.com>
11345
11346         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
11347         use MyEventBuilder only and let it wrap the real builder for us.
11348
11349         (MyEventBuilder): Revamp constructor etc.
11350
11351         Implement all operations that we perform on EventBuilder in precisely the same
11352         way here too.
11353
11354         (FindMembers): Update to use the EventBuilder member.
11355
11356         (Event.Emit): Update accordingly.
11357
11358 2001-12-18  Ravi Pratap  <ravi@ximian.com>
11359
11360         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
11361         by calling the appropriate methods.
11362
11363         (GetCustomAttributes): Make stubs as they cannot possibly do anything
11364         useful.
11365
11366         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
11367
11368 2001-12-17  Ravi Pratap  <ravi@ximian.com>
11369
11370         * delegate.cs (Delegate.Populate): Check that the return type
11371         and various parameters types are indeed accessible.
11372
11373         * class.cs (Constructor.Define): Same here.
11374
11375         (Field.Define): Ditto.
11376
11377         (Event.Define): Ditto.
11378
11379         (Operator.Define): Check that the underlying Method defined itself
11380         correctly - so it's MethodBuilder should not be null.
11381
11382         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
11383         expression happens to be null.
11384
11385         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
11386         members but as of now we don't seem to be able to do anything really useful with it.
11387
11388         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
11389         not the EventBuilder.
11390
11391 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
11392
11393         * cs-tokenizer.cs: Add support for defines.
11394         Add support for #if, #elif, #else, #endif
11395
11396         (eval_var): evaluates a variable.
11397         (eval): stubbed for evaluating functions.
11398
11399         * cs-parser.jay: Pass the defines information
11400
11401         * driver.cs: Add --define command line option.
11402
11403         * decl.cs: Move MemberCore here.
11404
11405         Make it the base class for DeclSpace.  This allows us to catch and
11406         report 108 and 109 for everything now.
11407
11408         * class.cs (TypeContainer.Define): Extract all the members
11409         before populating and emit the warning 108 (new keyword required
11410         to override) instead of having each member implement this.
11411
11412         (MemberCore.Define): New abstract method, we will be using this in
11413         the warning reporting engine in Populate.
11414
11415         (Operator.Define): Adjust to new MemberCore protocol. 
11416
11417         * const.cs (Const): This does not derive from Expression, it is a
11418         temporary object we use to create fields, it is a MemberCore. 
11419
11420         * class.cs (Method.Define): Allow the entry point to be in a
11421         specific class.
11422
11423         * driver.cs: Rewrite the argument handler to clean it up a bit.
11424
11425         * rootcontext.cs: Made it just an auxiliary namespace feature by
11426         making everything static.
11427
11428         * driver.cs: Adapt code to use RootContext type name instead of
11429         instance variable.
11430
11431         * delegate.cs: Remove RootContext argument.
11432
11433         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
11434         argument. 
11435
11436         * class.cs (Event.Define): The lookup can fail.
11437
11438         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
11439
11440         * expression.cs: Resolve the this instance before invoking the code.
11441
11442 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
11443
11444         * cs-parser.jay: Add a production in element_access that allows
11445         the thing to become a "type" reference.  This way we can parse
11446         things like "(string [])" as a type.
11447
11448         Note that this still does not handle the more complex rules of
11449         casts. 
11450
11451
11452         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
11453
11454         * ecore.cs: (CopyNewMethods): new utility function used to
11455         assemble the list of methods from running FindMembers.
11456
11457         (MemberLookup): Rework FindMembers so that 
11458
11459 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
11460
11461         * class.cs (TypeContainer): Remove Delegates who fail to be
11462         defined.
11463
11464         * delegate.cs (Populate): Verify that we dont get null return
11465         values.   TODO: Check for AsAccessible.
11466
11467         * cs-parser.jay: Use basename to emit error 574 (destructor should
11468         have the same name as container class), not the full name.
11469
11470         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
11471         possible representation.  
11472
11473         Also implements integer type suffixes U and L.
11474
11475 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
11476
11477         * expression.cs (ArrayCreation.DoResolve): We need to do the
11478         argument resolution *always*.
11479
11480         * decl.cs: Make this hold the namespace.  Hold the root context as
11481         well.
11482         (LookupType): Move here.
11483
11484         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
11485
11486         * location.cs (Row, Name): Fixed the code, it was always returning
11487         references to the first file.
11488
11489         * interface.cs: Register properties defined through interfaces.
11490
11491         * driver.cs: Add support for globbing on the command line
11492
11493         * class.cs (Field): Make it derive from MemberCore as well.
11494         (Event): ditto.
11495
11496 2001-12-15  Ravi Pratap  <ravi@ximian.com>
11497
11498         * class.cs (Event::Define): Check that the type of the event is a delegate
11499         type else flag error #66.
11500
11501         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
11502         same.
11503
11504         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
11505         values of EntryPoint, CharSet etc etc.
11506
11507         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
11508
11509         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
11510         be null and we should ignore this. I am not sure if this is really clean. Apparently,
11511         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
11512         which needs this to do its work.
11513
11514         * ../errors/cs0066.cs : Add.
11515
11516 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
11517
11518         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
11519         helper functions.
11520
11521         * class.cs: (MethodSignature.MethodSignature): Removed hack that
11522         clears out the parameters field.
11523         (MemberSignatureCompare): Cleanup
11524
11525         (MemberCore): New base class used to share code between MethodCore
11526         and Property.
11527
11528         (RegisterRequiredImplementations) BindingFlags.Public requires
11529         either BindingFlags.Instace or Static.  Use instance here.
11530
11531         (Property): Refactored code to cope better with the full spec.
11532
11533         * parameter.cs (GetParameterInfo): Return an empty array instead
11534         of null on error.
11535
11536         * class.cs (Property): Abstract or extern properties have no bodies.
11537
11538         * parameter.cs (GetParameterInfo): return a zero-sized array.
11539
11540         * class.cs (TypeContainer.MethodModifiersValid): Move all the
11541         method modifier validation to the typecontainer so we can reuse
11542         this on properties.
11543
11544         (MethodCore.ParameterTypes): return an empty sized array of types.
11545
11546         (Property.Define): Test property modifier validity.
11547
11548         Add tests for sealed/override too.
11549
11550         (Method.Emit): abstract or extern methods have no bodies.
11551
11552 2001-12-14  Ravi Pratap  <ravi@ximian.com>
11553
11554         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
11555         thing.
11556
11557         (Method::Define, ::Emit): Modify accordingly.
11558
11559         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
11560
11561         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
11562
11563         * makefile: Pass in /unsafe.
11564
11565 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
11566
11567         * class.cs (MakeKey): Kill routine.
11568
11569         * class.cs (TypeContainer.Define): Correctly define explicit
11570         method implementations (they require the full interface name plus
11571         the method name).
11572
11573         * typemanager.cs: Deply the PtrHashtable here and stop using the
11574         lame keys.  Things work so much better.
11575
11576         This of course broke everyone who depended on `RegisterMethod' to
11577         do the `test for existance' test.  This has to be done elsewhere.
11578
11579         * support.cs (PtrHashtable): A hashtable that avoid comparing with
11580         the object stupid Equals method (because, that like fails all over
11581         the place).  We still do not use it.
11582
11583         * class.cs (TypeContainer.SetRequiredInterface,
11584         TypeContainer.RequireMethods): Killed these two routines and moved
11585         all the functionality to RegisterRequiredImplementations.
11586
11587         (TypeContainer.RegisterRequiredImplementations): This routine now
11588         registers all the implementations required in an array for the
11589         interfaces and abstract methods.  We use an array of structures
11590         which can be computed ahead of time to reduce memory usage and we
11591         also assume that lookups are cheap as most classes will not
11592         implement too many interfaces.
11593
11594         We also avoid creating too many MethodSignatures.
11595
11596         (TypeContainer.IsInterfaceMethod): Update and optionally does not
11597         clear the "pending" bit if we find that there are problems with
11598         the declaration.
11599
11600         (TypeContainer.VerifyPendingMethods): Update to report errors of
11601         methods that look like implementations but are not.
11602
11603         (TypeContainer.Define): Add support for explicit interface method
11604         implementation. 
11605
11606 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
11607
11608         * typemanager.cs: Keep track of the parameters here instead of
11609         being a feature of the TypeContainer.
11610
11611         * class.cs: Drop the registration of parameters here, as
11612         InterfaceMethods are also interface declarations.
11613
11614         * delegate.cs: Register methods with the TypeManager not only with
11615         the TypeContainer.  This code was buggy.
11616
11617         * interface.cs: Full registation here.
11618
11619 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
11620
11621         * expression.cs: Remove reducer for binary expressions, it can not
11622         be done this way.
11623
11624         * const.cs: Put here the code that used to go into constant.cs
11625
11626         * constant.cs: Put here the code for constants, this is a new base
11627         class for Literals.
11628
11629         * literal.cs: Make Literal derive from Constant.
11630
11631 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
11632
11633         * statement.cs (Return.Emit): Report error 157 if the user
11634         attempts to return from a finally block.
11635
11636         (Return.Emit): Instead of emitting a return, jump to the end of
11637         the function.
11638
11639         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
11640         LocalBuilder to store the result of the function.  ReturnLabel is
11641         the target where we jump.
11642
11643
11644 2001-12-09  Radek Doulik  <rodo@ximian.com>
11645
11646         * cs-parser.jay: remember alias in current namespace
11647
11648         * ecore.cs (SimpleName::DoResolve): use aliases for types or
11649         namespaces
11650
11651         * class.cs (LookupAlias): lookup alias in my_namespace
11652
11653         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
11654         aliases hashtable
11655         (LookupAlias): lookup alias in this and if needed in parent
11656         namespaces
11657
11658 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
11659
11660         * support.cs: 
11661
11662         * rootcontext.cs: (ModuleBuilder) Made static, first step into
11663         making things static.  I need this to avoid passing the
11664         TypeContainer when calling ParameterType.
11665
11666         * support.cs (InternalParameters.ParameterType): Remove ugly hack
11667         that did string manipulation to compute the type and then call
11668         GetType.  Use Parameter.ParameterType instead.
11669
11670         * cs-tokenizer.cs: Consume the suffix for floating values.
11671
11672         * expression.cs (ParameterReference): figure out whether this is a
11673         reference parameter or not.  Kill an extra variable by computing
11674         the arg_idx during emission.
11675
11676         * parameter.cs (Parameters.GetParameterInfo): New overloaded
11677         function that returns whether a parameter is an out/ref value or not.
11678
11679         (Parameter.ParameterType): The type of the parameter (base,
11680         without ref/out applied).
11681
11682         (Parameter.Resolve): Perform resolution here.
11683         (Parameter.ExternalType): The full type (with ref/out applied).
11684
11685         * statement.cs (Using.Emit, Using.EmitExpression): Implement
11686         support for expressions on the using statement.
11687
11688 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
11689
11690         * statement.cs (Using.EmitLocalVariableDecls): Split the
11691         localvariable handling of the using statement.
11692
11693         (Block.EmitMeta): Keep track of variable count across blocks.  We
11694         were reusing slots on separate branches of blocks.
11695
11696         (Try.Emit): Emit the general code block, we were not emitting it. 
11697
11698         Check the type of the declaration to be an IDisposable or
11699         something that can be implicity converted to it. 
11700
11701         Emit conversions if required.
11702
11703         * ecore.cs (EmptyExpression): New utility class.
11704         (Expression.ImplicitConversionExists): New utility function.
11705
11706 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
11707
11708         * statement.cs (Using): Implement.
11709
11710         * expression.cs (LocalVariableReference): Support read only variables.
11711
11712         * statement.cs: Remove the explicit emit for the Leave opcode.
11713         (VariableInfo): Add a readonly field.
11714
11715 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
11716
11717         * ecore.cs (ConvCast): new class used to encapsulate the various
11718         explicit integer conversions that works in both checked and
11719         unchecked contexts.
11720
11721         (Expression.ConvertNumericExplicit): Use new ConvCast class to
11722         properly generate the overflow opcodes.
11723
11724 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
11725
11726         * statement.cs: The correct type for the EmptyExpression is the
11727         element_type, not the variable type.  Ravi pointed this out.
11728
11729 2001-12-04  Ravi Pratap  <ravi@ximian.com>
11730
11731         * class.cs (Method::Define): Handle PInvoke methods specially
11732         by using DefinePInvokeMethod instead of the usual one.
11733
11734         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
11735         above to do the task of extracting information and defining the method.
11736
11737 2001-12-04  Ravi Pratap  <ravi@ximian.com>
11738
11739         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
11740         of the condition for string type.
11741
11742         (Emit): Move that here. 
11743
11744         (ArrayCreation::CheckIndices): Keep string literals in their expression
11745         form.
11746
11747         (EmitDynamicInitializers): Handle strings appropriately.
11748
11749 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
11750
11751         * codegen.cs (EmitContext): Replace multiple variables with a
11752         single pointer to the current Switch statement.
11753
11754         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
11755         EmitContext.
11756
11757 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
11758
11759         * statement.cs 
11760
11761         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
11762         default'.
11763
11764         (Foreach.Emit): Foreach on arrays was not setting
11765         up the loop variables (for break/continue).
11766
11767         (GotoCase): Semi-implented.
11768
11769 2001-12-03  Ravi Pratap  <ravi@ximian.com>
11770
11771         * attribute.cs (CheckAttribute): Handle system attributes by using
11772         Attribute.GetAttributes to examine information we need.
11773
11774         (GetValidPlaces): Same here.
11775
11776         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
11777
11778         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
11779
11780         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
11781
11782         (Method::Define): Set appropriate flags if we have a DllImport attribute.
11783
11784         (Method::Emit): Handle the case when we are a PInvoke method.
11785
11786 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
11787
11788         * expression.cs: Use ResolveWithSimpleName on compound names.
11789
11790 2001-12-02  Ravi Pratap  <ravi@ximian.com>
11791
11792         * constant.cs (EmitConstant): Make sure we resolve the associated expression
11793         before trying to reduce it.
11794
11795         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
11796
11797         * constant.cs (LookupConstantValue): Implement.
11798
11799         (EmitConstant): Use the above in emitting the constant.
11800
11801         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
11802         that are user-defined by doing a LookupConstantValue on them.
11803
11804         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
11805         too, like above.
11806
11807 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
11808
11809         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
11810
11811         (BaseAccess.DoResolve): Implement.
11812
11813         (MemberAccess.DoResolve): Split this routine into a
11814         ResolveMemberAccess routine that can be used independently
11815
11816 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
11819         As that share bits of the implementation.  Is returns a boolean,
11820         while As returns the Type that is being probed.
11821
11822 2001-12-01  Ravi Pratap  <ravi@ximian.com>
11823
11824         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
11825         instead of a Literal - much easier.
11826
11827         (EnumInTransit): Remove - utterly useless :-)
11828
11829         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
11830
11831         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
11832
11833         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
11834         chain when we have no associated expression.
11835
11836 2001-11-30  Ravi Pratap  <ravi@ximian.com>
11837
11838         * constant.cs (Define): Use Location while reporting the errror.
11839
11840         Also emit a warning when 'new' is used and there is no inherited
11841         member to hide.
11842
11843         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
11844         populated.
11845
11846         (LookupEnumValue): Implement to lookup an enum member's value and define it
11847         if necessary.
11848
11849         (Populate): Re-write accordingly to use the above routine.
11850
11851 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
11852
11853         * expression.cs (This): Fix prototype for DoResolveLValue to
11854         override the base class DoResolveLValue.
11855
11856         * cs-parser.cs: Report errors cs574 and cs575 (destructor
11857         declarations) 
11858
11859         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
11860         (we need to load the address of the field here).  This fixes
11861         test-22. 
11862
11863         (FieldExpr.DoResolveLValue): Call the DoResolve
11864         function to initialize the Instance expression.
11865
11866         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
11867         correctly the GetEnumerator operation on a value type.
11868
11869         * cs-parser.jay: Add more simple parsing error catches.
11870
11871         * statement.cs (Switch): Add support for string switches.
11872         Handle null specially.
11873
11874         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
11875
11876 2001-11-28  Ravi Pratap  <ravi@ximian.com>
11877
11878         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
11879
11880         (declare_local_constant): New helper function.
11881
11882         * statement.cs (AddConstant): Keep a separate record of constants
11883
11884         (IsConstant): Implement to determine if a variable is a constant.
11885
11886         (GetConstantExpression): Implement.
11887
11888         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
11889
11890         * statement.cs (IsVariableDefined): Re-write.
11891
11892 2001-11-27  Ravi Pratap  <ravi@ximian.com>
11893
11894         * class.cs (TypeContainer::FindMembers): Look for constants
11895         in the case when we are looking for MemberTypes.Field
11896
11897         * expression.cs (MemberAccess::DoResolve): Check that in the
11898         case we are a FieldExpr and a Literal, we are not being accessed
11899         by an instance reference.
11900
11901         * cs-parser.jay (local_constant_declaration): Implement.
11902
11903         (declaration_statement): Implement for constant declarations.
11904
11905 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
11906
11907         * statement.cs (Switch): Catch double defaults.
11908
11909         (Switch): More work on the switch() statement
11910         implementation.  It works for integral values now, need to finish
11911         string support.
11912
11913
11914 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
11915
11916         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
11917         integer literals into other integer literals.  To be used by
11918         switch. 
11919
11920 2001-11-24  Ravi Pratap  <ravi@ximian.com>
11921
11922         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
11923         some memory.
11924
11925         (EmitDynamicInitializers): Cope with the above since we extract data
11926         directly from ArrayData now.
11927
11928         (ExpectInitializers): Keep track of whether initializers are mandatory
11929         or not.
11930
11931         (Bounds): Make it a hashtable to prevent the same dimension being 
11932         recorded for every element in that dimension.
11933
11934         (EmitDynamicInitializers): Fix bug which prevented the Set array method
11935         from being found.
11936
11937         Also fix bug which was causing the indices to be emitted in the reverse
11938         order.
11939
11940 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * expression.cs (ArrayCreation): Implement the bits that Ravi left
11943         unfinished.  They do not work, because the underlying code is
11944         sloppy.
11945
11946 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
11947
11948         * cs-parser.jay: Remove bogus fixme.
11949
11950         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
11951         on Switch statement.
11952
11953 2001-11-23  Ravi Pratap  <ravi@ximian.com>
11954
11955         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
11956         the same. 
11957
11958         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
11959         parameter. Apparently, any expression is allowed. 
11960
11961         (ValidateInitializers): Update accordingly.
11962
11963         (CheckIndices): Fix some tricky bugs thanks to recursion.
11964
11965         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
11966         I was being completely brain-dead.
11967
11968         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
11969         and re-write acordingly.
11970
11971         (DelegateInvocation): Re-write accordingly.
11972
11973         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
11974
11975         (MakeByteBlob): Handle types more correctly.
11976
11977         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
11978         initialization from expressions but it is incomplete because I am a complete
11979         Dodo :-|
11980
11981 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
11982
11983         * statement.cs (If.Emit): Fix a bug that generated incorrect code
11984         on If.  Basically, we have to return `true' (ie, we do return to
11985         our caller) only if both branches of the if return.
11986
11987         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
11988         short-circuit operators, handle them as short circuit operators. 
11989
11990         (Cast.DoResolve): Resolve type.
11991         (Cast.Cast): Take an expression as the target type.
11992
11993         * cs-parser.jay (cast_expression): Remove old hack that only
11994         allowed a limited set of types to be handled.  Now we take a
11995         unary_expression and we resolve to a type during semantic
11996         analysis.
11997
11998         Use the grammar productions from Rhys to handle casts (this is
11999         not complete like Rhys syntax yet, we fail to handle that corner
12000         case that C# has regarding (-x), but we will get there.
12001
12002 2001-11-22  Ravi Pratap  <ravi@ximian.com>
12003
12004         * class.cs (EmitFieldInitializer): Take care of the case when we have a
12005         field which is an array type.
12006
12007         * cs-parser.jay (declare_local_variables): Support array initialization too.
12008
12009         * typemanager.cs (MakeKey): Implement.
12010
12011         (everywhere): Use the above appropriately.
12012
12013         * cs-parser.jay (for_statement): Update for array initialization while
12014         declaring variables.
12015
12016         * ecore.cs : The error message was correct, it's the variable's names that
12017         were misleading ;-) Make the code more readable.
12018
12019         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
12020         the correct type etc.
12021
12022         (ConvertExplicit): Handle Enum types by examining the underlying type.
12023
12024 2001-11-21  Ravi Pratap  <ravi@ximian.com>
12025
12026         * parameter.cs (GetCallingConvention): Always return
12027         CallingConventions.Standard for now.
12028
12029 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
12030
12031         * expression.cs (Binary.ResolveOperator): Update the values of `l'
12032         and `r' after calling DoNumericPromotions.
12033
12034         * ecore.cs: Fix error message (the types were in the wrong order).
12035
12036         * statement.cs (Foreach.ProbeCollectionType): Need to pass
12037         BindingFlags.Instance as well 
12038
12039         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
12040         implicit int literal conversion in an empty cast so that we
12041         propagate the right type upstream.
12042
12043         (UnboxCast): new class used to unbox value types.
12044         (Expression.ConvertExplicit): Add explicit type conversions done
12045         by unboxing.
12046
12047         (Expression.ImplicitNumericConversion): Oops, forgot to test for
12048         the target type before applying the implicit LongLiterals to ULong
12049         literal cast.
12050
12051 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
12052
12053         * cs-parser.jay (for_statement): Reworked the way For works: now
12054         we declare manually any variables that are introduced in
12055         for_initializer to solve the problem of having out-of-band code
12056         emition (that is what got for broken).
12057
12058         (declaration_statement): Perform the actual variable declaration
12059         that used to be done in local_variable_declaration here.
12060
12061         (local_variable_declaration): Do not declare anything, just pass
12062         the information on a DictionaryEntry
12063
12064 2001-11-20  Ravi Pratap  <ravi@ximian.com>
12065
12066         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
12067         re-write of the logic to now make it recursive.
12068
12069         (UpdateIndices): Re-write accordingly.
12070
12071         Store element data in a separate ArrayData list in the above methods.
12072
12073         (MakeByteBlob): Implement to dump the array data into a byte array.
12074
12075 2001-11-19  Ravi Pratap  <ravi@ximian.com>
12076
12077         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
12078         into CheckIndices.
12079
12080         * constant.cs (Define): Implement.
12081
12082         (EmitConstant): Re-write fully.
12083
12084         Pass in location info.
12085
12086         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
12087         respectively.
12088
12089         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
12090         DictionaryEntry since we need location info too.
12091
12092         (constant_declaration): Update accordingly.
12093
12094         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
12095         code into another method : UpdateIndices.
12096
12097 2001-11-18  Ravi Pratap  <ravi@ximian.com>
12098
12099         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
12100         some type checking etc.
12101
12102 2001-11-17  Ravi Pratap  <ravi@ximian.com>
12103
12104         * expression.cs (ArrayCreation::ValidateInitializers): Implement
12105         bits to provide dimension info if the user skips doing that.
12106
12107         Update second constructor to store the rank correctly.
12108
12109 2001-11-16  Ravi Pratap  <ravi@ximian.com>
12110
12111         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
12112         and try to implement.
12113
12114         * ../errors/cs0150.cs : Add.
12115
12116         * ../errors/cs0178.cs : Add.
12117
12118 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * statement.cs: Implement foreach on multi-dimensional arrays. 
12121
12122         * parameter.cs (Parameters.GetParameterByName): Also lookup the
12123         name of the params argument.
12124
12125         * expression.cs: Use EmitStoreOpcode to get the right opcode while
12126         initializing the array.
12127
12128         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
12129         we can use this elsewhere.
12130
12131         * statement.cs: Finish implementation of foreach for single
12132         dimension arrays.
12133
12134         * cs-parser.jay: Use an out-of-band stack to pass information
12135         around, I wonder why I need this.
12136
12137         foreach_block: Make the new foreach_block the current_block.
12138
12139         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
12140         function used to return a static Parameters structure.  Used for
12141         empty parameters, as those are created very frequently.
12142
12143         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
12144
12145 2001-11-15  Ravi Pratap  <ravi@ximian.com>
12146
12147         * interface.cs : Default modifier is private, not public. The
12148         make verify test passes again.
12149
12150 2001-11-15  Ravi Pratap  <ravi@ximian.com>
12151
12152         * support.cs (ReflectionParameters): Fix logic to determine
12153         whether the last parameter is a params one. Test 9 passes again.
12154
12155         * delegate.cs (Populate): Register the builders we define with
12156         RegisterParameterForBuilder. Test 19 passes again.
12157
12158         * cs-parser.jay (property_declaration): Reference $6 instead
12159         of $$ to get at the location.
12160
12161         (indexer_declaration): Similar stuff.
12162
12163         (attribute): Ditto.
12164
12165         * class.cs (Property): Register parameters for the Get and Set methods
12166         if they exist. Test 23 passes again.
12167
12168         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
12169         call to EmitArguments as we are sure there aren't any params arguments. 
12170         Test 32 passes again.
12171
12172         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
12173         IndexOutOfRangeException. 
12174
12175         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
12176         Test 33 now passes again.
12177
12178 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
12181         broke a bunch of things.  Will have to come up with a better way
12182         of tracking locations.
12183
12184         * statement.cs: Implemented foreach for single dimension arrays.
12185
12186 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
12187
12188         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
12189         an error.  This removes the lookup from the critical path.
12190
12191         * cs-parser.jay: Removed use of temporary_loc, which is completely
12192         broken. 
12193
12194 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
12195
12196         * support.cs (ReflectionParameters.ParameterModifier): Report
12197         whether the argument is a PARAMS argument or not.
12198
12199         * class.cs: Set the attribute `ParamArrayAttribute' on the
12200         parameter argument.
12201
12202         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
12203         and cons_param_array_attribute (ConstructorInfo for
12204         ParamArrayAttribute)., 
12205
12206         * codegen.cs: Emit the return using the `Return' statement, that
12207         way we can report the error correctly for missing return values. 
12208
12209         * class.cs (Method.Emit): Clean up.
12210
12211         * expression.cs (Argument.Resolve): Take another argument: the
12212         location where this argument is used.  Notice that this is not
12213         part of the "Argument" class as to reduce the size of the
12214         structure (we know the approximate location anyways).
12215
12216         Test if the argument is a variable-reference, if not, then
12217         complain with a 206.
12218
12219         (Argument.Emit): Emit addresses of variables.
12220
12221         (Argument.FullDesc): Simplify.
12222
12223         (Invocation.DoResolve): Update for Argument.Resolve.
12224
12225         (ElementAccess.DoResolve): ditto.
12226
12227         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
12228         method should be virtual, as this method is always virtual.
12229
12230         (NewDelegate.DoResolve): Update for Argument.Resolve.
12231
12232         * class.cs (ConstructorInitializer.DoResolve): ditto.
12233
12234         * attribute.cs (Attribute.Resolve): ditto.
12235
12236 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
12237
12238         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
12239
12240         * expression.cs (ParameterReference): Drop IStackStorage and implement
12241         IAssignMethod instead. 
12242
12243         (LocalVariableReference): ditto.
12244
12245         * ecore.cs (FieldExpr): Drop IStackStorage and implement
12246         IAssignMethod instead. 
12247
12248 2001-11-13  Miguel de Icaza <miguel@ximian.com>
12249
12250         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
12251         enumerations that are used in heavily used structures derive from
12252         byte in a laughable and pathetic attempt to reduce memory usage.
12253         This is the kind of pre-optimzations that you should not do at
12254         home without adult supervision.
12255
12256         * expression.cs (UnaryMutator): New class, used to handle ++ and
12257         -- separatedly from the other unary operators.  Cleans up the
12258         code, and kills the ExpressionStatement dependency in Unary.
12259
12260         (Unary): Removed `method' and `Arguments' from this class, making
12261         it smaller, and moving it all to SimpleCall, so I can reuse this
12262         code in other locations and avoid creating a lot of transient data
12263         strucutres when not required.
12264
12265         * cs-parser.jay: Adjust for new changes.
12266
12267 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
12268
12269         * enum.cs (Enum.Populate): If there is a failure during
12270         definition, return
12271
12272         * cs-parser.jay (opt_enum_base): we used to catch type errors
12273         here, but this is really incorrect.  The type error should be
12274         catched during semantic analysis.
12275
12276 2001-12-11  Ravi Pratap  <ravi@ximian.com>
12277
12278         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
12279         current_local_parameters as expected since I, in my stupidity, had forgotten
12280         to do this :-)
12281
12282         * attribute.cs (GetValidPlaces): Fix stupid bug.
12283
12284         * class.cs (Method::Emit): Perform check on applicability of attributes.
12285
12286         (Constructor::Emit): Ditto.
12287
12288         (Field::Emit): Ditto.
12289
12290         (Field.Location): Store location information.
12291
12292         (Property, Event, Indexer, Operator): Ditto.
12293
12294         * cs-parser.jay (field_declaration): Pass in location for each field.
12295
12296         * ../errors/cs0592.cs : Add.
12297
12298 2001-11-12  Ravi Pratap  <ravi@ximian.com>
12299
12300         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
12301
12302         (InitCoreTypes): Update accordingly.
12303
12304         (RegisterAttrType, LookupAttr): Implement.
12305
12306         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
12307         info about the same.
12308
12309         (Resolve): Update to populate the above as necessary.
12310
12311         (Error592): Helper.
12312
12313         (GetValidPlaces): Helper to the above.
12314
12315         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
12316
12317         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
12318
12319 2001-11-12  Ravi Pratap  <ravi@ximian.com>
12320
12321         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
12322
12323         * ../errors/cs0617.cs : Add.
12324
12325 2001-11-11  Ravi Pratap  <ravi@ximian.com>
12326
12327         * enum.cs (Emit): Rename to Populate to be more consistent with what
12328         we expect it to do and when exactly it is called.
12329
12330         * class.cs, rootcontext.cs : Update accordingly.
12331
12332         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
12333         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
12334
12335         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
12336
12337         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
12338         of a fieldinfo using the above, when dealing with a FieldBuilder.
12339
12340 2001-11-10  Ravi Pratap  <ravi@ximian.com>
12341
12342         * ../errors/cs0031.cs : Add.
12343
12344         * ../errors/cs1008.cs : Add.
12345
12346         * ../errrors/cs0543.cs : Add.
12347
12348         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
12349         enum type.
12350
12351         (FindMembers): Implement.
12352
12353         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
12354         enums and delegates too.
12355
12356         (enum_types): Rename to builder_to_enum.
12357
12358         (delegate_types): Rename to builder_to_delegate.
12359
12360         * delegate.cs (FindMembers): Implement.
12361
12362 2001-11-09  Ravi Pratap  <ravi@ximian.com>
12363
12364         * typemanager.cs (IsEnumType): Implement.
12365
12366         * enum.cs (Emit): Re-write parts to account for the underlying type
12367         better and perform checking etc.
12368
12369         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
12370         of the underlying type.
12371
12372         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
12373         value
12374
12375         * enum.cs (error31): Helper to report error #31.
12376
12377         * cs-parser.jay (enum_declaration): Store location of each member too.
12378
12379         * enum.cs (member_to_location): New hashtable. 
12380
12381         (AddEnumMember): Update location hashtable.
12382
12383         (Emit): Use the location of each member while reporting errors.
12384
12385 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
12386
12387         * cs-parser.jay: A for_initializer if is a
12388         local_variable_declaration really ammount to have an implicit
12389         block with the variable declaration and no initializer for for.
12390
12391         * statement.cs (For.Emit): Cope with null initializers.
12392
12393         This fixes the infinite loop on for initializers.
12394
12395 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
12396
12397         * enum.cs: More cleanup.
12398
12399         * ecore.cs: Remove dead code.
12400
12401         * class.cs (Property.Emit): More simplification.
12402         (Event.Emit): ditto.
12403
12404         Reworked to have less levels of indentation.
12405
12406 2001-11-08  Ravi Pratap  <ravi@ximian.com>
12407
12408         * class.cs (Property): Emit attributes.
12409
12410         (Field): Ditto.
12411
12412         (Event): Ditto.
12413
12414         (Indexer): Ditto.
12415
12416         (Operator): Ditto.
12417
12418         * enum.cs (Emit): Ditto.
12419
12420         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
12421         Enums too.
12422
12423         * class.cs (Field, Event, etc.): Move attribute generation into the
12424         Emit method everywhere.
12425
12426         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
12427         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
12428         as we had no way of defining nested enums !
12429
12430         * rootcontext.cs : Adjust code accordingly.
12431
12432         * typemanager.cs (AddEnumType): To keep track of enum types separately.
12433
12434 2001-11-07  Ravi Pratap  <ravi@ximian.com>
12435
12436         * expression.cs (EvalConstantExpression): Move into ecore.cs
12437
12438         * enum.cs (Enum): Rename some members and make them public and readonly
12439         according to our convention.
12440
12441         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
12442         nothing else.
12443
12444         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
12445
12446         (Enum::Emit): Write a simple version for now which doesn't try to compute
12447         expressions. I shall modify this to be more robust in just a while.
12448
12449         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
12450
12451         (TypeContainer::CloseType): Create the Enum types too.
12452
12453         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
12454
12455         * expression.cs (EvalConstantExpression): Get rid of completely.
12456
12457         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
12458         user-defined values and other cases.
12459
12460         (IsValidEnumLiteral): Helper function.
12461
12462         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
12463         out there in the case we had a literal FieldExpr.
12464
12465         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
12466
12467         (Literalize): Revamp a bit to take two arguments.
12468
12469         (EnumLiteral): New class which derives from Literal to wrap enum literals.
12470
12471 2001-11-06  Ravi Pratap  <ravi@ximian.com>
12472
12473         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
12474
12475         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
12476
12477         (Resolve): Use the above to ensure we have proper initializers.
12478
12479 2001-11-05  Ravi Pratap  <ravi@ximian.com>
12480
12481         * expression.cs (Expression::EvalConstantExpression): New method to 
12482         evaluate constant expressions.
12483
12484         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
12485
12486 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
12487
12488         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
12489         in an array.
12490
12491         (Binary.ResolveOperator): Handle operator != (object a, object b)
12492         and operator == (object a, object b);
12493
12494         (Binary.DoNumericPromotions): Indicate whether the numeric
12495         promotion was possible.
12496
12497         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
12498         Implement.  
12499
12500         Made the ArrayAccess implement interface IAssignMethod instead of
12501         IStackStore as the order in which arguments are passed reflects
12502         this.
12503
12504         * assign.cs: Instead of using expr.ExprClass to select the way of
12505         assinging, probe for the IStackStore/IAssignMethod interfaces.
12506
12507         * typemanager.cs: Load InitializeArray definition.
12508
12509         * rootcontext.cs (RootContext.MakeStaticData): Used to define
12510         static data that can be used to initialize arrays. 
12511
12512 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
12513
12514         * expression.cs: Handle operator== and operator!= for booleans.
12515
12516         (Conditioal.Reduce): Implement reducer for the ?: operator.
12517
12518         (Conditional.Resolve): Implement dead code elimination.
12519
12520         (Binary.Resolve): Catch string literals and return a new
12521         concatenated string.
12522
12523         (Unary.Reduce): Implement reduction of unary expressions.
12524
12525         * ecore.cs: Split out the expression core handling here.
12526
12527         (Expression.Reduce): New method used to perform constant folding
12528         and CSE.  This is needed to support constant-expressions. 
12529
12530         * statement.cs (Statement.EmitBoolExpression): Pass true and false
12531         targets, and optimize for !x.
12532
12533 2001-11-04  Ravi Pratap  <ravi@ximian.com>
12534
12535         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
12536         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
12537         set custom atttributes.
12538
12539         * literal.cs (Literal::GetValue): New abstract method to return the actual
12540         value of the literal, cast as an object.
12541
12542         (*Literal): Implement GetValue method.
12543
12544         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
12545         expressions to the arraylist but objects of type Argument.
12546
12547         * class.cs (TypeContainer::Emit): Emit our attributes too.
12548
12549         (Method::Emit, Constructor::Emit): Ditto.
12550
12551         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
12552         to be ignoring earlier.
12553
12554 2001-11-03  Ravi Pratap  <ravi@ximian.com>
12555
12556         * attribute.cs (AttributeSection::Define): Implement to do the business
12557         of constructing a CustomAttributeBuilder.
12558
12559         (Attribute): New trivial class. Increases readability of code.  
12560
12561         * cs-parser.jay : Update accordingly.
12562
12563         (positional_argument_list, named_argument_list, named_argument): New rules
12564
12565         (attribute_arguments): Use the above so that we are more correct.
12566
12567 2001-11-02  Ravi Pratap  <ravi@ximian.com>
12568
12569         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
12570         to perform all checks for a method with a params parameter.
12571
12572         (Invocation::OverloadResolve): Update to use the above method and therefore
12573         cope correctly with params method invocations.
12574
12575         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
12576         params too.
12577
12578         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
12579         constructors in our parent too because we can't afford to miss out on 
12580         protected ones ;-)
12581
12582         * attribute.cs (AttributeSection): New name for the class Attribute
12583
12584         Other trivial changes to improve readability.
12585
12586         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
12587         use the new class names.
12588
12589 2001-11-01  Ravi Pratap  <ravi@ximian.com>
12590
12591         * class.cs (Method::Define): Complete definition for params types too
12592
12593         (Indexer::Define): Ditto.
12594
12595         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
12596         Cope everywhere with a request for info about the array parameter.
12597
12598 2001-11-01  Ravi Pratap  <ravi@ximian.com>
12599
12600         * tree.cs (RecordNamespace): Fix up to check for the correct key.
12601
12602         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
12603         local_variable_type to extract the string corresponding to the type.
12604
12605         (local_variable_type): Fixup the action to use the new helper method.
12606
12607         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
12608         go.
12609
12610         * expression.cs : Clean out code which uses the above.
12611
12612 2001-10-31  Ravi Pratap  <ravi@ximian.com>
12613
12614         * typemanager.cs (RegisterMethod): Check if we already have an existing key
12615         and bale out if necessary by returning a false.
12616
12617         (RegisterProperty): Ditto.
12618
12619         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
12620         and print out appropriate error messages.
12621
12622         * interface.cs (everywhere): Ditto.
12623
12624         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
12625         location to constructor.
12626
12627         * class.cs (Property, Event, Indexer): Update accordingly.
12628
12629         * ../errors/cs111.cs : Added.
12630
12631         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
12632         of a method, as laid down by the spec.
12633
12634         (Invocation::OverloadResolve): Use the above method.
12635
12636 2001-10-31  Ravi Pratap  <ravi@ximian.com>
12637
12638         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
12639         now take a TypeContainer and a Parameters object.
12640
12641         (ParameterData): Modify return type of ParameterModifier method to be 
12642         Parameter.Modifier and not a string.
12643
12644         (ReflectionParameters, InternalParameters): Update accordingly.
12645
12646         * expression.cs (Argument::GetParameterModifier): Same here.
12647
12648         * support.cs (InternalParameters::ParameterType): Find a better way of determining
12649         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
12650         symbol in it at all so maybe this is only for now.
12651
12652 2001-10-30  Ravi Pratap  <ravi@ximian.com>
12653
12654         * support.cs (InternalParameters): Constructor now takes an extra argument 
12655         which is the actual Parameters class.
12656
12657         (ParameterDesc): Update to provide info on ref/out modifiers.
12658
12659         * class.cs (everywhere): Update call to InternalParameters to pass in
12660         the second argument too.
12661
12662         * support.cs (ParameterData): Add ParameterModifier, which is a method 
12663         to return the modifier info [ref/out etc]
12664
12665         (InternalParameters, ReflectionParameters): Implement the above.
12666
12667         * expression.cs (Argument::ParameterModifier): Similar function to return
12668         info about the argument's modifiers.
12669
12670         (Invocation::OverloadResolve): Update to take into account matching modifiers 
12671         too.
12672
12673         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
12674         a new SetFormalParameters object which we pass to InternalParameters.
12675
12676 2001-10-30  Ravi Pratap  <ravi@ximian.com>
12677
12678         * expression.cs (NewArray): Merge into the ArrayCreation class.
12679
12680 2001-10-29  Ravi Pratap  <ravi@ximian.com>
12681
12682         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
12683         NewUserdefinedArray into one as there wasn't much of a use in having
12684         two separate ones.
12685
12686         * expression.cs (Argument): Change field's name to ArgType from Type.
12687
12688         (Type): New readonly property which returns the proper type, taking into 
12689         account ref/out modifiers.
12690
12691         (everywhere): Adjust code accordingly for the above.
12692
12693         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
12694         whether we are emitting for a ref or out parameter.
12695
12696         * expression.cs (Argument::Emit): Use the above field to set the state.
12697
12698         (LocalVariableReference::Emit): Update to honour the flag and emit the
12699         right stuff.
12700
12701         * parameter.cs (Attributes): Set the correct flags for ref parameters.
12702
12703         * expression.cs (Argument::FullDesc): New function to provide a full desc.
12704
12705         * support.cs (ParameterData): Add method ParameterDesc to the interface.
12706
12707         (ReflectionParameters, InternalParameters): Implement the above method.
12708
12709         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
12710         reporting errors.
12711
12712         (Invocation::FullMethodDesc): Ditto. 
12713
12714 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
12715
12716         * cs-parser.jay: Add extra production for the second form of array
12717         creation. 
12718
12719         * expression.cs (ArrayCreation): Update to reflect the above
12720         change. 
12721
12722         * Small changes to prepare for Array initialization.
12723
12724 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
12725
12726         * typemanager.cs (ImplementsInterface): interface might be null;
12727         Deal with this problem;
12728
12729         Also, we do store negative hits on the cache (null values), so use
12730         this instead of calling t.GetInterfaces on the type everytime.
12731
12732 2001-10-28  Ravi Pratap  <ravi@ximian.com>
12733
12734         * typemanager.cs (IsBuiltinType): New method to help determine the same.
12735
12736         * expression.cs (New::DoResolve): Get rid of array creation code and instead
12737         split functionality out into different classes.
12738
12739         (New::FormArrayType): Move into NewBuiltinArray.
12740
12741         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
12742         quite useless.
12743
12744         (NewBuiltinArray): New class to handle creation of built-in arrays.
12745
12746         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
12747         account creation of one-dimensional arrays.
12748
12749         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
12750
12751         (NewUserdefinedArray::DoResolve): Implement.
12752
12753         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
12754
12755         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
12756         we maintain inside the TypeManager. This is necessary to perform lookups on the
12757         module builder.
12758
12759         (LookupType): Update to perform GetType on the module builders too.     
12760
12761         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
12762
12763         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
12764
12765 2001-10-23  Ravi Pratap  <ravi@ximian.com>
12766
12767         * expression.cs (New::DoResolve): Implement guts of array creation.
12768
12769         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
12770
12771 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
12772
12773         * expression.cs: Fix bug I introduced lsat night that broke
12774         Delegates. 
12775
12776         (Expression.Resolve): Report a 246 error (can not resolve name)
12777         if we find a SimpleName in the stream.
12778
12779         (Expression.ResolveLValue): Ditto.
12780
12781         (Expression.ResolveWithSimpleName): This function is a variant of
12782         ResolveName, this one allows SimpleNames to be returned without a
12783         warning.  The only consumer of SimpleNames is MemberAccess
12784
12785 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
12786
12787         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
12788         might arrive here.  I have my doubts that this is correct.
12789
12790         * statement.cs (Lock): Implement lock statement.
12791
12792         * cs-parser.jay: Small fixes to support `lock' and `using'
12793
12794         * cs-tokenizer.cs: Remove extra space
12795
12796         * driver.cs: New flag --checked, allows to turn on integer math
12797         checking. 
12798
12799         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
12800         Threading.Monitor.Exit 
12801
12802 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
12803
12804         * expression.cs (IndexerAccess::DoResolveLValue): Set the
12805         Expression Class to be IndexerAccess.
12806
12807         Notice that Indexer::DoResolve sets the eclass to Value.
12808
12809 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * class.cs (TypeContainer::Emit): Emit code for indexers.
12812
12813         * assign.cs (IAssignMethod): New interface implemented by Indexers
12814         and Properties for handling assignment.
12815
12816         (Assign::Emit): Simplify and reuse code. 
12817
12818         * expression.cs (IndexerAccess, PropertyExpr): Implement
12819         IAssignMethod, clean up old code. 
12820
12821 2001-10-22  Ravi Pratap  <ravi@ximian.com>
12822
12823         * typemanager.cs (ImplementsInterface): New method to determine if a type
12824         implements a given interface. Provides a nice cache too.
12825
12826         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
12827         method.
12828
12829         (ConvertReferenceExplicit): Ditto.
12830
12831         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
12832         various methods, with correct names etc.
12833
12834         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
12835         Operator.UnaryNegation.
12836
12837         * cs-parser.jay (operator_declarator): Be a little clever in the case where
12838         we have a unary plus or minus operator.
12839
12840         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
12841         UnaryMinus.
12842
12843         * everywhere : update accordingly.
12844
12845         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
12846         respectively.
12847
12848         * class.cs (Method::Define): For the case where we are implementing a method
12849         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
12850         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
12851
12852 2001-10-21  Ravi Pratap  <ravi@ximian.com>
12853
12854         * interface.cs (FindMembers): Implement to work around S.R.E
12855         lameness.
12856
12857         * typemanager.cs (IsInterfaceType): Implement.
12858
12859         (FindMembers): Update to handle interface types too.
12860
12861         * expression.cs (ImplicitReferenceConversion): Re-write bits which
12862         use IsAssignableFrom as that is not correct - it doesn't work.
12863
12864         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
12865         and accordingly override EmitStatement.
12866
12867         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
12868         using the correct logic :-)
12869
12870 2001-10-19  Ravi Pratap  <ravi@ximian.com>
12871
12872         * ../errors/cs-11.cs : Add to demonstrate error -11 
12873
12874 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
12875
12876         * assign.cs (Assign::Resolve): Resolve right hand side first, and
12877         then pass this as a hint to ResolveLValue.
12878
12879         * expression.cs (FieldExpr): Add Location information
12880
12881         (FieldExpr::LValueResolve): Report assignment to readonly
12882         variable. 
12883
12884         (Expression::ExprClassFromMemberInfo): Pass location information.
12885
12886         (Expression::ResolveLValue): Add new method that resolves an
12887         LValue. 
12888
12889         (Expression::DoResolveLValue): Default invocation calls
12890         DoResolve. 
12891
12892         (Indexers): New class used to keep track of indexers in a given
12893         Type. 
12894
12895         (IStackStore): Renamed from LValue, as it did not really describe
12896         what this did.  Also ResolveLValue is gone from this interface and
12897         now is part of Expression.
12898
12899         (ElementAccess): Depending on the element access type
12900
12901         * typemanager.cs: Add `indexer_name_type' as a Core type
12902         (System.Runtime.CompilerServices.IndexerNameAttribute)
12903
12904         * statement.cs (Goto): Take a location.
12905
12906 2001-10-18  Ravi Pratap  <ravi@ximian.com>
12907
12908         * delegate.cs (Delegate::VerifyDelegate): New method to verify
12909         if two delegates are compatible.
12910
12911         (NewDelegate::DoResolve): Update to take care of the case when
12912         we instantiate a delegate from another delegate.
12913
12914         * typemanager.cs (FindMembers): Don't even try to look up members
12915         of Delegate types for now.
12916
12917 2001-10-18  Ravi Pratap  <ravi@ximian.com>
12918
12919         * delegate.cs (NewDelegate): New class to take care of delegate
12920         instantiation.
12921
12922         * expression.cs (New): Split the delegate related code out into 
12923         the NewDelegate class.
12924
12925         * delegate.cs (DelegateInvocation): New class to handle delegate 
12926         invocation.
12927
12928         * expression.cs (Invocation): Split out delegate related code into
12929         the DelegateInvocation class.
12930
12931 2001-10-17  Ravi Pratap  <ravi@ximian.com>
12932
12933         * expression.cs (New::DoResolve): Implement delegate creation fully
12934         and according to the spec.
12935
12936         (New::DoEmit): Update to handle delegates differently.
12937
12938         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
12939         because of which we were printing out arguments in reverse order !
12940
12941         * delegate.cs (VerifyMethod): Implement to check if the given method
12942         matches the delegate.
12943
12944         (FullDelegateDesc): Implement.
12945
12946         (VerifyApplicability): Implement.
12947
12948         * expression.cs (Invocation::DoResolve): Update to accordingly handle
12949         delegate invocations too.
12950
12951         (Invocation::Emit): Ditto.
12952
12953         * ../errors/cs1593.cs : Added.
12954
12955         * ../errors/cs1594.cs : Added.
12956
12957         * delegate.cs (InstanceExpression, TargetMethod): New properties.
12958
12959 2001-10-16  Ravi Pratap  <ravi@ximian.com>
12960
12961         * typemanager.cs (intptr_type): Core type for System.IntPtr
12962
12963         (InitCoreTypes): Update for the same.
12964
12965         (iasyncresult_type, asynccallback_type): Ditto.
12966
12967         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
12968         correct.
12969
12970         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
12971         too.
12972
12973         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
12974         the builders for the 4 members of a delegate type :-)
12975
12976         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
12977         type.
12978
12979         * expression.cs (New::DoResolve): Implement guts for delegate creation.
12980
12981         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
12982
12983 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
12984
12985         * statement.cs (Break::Emit): Implement.   
12986         (Continue::Emit): Implement.
12987
12988         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
12989         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
12990         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
12991         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
12992         end loop
12993
12994         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
12995         properties that track the label for the current loop (begin of the
12996         loop and end of the loop).
12997
12998 2001-10-15  Ravi Pratap  <ravi@ximian.com>
12999
13000         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
13001         use of emitting anything at all.
13002
13003         * class.cs, rootcontext.cs : Get rid of calls to the same.
13004
13005         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
13006
13007         (Populate): Define the constructor correctly and set the implementation
13008         attributes.
13009
13010         * typemanager.cs (delegate_types): New hashtable to hold delegates that
13011         have been defined.
13012
13013         (AddDelegateType): Implement.
13014
13015         (IsDelegateType): Implement helper method.
13016
13017         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
13018
13019         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
13020         and accordingly handle it.
13021
13022         * delegate.cs (Populate): Take TypeContainer argument.
13023         Implement bits to define the Invoke method. However, I still haven't figured out
13024         how to take care of the native int bit :-(
13025
13026         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
13027         Qualify the name of the delegate, not its return type !
13028
13029         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
13030         conversion.
13031
13032         (StandardConversionExists): Checking for array types turns out to be recursive.
13033
13034         (ConvertReferenceExplicit): Implement array conversion.
13035
13036         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
13037
13038 2001-10-12  Ravi Pratap  <ravi@ximian.com>
13039
13040         * cs-parser.jay (delegate_declaration): Store the fully qualified
13041         name as it is a type declaration.
13042
13043         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
13044         readonly.
13045
13046         (DefineDelegate): Renamed from Define. Does the same thing essentially,
13047         as TypeContainer::DefineType.
13048
13049         (Populate): Method in which all the definition of the various methods (Invoke)
13050         etc is done.
13051
13052         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
13053         see.
13054
13055         (CloseDelegate): Finally creates the delegate.
13056
13057         * class.cs (TypeContainer::DefineType): Update to define delegates.
13058         (Populate, Emit and CloseType): Do the same thing here too.
13059
13060         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
13061         delegates in all these operations.
13062
13063 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
13064
13065         * expression.cs: LocalTemporary: a new expression used to
13066         reference a temporary that has been created.
13067
13068         * assign.cs: Handle PropertyAccess back here, so that we can
13069         provide the proper semantic access to properties.
13070
13071         * expression.cs (Expression::ConvertReferenceExplicit): Implement
13072         a few more explicit conversions. 
13073
13074         * modifiers.cs: `NEW' modifier maps to HideBySig.
13075
13076         * expression.cs (PropertyExpr): Make this into an
13077         ExpressionStatement, and support the EmitStatement code path. 
13078
13079         Perform get/set error checking, clean up the interface.
13080
13081         * assign.cs: recognize PropertyExprs as targets, and if so, turn
13082         them into toplevel access objects.
13083
13084 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
13085
13086         * expression.cs: PropertyExpr::PropertyExpr: use work around the
13087         SRE.
13088
13089         * typemanager.cs: Keep track here of our PropertyBuilders again to
13090         work around lameness in SRE.
13091
13092 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
13093
13094         * expression.cs (LValue::LValueResolve): New method in the
13095         interface, used to perform a second resolution pass for LValues. 
13096
13097         (This::DoResolve): Catch the use of this in static methods.
13098
13099         (This::LValueResolve): Implement.
13100
13101         (This::Store): Remove warning, assigning to `this' in structures
13102         is 
13103
13104         (Invocation::Emit): Deal with invocation of
13105         methods on value types.  We need to pass the address to structure
13106         methods rather than the object itself.  (The equivalent code to
13107         emit "this" for structures leaves the entire structure on the
13108         stack instead of a pointer to it). 
13109
13110         (ParameterReference::DoResolve): Compute the real index for the
13111         argument based on whether the method takes or not a `this' pointer
13112         (ie, the method is static).
13113
13114         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
13115         value types returned from functions when we need to invoke a
13116         method on the sturcture.
13117
13118
13119 2001-10-11  Ravi Pratap  <ravi@ximian.com>
13120
13121         * class.cs (TypeContainer::DefineType): Method to actually do the business of
13122         defining the type in the Modulebuilder or Typebuilder. This is to take
13123         care of nested types which need to be defined on the TypeBuilder using
13124         DefineNestedMethod.
13125
13126         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
13127         methods in RootContext, only ported to be part of TypeContainer.
13128
13129         (TypeContainer::GetInterfaceOrClass): Ditto.
13130
13131         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
13132
13133         * interface.cs (Interface::DefineInterface): New method. Does exactly
13134         what RootContext.CreateInterface did earlier, only it takes care of nested types 
13135         too.
13136
13137         (Interface::GetInterfaces): Move from RootContext here and port.
13138
13139         (Interface::GetInterfaceByName): Same here.
13140
13141         * rootcontext.cs (ResolveTree): Re-write.
13142
13143         (PopulateTypes): Re-write.
13144
13145         * class.cs (TypeContainer::Populate): Populate nested types too.
13146         (TypeContainer::Emit): Emit nested members too.
13147
13148         * typemanager.cs (AddUserType): Do not make use of the FullName property,
13149         instead just use the name argument passed in as it is already fully
13150         qualified.
13151
13152         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
13153         to TypeContainer mapping to see if a type is user-defined.
13154
13155         * class.cs (TypeContainer::CloseType): Implement. 
13156
13157         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
13158         the default constructor.
13159
13160         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
13161         twice.
13162
13163         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
13164
13165         * interface.cs (CloseType): Create the type here.
13166
13167         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
13168         the hierarchy.
13169
13170         Remove all the methods which are now in TypeContainer.
13171
13172 2001-10-10  Ravi Pratap  <ravi@ximian.com>
13173
13174         * delegate.cs (Define): Re-write bits to define the delegate
13175         correctly.
13176
13177 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
13178
13179         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
13180
13181         * expression.cs (ImplicitReferenceConversion): handle null as well
13182         as a source to convert to any reference type.
13183
13184         * statement.cs (Return): Perform any implicit conversions to
13185         expected return type.  
13186
13187         Validate use of return statement.  
13188
13189         * codegen.cs (EmitContext): Pass the expected return type here.
13190
13191         * class.cs (Method, Constructor, Property): Pass expected return
13192         type to EmitContext.
13193
13194 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
13195
13196         * expression.cs: Make DoResolve take an EmitContext instead of a
13197         TypeContainer.
13198
13199         Replaced `l' and `location' for `loc', for consistency.
13200
13201         (Error, Warning): Remove unneeded Tc argument.
13202
13203         * assign.cs, literal.cs, constant.cs: Update to new calling
13204         convention. 
13205
13206         * codegen.cs: EmitContext now contains a flag indicating whether
13207         code is being generated in a static method or not.
13208
13209         * cs-parser.jay: DecomposeQI, new function that replaces the old
13210         QualifiedIdentifier.  Now we always decompose the assembled
13211         strings from qualified_identifier productions into a group of
13212         memberaccesses.
13213
13214 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
13215
13216         * rootcontext.cs: Deal with field-less struct types correctly now
13217         by passing the size option to Define Type.
13218
13219         * class.cs: Removed hack that created one static field. 
13220
13221 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
13222
13223         * statement.cs: Moved most of the code generation here. 
13224
13225 2001-10-09  Ravi Pratap  <ravi@ximian.com>
13226
13227         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
13228         seem very right.
13229
13230         (ElementAccess): Remove useless bits for now - keep checks as the spec
13231         says.
13232
13233 2001-10-08  Ravi Pratap  <ravi@ximian.com>
13234
13235         * expression.cs (ElementAccess::DoResolve): Remove my crap code
13236         and start performing checks according to the spec.
13237
13238 2001-10-07  Ravi Pratap  <ravi@ximian.com>
13239
13240         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
13241         rank_specifiers instead.
13242
13243         (rank_specifiers): Change the order in which the rank specifiers are stored
13244
13245         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
13246
13247         * expression.cs (ElementAccess): Implement the LValue interface too.
13248
13249 2001-10-06  Ravi Pratap  <ravi@ximian.com>
13250
13251         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
13252         except that user defined conversions are not included.
13253
13254         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
13255         perform the conversion of the return type, if necessary.
13256
13257         (New::DoResolve): Check whether we are creating an array or an object
13258         and accordingly do the needful.
13259
13260         (New::Emit): Same here.
13261
13262         (New::DoResolve): Implement guts of array creation.
13263
13264         (New::FormLookupType): Helper function.
13265
13266 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
13267
13268         * codegen.cs: Removed most of the code generation here, and move the
13269         corresponding code generation bits to the statement classes. 
13270
13271         Added support for try/catch/finalize and throw.
13272
13273         * cs-parser.jay: Added support for try/catch/finalize.
13274
13275         * class.cs: Catch static methods having the flags override,
13276         virtual or abstract.
13277
13278         * expression.cs (UserCast): This user cast was not really doing
13279         what it was supposed to do.  Which is to be born in fully resolved
13280         state.  Parts of the resolution were being performed at Emit time! 
13281
13282         Fixed this code.
13283
13284 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
13285
13286         * expression.cs: Implicity convert the result from UserCast.
13287
13288 2001-10-05  Ravi Pratap  <ravi@ximian.com>
13289
13290         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
13291         prevented it from working correctly. 
13292
13293         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
13294         merely ConvertImplicit.
13295
13296 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
13297
13298         * typemanager.cs: Make the LookupTypeContainer function static,
13299         and not per-instance.  
13300
13301         * class.cs: Make static FindMembers (the one that takes a Type
13302         argument). 
13303
13304         * codegen.cs: Add EmitForeach here.
13305
13306         * cs-parser.jay: Make foreach a toplevel object instead of the
13307         inline expansion, as we need to perform semantic analysis on it. 
13308
13309 2001-10-05  Ravi Pratap  <ravi@ximian.com>
13310
13311         * expression.cs (Expression::ImplicitUserConversion): Rename to
13312         UserDefinedConversion.
13313
13314         (Expression::UserDefinedConversion): Take an extra argument specifying 
13315         whether we look for explicit user conversions too.
13316
13317         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
13318
13319         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
13320
13321         (ExplicitUserConversion): Make it a call to UserDefinedConversion
13322         with the appropriate arguments.
13323
13324         * cs-parser.jay (cast_expression): Record location too.
13325
13326         * expression.cs (Cast): Record location info.
13327
13328         (Expression::ConvertExplicit): Take location argument.
13329
13330         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
13331         to determine if we are doing explicit conversions.
13332
13333         (UserCast::Emit): Update accordingly.
13334
13335         (Expression::ConvertExplicit): Report an error if everything fails.
13336
13337         * ../errors/cs0030.cs : Add.
13338
13339 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
13340
13341         * modifiers.cs: If the ABSTRACT keyword is present, also set the
13342         virtual and newslot bits. 
13343
13344         * class.cs (TypeContainer::RegisterRequiredImplementations):
13345         Record methods we need.
13346
13347         (TypeContainer::MakeKey): Helper function to make keys for
13348         MethodBases, since the Methodbase key is useless.
13349
13350         (TypeContainer::Populate): Call RegisterRequiredImplementations
13351         before defining the methods.   
13352
13353         Create a mapping for method_builders_to_methods ahead of time
13354         instead of inside a tight loop.
13355
13356         (::RequireMethods):  Accept an object as the data to set into the
13357         hashtable so we can report interface vs abstract method mismatch.
13358
13359 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
13360
13361         * report.cs: Make all of it static.
13362
13363         * rootcontext.cs: Drop object_type and value_type computations, as
13364         we have those in the TypeManager anyways.
13365
13366         Drop report instance variable too, now it is a global.
13367
13368         * driver.cs: Use try/catch on command line handling.
13369
13370         Add --probe option to debug the error reporting system with a test
13371         suite. 
13372
13373         * report.cs: Add support for exiting program when a probe
13374         condition is reached.
13375
13376 2001-10-03  Ravi Pratap  <ravi@ximian.com>
13377
13378         * expression.cs (Binary::DoNumericPromotions): Fix the case when
13379         we do a forcible conversion regardless of type, to check if 
13380         ForceConversion returns a null.
13381
13382         (Binary::error19): Use location to report error.
13383
13384         (Unary::error23): Use location here too.
13385
13386         * ../errors/cs0019.cs : Check in.
13387
13388         * ../errors/cs0023.cs : Check in.
13389
13390         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
13391         case of a non-null MethodInfo object with a length of 0 !
13392
13393         (Binary::ResolveOperator): Flag error if overload resolution fails to find
13394         an applicable member - according to the spec :-)
13395         Also fix logic to find members in base types.
13396
13397         (Unary::ResolveOperator): Same here.
13398
13399         (Unary::report23): Change name to error23 and make first argument a TypeContainer
13400         as I was getting thoroughly confused between this and error19 :-)
13401
13402         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
13403         (::FindMostEncompassedType): Implement.
13404         (::FindMostEncompassingType): Implement.
13405         (::StandardConversionExists): Implement.
13406
13407         (UserImplicitCast): Re-vamp. We now need info about most specific
13408         source and target types so that we can do the necessary conversions.
13409
13410         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
13411         mathematical union with no duplicates.
13412
13413 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
13414
13415         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
13416         in order from base classes to child classes, so that we can in
13417         child classes look up in our parent for method names and
13418         attributes (required for handling abstract, virtual, new, override
13419         constructs: we need to instrospect our base class, and if we dont
13420         populate the classes in order, the introspection might be
13421         incorrect.  For example, a method could query its parent before
13422         the parent has any methods and would determine that the parent has
13423         no abstract methods (while it could have had them)).
13424
13425         (RootContext::CreateType): Record the order in which we define the
13426         classes.
13427
13428 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
13429
13430         * class.cs (TypeContainer::Populate): Also method definitions can
13431         fail now, keep track of this.
13432
13433         (TypeContainer::FindMembers): Implement support for
13434         DeclaredOnly/noDeclaredOnly flag.
13435
13436         (Constructor::Emit) Return the ConstructorBuilder.
13437
13438         (Method::Emit) Return the MethodBuilder. 
13439         Check for abstract or virtual methods to be public.
13440
13441         * rootcontext.cs (RootContext::CreateType): Register all the
13442         abstract methods required for the class to be complete and the
13443         interface methods that must be implemented. 
13444
13445         * cs-parser.jay: Report error 501 (method requires body if it is
13446         not marked abstract or extern).
13447
13448         * expression.cs (TypeOf::Emit): Implement.
13449
13450         * typemanager.cs: runtime_handle_type, new global type.
13451
13452         * class.cs (Property::Emit): Generate code for properties.
13453
13454 2001-10-02  Ravi Pratap  <ravi@ximian.com>
13455
13456         * expression.cs (Unary::ResolveOperator): Find operators on base type
13457         too - we now conform exactly to the spec.
13458
13459         (Binary::ResolveOperator): Same here.
13460
13461         * class.cs (Operator::Define): Fix minor quirk in the tests.
13462
13463         * ../errors/cs0215.cs : Added.
13464
13465         * ../errors/cs0556.cs : Added.
13466
13467         * ../errors/cs0555.cs : Added.
13468
13469 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
13470
13471         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
13472         single integer which is really efficient
13473
13474 2001-10-01  Ravi Pratap  <ravi@ximian.com>
13475
13476         *  expression.cs (Expression::ImplicitUserConversion): Use location
13477         even in the case when we are examining True operators.
13478  
13479         * class.cs (Operator::Define): Perform extensive checks to conform
13480         with the rules for operator overloading in the spec.
13481
13482         * expression.cs (Expression::ImplicitReferenceConversion): Implement
13483         some of the other conversions mentioned in the spec.
13484
13485         * typemanager.cs (array_type): New static member for the System.Array built-in
13486         type.
13487
13488         (cloneable_interface): For System.ICloneable interface.
13489
13490         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
13491         we start resolving the tree and populating types.
13492
13493         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
13494  
13495 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
13496
13497         * expression.cs (Expression::ExprClassFromMemberInfo,
13498         Expression::Literalize): Create literal expressions from
13499         FieldInfos which are literals.
13500
13501         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
13502         type casts, because they were wrong.  The test suite in tests
13503         caught these ones.
13504
13505         (ImplicitNumericConversion): ushort to ulong requires a widening
13506         cast. 
13507
13508         Int32 constant to long requires widening cast as well.
13509
13510         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
13511         for integers because the type on the stack is not i4.
13512
13513 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
13514
13515         * expression.cs (report118): require location argument. 
13516
13517         * parameter.cs: Do not dereference potential null value.
13518
13519         * class.cs: Catch methods that lack the `new' keyword when
13520         overriding a name.  Report warnings when `new' is used without
13521         anything being there to override.
13522
13523         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
13524
13525         * class.cs: Only add constructor to hashtable if it is non-null
13526         (as now constructors can fail on define).
13527
13528         (TypeManager, Class, Struct): Take location arguments.
13529
13530         Catch field instance initialization in structs as errors.
13531
13532         accepting_filter: a new filter for FindMembers that is static so
13533         that we dont create an instance per invocation.
13534
13535         (Constructor::Define): Catch errors where a struct constructor is
13536         parameterless 
13537
13538         * cs-parser.jay: Pass location information for various new
13539         constructs. 
13540
13541         * delegate.cs (Delegate): take a location argument.
13542
13543         * driver.cs: Do not call EmitCode if there were problesm in the
13544         Definition of the types, as many Builders wont be there. 
13545
13546         * decl.cs (Decl::Decl): Require a location argument.
13547
13548         * cs-tokenizer.cs: Handle properly hex constants that can not fit
13549         into integers, and find the most appropiate integer for it.
13550
13551         * literal.cs: Implement ULongLiteral.
13552
13553         * rootcontext.cs: Provide better information about the location of
13554         failure when CreateType fails.
13555
13556 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
13557
13558         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
13559         as well.
13560
13561         * expression.cs (Binary::CheckShiftArguments): Add missing type
13562         computation.
13563         (Binary::ResolveOperator): Add type to the logical and and logical
13564         or, Bitwise And/Or and Exclusive Or code paths, it was missing
13565         before.
13566
13567         (Binary::DoNumericPromotions): In the case where either argument
13568         is ulong (and most signed types combined with ulong cause an
13569         error) perform implicit integer constant conversions as well.
13570
13571 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
13572
13573         * expression.cs (UserImplicitCast): Method should always be
13574         non-null. 
13575         (Invocation::BetterConversion): Simplified test for IntLiteral.
13576
13577         (Expression::ImplicitNumericConversion): Split this routine out.
13578         Put the code that performs implicit constant integer conversions
13579         here. 
13580
13581         (Expression::Resolve): Become a wrapper around DoResolve so we can
13582         check eclass and type being set after resolve.
13583
13584         (Invocation::Badness): Remove this dead function
13585
13586         (Binary::ResolveOperator): Do not compute the expensive argumnets
13587         unless we have a union for it.
13588
13589         (Probe::Emit): Is needs to do an isinst and then
13590         compare against null.
13591
13592         (::CanConvert): Added Location argument.  If the Location argument
13593         is null (Location.Null), then we do not report errors.  This is
13594         used by the `probe' mechanism of the Explicit conversion.  We do
13595         not want to generate an error for something that the user
13596         explicitly requested to be casted.  But the pipeline for an
13597         explicit cast first tests for potential implicit casts.
13598
13599         So for now, if the Location is null, it means `Probe only' to
13600         avoid adding another argument.   Might have to revise this
13601         strategy later.
13602
13603         (ClassCast): New class used to type cast objects into arbitrary
13604         classes (used in Explicit Reference Conversions).
13605
13606         Implement `as' as well.
13607
13608         Reverted all the patches from Ravi below: they were broken:
13609
13610                 * The use of `level' as a mechanism to stop recursive
13611                   invocations is wrong.  That was there just to catch the
13612                   bug with a strack trace but not as a way of addressing
13613                   the problem.
13614
13615                   To fix the problem we have to *understand* what is going
13616                   on and the interactions and come up with a plan, not
13617                   just get things going.
13618
13619                 * The use of the type conversion cache that I proposed
13620                   last night had an open topic: How does this work across
13621                   protection domains.  A user defined conversion might not
13622                   be public in the location where we are applying the
13623                   conversion, a different conversion might be selected
13624                   (ie, private A->B (better) but public B->A (worse),
13625                   inside A, A->B applies, but outside it, B->A will
13626                   apply).
13627
13628                 * On top of that (ie, even if the above is solved),
13629                   conversions in a cache need to be abstract.  Ie, `To
13630                   convert from an Int to a Short use an OpcodeCast', not
13631                   `To convert from an Int to a Short use the OpcodeCast on
13632                   the variable 5' (which is what this patch was doing).
13633
13634 2001-09-28  Ravi Pratap  <ravi@ximian.com>
13635
13636         * expression.cs (Invocation::ConversionExists): Re-write to use
13637         the conversion cache
13638
13639         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
13640         cache all conversions done, not just user-defined ones.
13641
13642         (Invocation::BetterConversion): The real culprit. Use ConversionExists
13643         to determine if a conversion exists instead of acutually trying to 
13644         perform the conversion. It's faster too.
13645
13646         (Expression::ConvertExplicit): Modify to use ConversionExists to check
13647         and only then attempt the implicit conversion.
13648
13649 2001-09-28  Ravi Pratap  <ravi@ximian.com>
13650
13651         * expression.cs (ConvertImplicit): Use a cache for conversions
13652         already found. Check level of recursion and bail out if necessary.
13653
13654 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
13655
13656         * typemanager.cs (string_concat_string_string, string_concat_object_object):
13657         Export standard methods that we expect for string operations.
13658
13659         * statement.cs (Block::UsageWarning): Track usage of variables and
13660         report the errors for not used variables.
13661
13662         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
13663         operator. 
13664
13665 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * codegen.cs: remove unnneded code 
13668
13669         * expression.cs: Removed BuiltinTypeAccess class
13670
13671         Fix the order in which implicit conversions are
13672         done.  
13673
13674         The previous fixed dropped support for boxed conversions (adding a
13675         test to the test suite now)
13676
13677         (UserImplicitCast::CanConvert): Remove test for source being null,
13678         that code is broken.  We should not feed a null to begin with, if
13679         we do, then we should track the bug where the problem originates
13680         and not try to cover it up here.
13681
13682         Return a resolved expression of type UserImplicitCast on success
13683         rather than true/false.  Ravi: this is what I was talking about,
13684         the pattern is to use a static method as a "constructor" for
13685         objects. 
13686
13687         Also, do not create arguments until the very last minute,
13688         otherwise we always create the arguments even for lookups that
13689         will never be performed. 
13690
13691         (UserImplicitCast::Resolve): Eliminate, objects of type
13692         UserImplicitCast are born in a fully resolved state. 
13693
13694         * typemanager.cs (InitCoreTypes): Init also value_type
13695         (System.ValueType). 
13696
13697         * expression.cs (Cast::Resolve): First resolve the child expression.
13698
13699         (LValue): Add new method AddressOf to be used by
13700         the `&' operator.  
13701
13702         Change the argument of Store to take an EmitContext instead of an
13703         ILGenerator, because things like FieldExpr need to be able to call
13704         their children expression to generate the instance code. 
13705
13706         (Expression::Error, Expression::Warning): Sugar functions for
13707         reporting errors.
13708
13709         (Expression::MemberLookup): Accept a TypeContainer instead of a
13710         Report as the first argument.
13711
13712         (Expression::ResolvePrimary): Killed.  I still want to improve
13713         this as currently the code is just not right.
13714
13715         (Expression::ResolveMemberAccess): Simplify, but it is still
13716         wrong. 
13717
13718         (Unary::Resolve): Catch errors in AddressOf operators.
13719
13720         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
13721         index to a byte for the short-version, or the compiler will choose
13722         the wrong Emit call, which generates the wrong data.
13723
13724         (ParameterReference::Emit, ::Store): same.
13725
13726         (FieldExpr::AddressOf): Implement.
13727
13728         * typemanager.cs: TypeManager: made public variable instead of
13729         property.
13730
13731         * driver.cs: document --fatal.
13732
13733         * report.cs (ErrorMessage, WarningMessage): new names for the old
13734         Error and Warning classes.
13735
13736         * cs-parser.jay (member_access): Turn built-in access to types
13737         into a normal simplename
13738
13739 2001-09-27  Ravi Pratap  <ravi@ximian.com>
13740
13741         * expression.cs (Invocation::BetterConversion): Fix to cope
13742         with q being null, since this was introducing a bug.
13743
13744         * expression.cs (ConvertImplicit): Do built-in conversions first.
13745
13746 2001-09-27  Ravi Pratap  <ravi@ximian.com>
13747
13748         * expression.cs (UserImplicitCast::Resolve): Fix bug.
13749
13750 2001-09-27  Ravi Pratap  <ravi@ximian.com>
13751
13752         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
13753         I had introduced long ago (what's new ?).
13754
13755         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
13756         the work of all the checking. 
13757         (ConvertImplicit): Call CanConvert and only then create object if necessary.
13758         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
13759
13760         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
13761         that is the right way. 
13762
13763         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
13764         overloading resolution. Use everywhere instead of cutting and pasting code.
13765
13766         (Binary::ResolveOperator): Use MakeUnionSet.
13767
13768         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
13769         we have to convert to bool types. Not complete yet.
13770
13771 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
13772
13773         * typemanager.cs (TypeManager::CSharpName): support ushort.
13774
13775         * expression.cs (Expression::TryImplicitIntConversion): Attempts
13776         to provide an expression that performsn an implicit constant int
13777         conversion (section 6.1.6).
13778         (Expression::ConvertImplicitRequired): Reworked to include
13779         implicit constant expression conversions.
13780
13781         (Expression::ConvertNumericExplicit): Finished.
13782
13783         (Invocation::Emit): If InstanceExpression is null, then it means
13784         that we perform a call on this.
13785
13786 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * expression.cs (Unary::Emit): Remove some dead code.
13789         (Probe): Implement Resolve and Emit for `is'.
13790         (Expression::ConvertImplicitRequired): Attempt to do constant
13791         expression conversions here.  Maybe should be moved to
13792         ConvertImplicit, but I am not sure.
13793         (Expression::ImplicitLongConstantConversionPossible,
13794         Expression::ImplicitIntConstantConversionPossible): New functions
13795         that tell whether is it possible to apply an implicit constant
13796         expression conversion.
13797
13798         (ConvertNumericExplicit): Started work on explicit numeric
13799         conversions.
13800
13801         * cs-parser.jay: Update operator constants.
13802
13803         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
13804         (Parameters::GetSignature): Hook up VerifyArgs here.
13805         (Parameters::VerifyArgs): Verifies that no two arguments have the
13806         same name. 
13807
13808         * class.cs (Operator): Update the operator names to reflect the
13809         ones that the spec expects (as we are just stringizing the
13810         operator names).
13811
13812         * expression.cs (Unary::ResolveOperator): Fix bug: Use
13813         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
13814         previous usage did only work for our methods.
13815         (Expression::ConvertImplicit): Handle decimal implicit numeric
13816         conversions as well.
13817         (Expression::InternalTypeConstructor): Used to invoke constructors
13818         on internal types for default promotions.
13819
13820         (Unary::Emit): Implement special handling for the pre/post
13821         increment/decrement for overloaded operators, as they need to have
13822         the same semantics as the other operators.
13823
13824         (Binary::ResolveOperator): ditto.
13825         (Invocation::ConversionExists): ditto.
13826         (UserImplicitCast::Resolve): ditto.
13827
13828 2001-09-26  Ravi Pratap  <ravi@ximian.com>
13829
13830         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
13831         operator, return after emitting body. Regression tests pass again !
13832
13833         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
13834         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
13835         (Invocation::OverloadResolve): Ditto.
13836         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
13837
13838         * everywhere : update calls to the above methods accordingly.
13839
13840 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * assign.cs (Assign): Make it inherit from ExpressionStatement.
13843
13844         * expression.cs (ExpressionStatement): New base class used for
13845         expressions that can appear in statements, so that we can provide
13846         an alternate path to generate expression that do not leave a value
13847         on the stack.
13848
13849         (Expression::Emit, and all the derivatives): We no longer return
13850         whether a value is left on the stack or not.  Every expression
13851         after being emitted leaves a single value on the stack.
13852
13853         * codegen.cs (EmitContext::EmitStatementExpression): Use the
13854         facilties of ExpressionStatement if possible.
13855
13856         * cs-parser.jay: Update statement_expression.
13857
13858 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
13859
13860         * driver.cs: Change the wording of message
13861
13862 2001-09-25  Ravi Pratap  <ravi@ximian.com>
13863
13864         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
13865         the type of the expression to the return type of the method if
13866         we have an overloaded operator match ! The regression tests pass again !
13867         (Unary::ResolveOperator): Ditto.
13868
13869         * expression.cs (Invocation::ConversionExists): Correct the member lookup
13870         to find "op_Implicit", not "implicit" ;-)
13871         (UserImplicitCast): New class to take care of user-defined implicit conversions.
13872         (ConvertImplicit, ForceConversion): Take TypeContainer argument
13873
13874         * everywhere : Correct calls to the above accordingly.
13875
13876         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
13877         (ConvertImplicit): Do user-defined conversion if it exists.
13878
13879 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * assign.cs: track location.
13882         (Resolve): Use implicit conversions on assignment.
13883
13884         * literal.cs: Oops.  Not good, Emit of short access values should
13885         pass (Bytes) or the wrong argument will be selected.
13886
13887         * expression.cs (Unary::Emit): Emit code for -expr.
13888
13889         (Unary::ResolveOperator): Handle `Substract' for non-constants
13890         (substract from zero from the non-constants).
13891         Deal with Doubles as well. 
13892
13893         (Expression::ConvertImplicitRequired): New routine that reports an
13894         error if no implicit conversion exists. 
13895
13896         (Invocation::OverloadResolve): Store the converted implicit
13897         expressions if we make them
13898
13899 2001-09-24  Ravi Pratap  <ravi@ximian.com>
13900
13901         * class.cs (ConstructorInitializer): Take a Location argument.
13902         (ConstructorBaseInitializer): Same here.
13903         (ConstructorThisInitializer): Same here.
13904
13905         * cs-parser.jay : Update all calls accordingly.
13906
13907         * expression.cs (Unary, Binary, New): Take location argument.
13908         Update accordingly everywhere.
13909
13910         * cs-parser.jay : Update all calls to the above to take a location
13911         argument.
13912
13913         * class.cs : Ditto.
13914
13915 2001-09-24  Ravi Pratap  <ravi@ximian.com>
13916
13917         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
13918         (Invocation::BetterConversion): Same here
13919         (Invocation::ConversionExists): Ditto.
13920
13921         (Invocation::ConversionExists): Implement.
13922
13923 2001-09-22  Ravi Pratap  <ravi@ximian.com>
13924
13925         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
13926         Also take an additional TypeContainer argument.
13927
13928         * All over : Pass in TypeContainer as argument to OverloadResolve.
13929
13930         * typemanager.cs (CSharpName): Update to check for the string type and return
13931         that too.
13932
13933         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
13934         a given method.
13935
13936 2001-09-21  Ravi Pratap  <ravi@ximian.com>
13937
13938         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
13939         (Invocation::BetterFunction): Implement.
13940         (Invocation::BetterConversion): Implement.
13941         (Invocation::ConversionExists): Skeleton, no implementation yet.
13942
13943         Okay, things work fine !
13944
13945 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * typemanager.cs: declare and load enum_type, delegate_type and
13948         void_type. 
13949
13950         * expression.cs (Expression::Emit): Now emit returns a value that
13951         tells whether a value is left on the stack or not.  This strategy
13952         might be reveted tomorrow with a mechanism that would address
13953         multiple assignments.
13954         (Expression::report118): Utility routine to report mismatches on
13955         the ExprClass.
13956
13957         (Unary::Report23): Report impossible type/operator combination
13958         utility function.
13959
13960         (Unary::IsIncrementableNumber): Whether the type can be
13961         incremented or decremented with add.
13962         (Unary::ResolveOperator): Also allow enumerations to be bitwise
13963         complemented. 
13964         (Unary::ResolveOperator): Implement ++, !, ~,
13965
13966         (Invocation::Emit): Deal with new Emit convetion.
13967
13968         * All Expression derivatives: Updated their Emit method to return
13969         whether they leave values on the stack or not.
13970
13971         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
13972         stack for expressions that are statements. 
13973
13974 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * expression.cs (LValue): New interface.  Must be implemented by
13977         LValue objects.
13978         (LocalVariableReference, ParameterReference, FieldExpr): Implement
13979         LValue interface.
13980
13981         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
13982         interface for generating code, simplifies the code.
13983
13984 2001-09-20  Ravi Pratap  <ravi@ximian.com>
13985
13986         * expression.cs (everywhere): Comment out return statements in ::Resolve
13987         methods to avoid the warnings.
13988
13989 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
13990
13991         * driver.cs (parse): Report error 2001 if we can not open the
13992         source file.
13993
13994         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
13995         not resolve it.
13996
13997         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
13998         object. 
13999
14000         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
14001         otherwise nested blocks end up with the same index.
14002
14003         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
14004
14005         * expression.cs:  Instead of having FIXMEs in the Resolve
14006         functions, throw exceptions so it is obvious that we are facing a
14007         bug. 
14008
14009         * cs-parser.jay (invocation_expression): Pass Location information.
14010
14011         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
14012         Use a basename for those routines because .NET does not like paths
14013         on them. 
14014
14015         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
14016         already defined.
14017
14018 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
14019
14020         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
14021         are loading the correct data types (throws an exception if not).
14022         (TypeManager::InitCoreTypes): Use CoreLookupType
14023
14024         * expression.cs (Unary::ResolveOperator): return the child
14025         expression for expressions which are just +expr.
14026         (Unary::ResolveOperator): Return negative literals for -LITERAL
14027         expressions (otherwise they are Unary {Literal}).
14028         (Invocation::Badness): Take into account `Implicit constant
14029         expression conversions'.
14030
14031         * literal.cs (LongLiteral): Implement long literal class.
14032         (IntLiteral): export the `Value' of the intliteral. 
14033
14034 2001-09-19  Ravi Pratap  <ravi@ximian.com>
14035
14036         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
14037
14038         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
14039         instead of 'Operator'
14040
14041         * expression.cs (Binary::ResolveOperator): Update accordingly.
14042         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
14043         and 'Minus'
14044
14045         * cs-parser.jay (unary_expression): Update to use the new names.
14046
14047         * gen-treedump.cs (GetUnary): Same here.
14048
14049         * expression.cs (Unary::Resolve): Implement.
14050         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
14051         operators are found instead of making noise ;-)
14052         (Unary::ResolveOperator): New method to do precisely the same thing which
14053         Binary::ResolveOperator does for Binary expressions.
14054         (Unary.method, .Arguments): Add.
14055         (Unary::OperName): Implement.   
14056         (Unary::ForceConversion): Copy and Paste !
14057
14058         * class.cs (Operator::Define): Fix a small bug for the case when we have 
14059         a unary operator.
14060
14061         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
14062         for the inbuilt operators. Only overloading works for now ;-)
14063
14064 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
14067         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
14068
14069         * expression.cs (This::Emit): Implement. 
14070         (This::Resolve): Implement.
14071         (TypeOf:Resolve): Implement.
14072         (Expression::ResolveSimpleName): Add an implicit this to instance
14073         field references. 
14074         (MemberAccess::Resolve): Deal with Parameters and Fields. 
14075         Bind instance variable to Field expressions.
14076         (FieldExpr::Instance): New field used to track the expression that
14077         represents the object instance.
14078         (FieldExpr::Resolve): Track potential errors from MemberLookup not
14079         binding 
14080         (FieldExpr::Emit): Implement.
14081
14082         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
14083         the last instruction contains a return opcode to avoid generating
14084         the last `ret' instruction (this generates correct code, and it is
14085         nice to pass the peverify output).
14086
14087         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
14088         initializer for static and instance variables.
14089         (Constructor::Emit): Allow initializer to be null in the case of
14090         static constructors.  Only emit initializer for instance
14091         constructors. 
14092
14093         (TypeContainer::FindMembers): Return a null array if there are no
14094         matches.
14095
14096         Also fix the code for the MemberTypes.Method branch, as it was not
14097         scanning that for operators (or tried to access null variables before).
14098
14099         * assign.cs (Assign::Emit): Handle instance and static fields. 
14100
14101         * TODO: Updated.
14102
14103         * driver.cs: Stop compilation if there are parse errors.
14104
14105         * cs-parser.jay (constructor_declaration): Provide default base
14106         initializer for non-static constructors.
14107         (constructor_declarator): Do not provide a default base
14108         initializers if none was specified.
14109         Catch the fact that constructors should not have parameters.
14110
14111         * class.cs: Do not emit parent class initializers for static
14112         constructors, that should be flagged as an error.
14113
14114 2001-09-18  Ravi Pratap  <ravi@ximian.com>
14115
14116         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
14117         Move back code into TypeContainer::Populate.
14118
14119 2001-09-18  Ravi Pratap  <ravi@ximian.com>
14120
14121         * class.cs (TypeContainer::AddConstructor): Fix the check to
14122         compare against Name, not Basename. 
14123         (Operator::OpType): Change Plus and Minus to Add and Subtract.
14124
14125         * cs-parser.jay : Update accordingly.
14126
14127         * class.cs (TypeContainer::FindMembers): For the case where we are searching
14128         for methods, don't forget to look into the operators too.
14129         (RegisterMethodBuilder): Helper method to take care of this for
14130         methods, constructors and operators.
14131         (Operator::Define): Completely revamp.
14132         (Operator.OperatorMethod, MethodName): New fields.
14133         (TypeContainer::Populate): Move the registering of builders into
14134         RegisterMethodBuilder.
14135         (Operator::Emit): Re-write.
14136
14137         * expression.cs (Binary::Emit): Comment out code path to emit method
14138         invocation stuff for the case when we have a user defined operator. I am
14139         just not able to get it right !
14140
14141 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
14142
14143         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
14144         argument. 
14145
14146         (Expression::MemberLookup): Provide a version that allows to
14147         specify the MemberTypes and BindingFlags. 
14148
14149         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
14150         so it was not fetching variable information from outer blocks.
14151
14152         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
14153         Beforefieldinit as it was buggy.
14154
14155         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
14156         that Ravi put here.  
14157
14158         * class.cs (Constructor::Emit): Only emit if block is not null.
14159         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
14160         deal with this by semantically definining it as if the user had
14161         done it.
14162
14163         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
14164         constructors as we now "emit" them at a higher level.
14165
14166         (TypeContainer::DefineDefaultConstructor): Used to define the
14167         default constructors if none was provided.
14168
14169         (ConstructorInitializer): Add methods Resolve and Emit. 
14170
14171         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
14172
14173 2001-09-17  Ravi Pratap  <ravi@ximian.com>
14174
14175         * class.cs (TypeContainer::EmitDefaultConstructor): Register
14176         the default constructor builder with our hashtable for methodbuilders
14177         to methodcores.
14178
14179         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
14180         and argument_count is 0 in which case we have a match.
14181         (Binary::ResolveOperator): More null checking and miscellaneous coding
14182         style cleanup.
14183
14184 2001-09-17  Ravi Pratap  <ravi@ximian.com>
14185
14186         * rootcontext.cs (IsNameSpace): Compare against null.
14187
14188         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
14189
14190         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
14191         and Unary::Operator.
14192
14193         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
14194         accordingly.
14195
14196         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
14197         we have overloaded operators.
14198         (Binary::ResolveOperator): Implement the part which does the operator overload
14199         resolution.
14200
14201         * class.cs (Operator::Emit): Implement.
14202         (TypeContainer::Emit): Emit the operators we have too.
14203
14204         * expression.cs (Binary::Emit): Update to emit the appropriate code for
14205         the case when we have a user-defined operator.
14206
14207 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
14208
14209         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
14210
14211 2001-09-16  Ravi Pratap  <ravi@ximian.com>
14212
14213         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
14214         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
14215         (Constructor::Emit): Implement.
14216         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
14217         if we have no work to do. 
14218         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
14219         Emit method.
14220
14221         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
14222         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
14223
14224         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
14225         of parent.parent.
14226
14227 2001-09-15  Ravi Pratap  <ravi@ximian.com>
14228
14229         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
14230         in the source.
14231         (Tree::RecordNamespace): Method to do what the name says ;-)
14232         (Tree::Namespaces): Property to get at the namespaces hashtable.
14233
14234         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
14235         keep track.
14236
14237         * rootcontext.cs (IsNamespace): Fixed it :-)
14238
14239 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
14240
14241         * class.cs (TypeContainer::FindMembers): Add support for
14242         constructors. 
14243         (MethodCore): New class that encapsulates both the shared aspects
14244         of a Constructor and a Method.  
14245         (Method, Constructor): Factored pieces into MethodCore.
14246
14247         * driver.cs: Added --fatal which makes errors throw exceptions.
14248         Load System assembly as well as part of the standard library.
14249
14250         * report.cs: Allow throwing exceptions on errors for debugging.
14251
14252         * modifiers.cs: Do not use `parent', instead use the real type
14253         container to evaluate permission settings.
14254
14255         * class.cs: Put Ravi's patch back in.  He is right, and we will
14256         have to cope with the
14257
14258 2001-09-14  Ravi Pratap  <ravi@ximian.com>
14259
14260         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
14261         FamORAssem, not FamANDAssem.
14262
14263 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
14264
14265         * driver.cs: Added --parse option that only parses its input files
14266         and terminates.
14267
14268         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
14269         incorrect.  IsTopLevel is not used to tell whether an object is
14270         root_types or not (that can be achieved by testing this ==
14271         root_types).  But to see if this is a top-level *class* (not
14272         necessarly our "toplevel" container). 
14273
14274 2001-09-14  Ravi Pratap  <ravi@ximian.com>
14275
14276         * enum.cs (Enum::Define): Modify to call the Lookup method on the
14277         parent instead of a direct call to GetType.
14278
14279 2001-09-14  Ravi Pratap  <ravi@ximian.com>
14280
14281         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
14282         Modifiers.TypeAttr. This should just be a call to that method.
14283
14284         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
14285         object so that we can determine if we are top-level or not.
14286
14287         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
14288         TypeContainer too.
14289
14290         * enum.cs (Enum::Define): Ditto.
14291
14292         * modifiers.cs (FieldAttr): Re-write.
14293
14294         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
14295         (TypeContainer::HaveStaticConstructor): New property to provide access
14296         to precisely that info.
14297
14298         * modifiers.cs (MethodAttr): Re-write.
14299         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
14300
14301         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
14302         of top-level types as claimed.
14303
14304 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
14305
14306         * expression.cs (MemberLookup): Fruitless attempt to lookup
14307         constructors.  Maybe I need to emit default constructors?  That
14308         might be it (currently .NET emits this for me automatically).
14309         (Invocation::OverloadResolve): Cope with Arguments == null.
14310         (Invocation::EmitArguments): new function, shared by the new
14311         constructor and us.
14312         (Invocation::Emit): Handle static and instance methods.  Emit
14313         proper call instruction for virtual or non-virtual invocations.
14314         (New::Emit): Implement.
14315         (New::Resolve): Implement.
14316         (MemberAccess:Resolve): Implement.
14317         (MethodGroupExpr::InstanceExpression): used conforming to the spec
14318         to track instances.
14319         (FieldExpr::Resolve): Set type.
14320
14321         * support.cs: Handle empty arguments.
14322                 
14323         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
14324         SimpleLookup): Auxiliary routines to help parse a qualifier
14325         identifier.  
14326
14327         Update qualifier_identifier rule.
14328
14329         * codegen.cs: Removed debugging messages.
14330
14331         * class.cs: Make this a global thing, this acts just as a "key" to
14332         objects that we might have around.
14333
14334         (Populate): Only initialize method_builders_to_methods once.
14335
14336         * expression.cs (PropertyExpr): Initialize type from the
14337         PropertyType. 
14338
14339         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
14340         Resolve pattern.  Attempt to implicitly convert value to boolean.
14341         Emit code.
14342
14343         * expression.cs: Set the type for the int32/int32 argument case.
14344         (Binary::ResolveOperator): Set the return type to boolean for
14345         comparission operators
14346
14347         * typemanager.cs: Remove debugging print code.
14348
14349         (Invocation::Resolve): resolve type.
14350
14351         * class.cs: Allocate a MemberInfo of the correct size, as the code
14352         elsewhere depends on the test to reflect the correct contents.
14353
14354         (Method::) Keep track of parameters, due to System.Reflection holes
14355
14356         (TypeContainer::Populate): Keep track of MethodBuilders to Method
14357         mapping here.
14358
14359         (TypeContainer::FindMembers): Use ArrayList and then copy an array
14360         of the exact size and return that.
14361
14362         (Class::LookupMethodByBuilder): New function that maps
14363         MethodBuilders to its methods.  Required to locate the information
14364         on methods because System.Reflection bit us again.
14365
14366         * support.cs: New file, contains an interface ParameterData and
14367         two implementations: ReflectionParameters and InternalParameters
14368         used to access Parameter information.  We will need to grow this
14369         as required.
14370
14371         * expression.cs (Invocation::GetParameterData): implement a cache
14372         and a wrapper around the ParameterData creation for methods. 
14373         (Invocation::OverloadResolve): Use new code.
14374
14375 2001-09-13  Ravi Pratap  <ravi@ximian.com>
14376
14377         * class.cs (TypeContainer::EmitField): Remove and move into 
14378         (Field::Define): here and modify accordingly.
14379         (Field.FieldBuilder): New member.
14380         (TypeContainer::Populate): Update accordingly.
14381         (TypeContainer::FindMembers): Implement.
14382
14383 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
14384
14385         * statement.cs: (VariableInfo::VariableType): New field to be
14386         initialized with the full type once it is resolved. 
14387
14388 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
14389
14390         * parameter.cs (GetParameterInfo): Use a type cache to compute
14391         things only once, and to reuse this information
14392
14393         * expression.cs (LocalVariableReference::Emit): Implement.
14394         (OpcodeCast::Emit): fix.
14395
14396         (ParameterReference::Resolve): Implement.
14397         (ParameterReference::Emit): Implement.
14398
14399         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
14400         that are expressions need to stay as Expressions.
14401
14402         * typemanager.cs (CSharpName): Returns the C# name of a type if
14403         possible. 
14404
14405         * expression.cs (Expression::ConvertImplicit): New function that
14406         implements implicit type conversions.
14407
14408         (Expression::ImplicitReferenceConversion): Implements implicit
14409         reference conversions.
14410
14411         (EmptyCast): New type for transparent casts.
14412
14413         (OpcodeCast): New type for casts of types that are performed with
14414         a sequence of bytecodes.
14415
14416         (BoxedCast): New type used for casting value types into reference
14417         types.  Emits a box opcode.
14418
14419         (Binary::DoNumericPromotions): Implements numeric promotions of
14420         and computation of the Binary::Type.
14421
14422         (Binary::EmitBranchable): Optimization.
14423
14424         (Binary::Emit): Implement code emission for expressions.
14425
14426         * typemanager.cs (TypeManager): Added two new core types: sbyte
14427         and byte.
14428
14429 2001-09-12  Ravi Pratap  <ravi@ximian.com>
14430
14431         * class.cs (TypeContainer::FindMembers): Method which does exactly
14432         what Type.FindMembers does, only we don't have to use reflection. No
14433         implementation yet.
14434
14435         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
14436         typecontainer objects as we need to get at them.
14437         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
14438
14439         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
14440         typecontainer object.
14441
14442         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
14443         of just a Report object.
14444
14445 2001-09-11  Ravi Pratap  <ravi@ximian.com>
14446
14447         * class.cs (Event::Define): Go back to using the prefixes "add_" and
14448         "remove_"
14449         (TypeContainer::Populate): Now define the delegates of the type too.
14450         (TypeContainer.Delegates): Property to access the list of delegates defined
14451         in the type.
14452
14453         * delegates.cs (Delegate::Define): Implement partially.
14454
14455         * modifiers.cs (TypeAttr): Handle more flags.
14456
14457 2001-09-11  Ravi Pratap  <ravi@ximian.com>
14458
14459         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
14460         and not <=
14461         (Operator::Define): Re-write logic to get types by using the LookupType method
14462         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
14463         (Indexer::Define): Ditto.
14464         (Event::Define): Ditto.
14465         (Property::Define): Ditto.
14466
14467 2001-09-10  Ravi Pratap  <ravi@ximian.com>
14468
14469         * class.cs (TypeContainer::Populate): Now define operators too. 
14470         (TypeContainer.Operators): New property to access the list of operators
14471         in a type.
14472         (Operator.OperatorMethodBuilder): New member to hold the method builder
14473         for the operator we are defining.
14474         (Operator::Define): Implement.
14475
14476 2001-09-10  Ravi Pratap  <ravi@ximian.com>
14477
14478         * class.cs (Event::Define): Make the prefixes of the accessor methods
14479         addOn_ and removeOn_ 
14480
14481         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
14482         of the location being passed in too. Ideally, this should go later since all
14483         error reporting should be done through the Report object.
14484
14485         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
14486         (Populate): Iterate thru the indexers we have and define them too.
14487         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
14488         for the get and set accessors.
14489         (Indexer::Define): Implement.
14490
14491 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
14492
14493         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
14494         my previous implementation, did not work.
14495
14496         * typemanager.cs: Add a couple of missing types (the longs).
14497
14498         * literal.cs: Use TypeManager.bool_type instead of getting it.
14499
14500         * expression.cs (EventExpr): New kind of expressions.
14501         (Expressio::ExprClassFromMemberInfo): finish
14502
14503 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
14504
14505         * assign.cs: Emit stores to static fields differently.
14506
14507 2001-09-08  Ravi Pratap  <ravi@ximian.com>
14508
14509         * Merge in changes and adjust code to tackle conflicts. Backed out my
14510         code in Assign::Resolve ;-) 
14511
14512 2001-09-08  Ravi Pratap  <ravi@ximian.com>
14513
14514         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
14515         instead Report.Error and also pass in the location.
14516         (CSharpParser::Lexer): New readonly property to return the reference
14517         to the Tokenizer object.
14518         (declare_local_variables): Use Report.Error with location instead of plain 
14519         old error.
14520         (CheckDef): Ditto.
14521
14522         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
14523         (Operator.CheckBinaryOperator): Ditto.
14524
14525         * cs-parser.jay (operator_declarator): Update accordingly.
14526
14527         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
14528         (CheckBinaryOperator): Same here.
14529
14530         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
14531         on the name without any prefixes of namespace names etc. This is because we
14532         already might have something already fully qualified like 
14533         'System.Console.WriteLine'
14534
14535         * assign.cs (Resolve): Begin implementation. Stuck ;-)
14536
14537 2001-09-07  Ravi Pratap  <ravi@ximian.com>
14538
14539         * cs-tokenizer.cs (location): Return a string which also contains
14540         the file name.
14541
14542         * expression.cs (ElementAccess): New class for expressions of the
14543         type 'element access.'
14544         (BaseAccess): New class for expressions of the type 'base access.'
14545         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
14546         respectively.
14547
14548         * cs-parser.jay (element_access): Implement action.
14549         (base_access): Implement actions.
14550         (checked_expression, unchecked_expression): Implement.
14551
14552         * cs-parser.jay (local_variable_type): Correct and implement.
14553         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
14554
14555         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
14556
14557         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
14558         name and the specifiers.
14559
14560         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
14561
14562         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
14563         making them all public ;-)
14564
14565         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
14566         class anyways.
14567
14568 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
14571         PropertyExprs.
14572         (FieldExpr, PropertyExprs): New resolved expressions.
14573         (SimpleName::MemberStaticCheck): Perform static checks for access
14574         to non-static fields on static methods. Maybe this should be
14575         generalized for MemberAccesses. 
14576         (SimpleName::ResolveSimpleName): More work on simple name
14577         resolution. 
14578
14579         * cs-parser.jay (primary_expression/qualified_identifier): track
14580         the parameter index.
14581
14582         * codegen.cs (CodeGen::Save): Catch save exception, report error.
14583         (EmitContext::EmitBoolExpression): Chain to expression generation
14584         instead of temporary hack.
14585         (::EmitStatementExpression): Put generic expression code generation.
14586
14587         * assign.cs (Assign::Emit): Implement variable assignments to
14588         local variables, parameters and fields.
14589
14590 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * statement.cs (Block::GetVariableInfo): New method, returns the
14593         VariableInfo for a variable name in a block.
14594         (Block::GetVariableType): Implement in terms of GetVariableInfo
14595
14596         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
14597         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
14598
14599 2001-09-06  Ravi Pratap  <ravi@ximian.com>
14600
14601         * cs-parser.jay (operator_declaration): Continue on my quest : update
14602         to take attributes argument.
14603         (event_declaration): Ditto.
14604         (enum_declaration): Ditto.
14605         (indexer_declaration): Ditto.
14606
14607         * class.cs (Operator::Operator): Update constructor accordingly.
14608         (Event::Event): Ditto.
14609
14610         * delegate.cs (Delegate::Delegate): Same here.
14611
14612         * enum.cs (Enum::Enum): Same here.
14613
14614 2001-09-05  Ravi Pratap  <ravi@ximian.com>
14615
14616         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
14617
14618         * ../tests/cs0658.cs : New file to demonstrate error 0658.
14619
14620         * attribute.cs (Attributes): New class to encapsulate all attributes which were
14621         being passed around as an arraylist.
14622         (Attributes::AddAttribute): Method to add attribute sections.
14623
14624         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
14625         (struct_declaration): Update accordingly.
14626         (constant_declaration): Update.
14627         (field_declaration): Update.
14628         (method_header): Update.
14629         (fixed_parameter): Update.
14630         (parameter_array): Ditto.
14631         (property_declaration): Ditto.
14632         (destructor_declaration): Ditto.
14633
14634         * class.cs (Struct::Struct): Update constructors accordingly.
14635         (Class::Class): Ditto.
14636         (Field::Field): Ditto.
14637         (Method::Method): Ditto.
14638         (Property::Property): Ditto.
14639         (TypeContainer::OptAttribute): update property's return type.
14640
14641         * interface.cs (Interface.opt_attributes): New member.
14642         (Interface::Interface): Update to take the extra Attributes argument.
14643
14644         * parameter.cs (Parameter::Parameter): Ditto.
14645
14646         * constant.cs (Constant::Constant): Ditto.
14647
14648         * interface.cs (InterfaceMemberBase): New OptAttributes field.
14649         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
14650         the attributes as a parameter.
14651         (InterfaceProperty): Update constructor call.
14652         (InterfaceEvent): Ditto.
14653         (InterfaceMethod): Ditto.
14654         (InterfaceIndexer): Ditto.
14655
14656         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
14657         pass the attributes too.
14658         (interface_event_declaration): Ditto.
14659         (interface_property_declaration): Ditto.
14660         (interface_method_declaration): Ditto.
14661         (interface_declaration): Ditto.
14662
14663 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
14664
14665         * class.cs (Method::Define): Track the "static Main" definition to
14666         create an entry point. 
14667
14668         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
14669         EntryPoint if we find it. 
14670
14671         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
14672         (EmitContext::ig): Make this variable public.
14673
14674         * driver.cs: Make the default output file be the first file name
14675         with the .exe extension.  
14676
14677         Detect empty compilations
14678
14679         Handle various kinds of output targets.  Handle --target and
14680         rename -t to --dumper.
14681
14682         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
14683         methods inherited from Expression return now an Expression.  This
14684         will is used during the tree rewriting as we resolve them during
14685         semantic analysis.
14686
14687         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
14688         the spec.  Missing entirely is the information about
14689         accessability of elements of it.
14690
14691         (Expression::ExprClassFromMemberInfo): New constructor for
14692         Expressions that creates a fully initialized Expression based on
14693         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
14694         a Type.
14695
14696         (Invocation::Resolve): Begin implementing resolution of invocations.
14697
14698         * literal.cs (StringLiteral):  Implement Emit.
14699
14700 2001-09-05  Ravi Pratap  <ravi@ximian.com>
14701
14702         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
14703         member.
14704
14705 2001-09-04  Ravi Pratap  <ravi@ximian.com>
14706
14707         * cs-parser.jay (attribute_arguments): Implement actions.
14708         (attribute): Fix bug in production. Implement action.
14709         (attribute_list): Implement.
14710         (attribute_target): Implement.
14711         (attribute_target_specifier, opt_target_specifier): Implement
14712         (CheckAttributeTarget): New method to check if the attribute target
14713         is valid.
14714         (attribute_section): Implement.
14715         (opt_attributes): Implement.
14716
14717         * attribute.cs : New file to handle attributes.
14718         (Attribute): Class to hold attribute info.
14719
14720         * cs-parser.jay (opt_attribute_target_specifier): Remove production
14721         (attribute_section): Modify production to use 2 different rules to 
14722         achieve the same thing. 1 s/r conflict down !
14723         Clean out commented, useless, non-reducing dimension_separator rules.
14724
14725         * class.cs (TypeContainer.attributes): New member to hold list
14726         of attributes for a type.
14727         (Struct::Struct): Modify to take one more argument, the attribute list.
14728         (Class::Class): Ditto.
14729         (Field::Field): Ditto.
14730         (Method::Method): Ditto.
14731         (Property::Property): Ditto.
14732
14733         * cs-parser.jay (struct_declaration): Update constructor call to
14734         pass in the attributes too.
14735         (class_declaration): Ditto.
14736         (constant_declaration): Ditto.
14737         (field_declaration): Ditto.
14738         (method_header): Ditto.
14739         (fixed_parameter): Ditto.
14740         (parameter_array): Ditto.
14741         (property_declaration): Ditto.
14742
14743         * constant.cs (Constant::Constant): Update constructor similarly.
14744         Use System.Collections.
14745
14746         * parameter.cs (Parameter::Parameter): Update as above.
14747
14748 2001-09-02  Ravi Pratap  <ravi@ximian.com>
14749
14750         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
14751         (TypeContainer.delegates): New member to hold list of delegates.
14752
14753         * cs-parser.jay (delegate_declaration): Implement the action correctly 
14754         this time as I seem to be on crack ;-)
14755
14756 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
14757
14758         * rootcontext.cs (RootContext::IsNamespace): new function, used to
14759         tell whether an identifier represents a namespace.
14760
14761         * expression.cs (NamespaceExpr): A namespace expression, used only
14762         temporarly during expression resolution.
14763         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
14764         utility functions to resolve names on expressions.
14765
14766 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * codegen.cs: Add hook for StatementExpressions. 
14769
14770         * class.cs: Fix inverted test for static flag in methods.
14771
14772 2001-09-02  Ravi Pratap  <ravi@ximian.com>
14773
14774         * class.cs (Operator::CheckUnaryOperator): Correct error number used
14775         to make it coincide with MS' number.
14776         (Operator::CheckBinaryOperator): Ditto.
14777
14778         * ../errors/errors.txt : Remove error numbers added earlier.
14779
14780         * ../errors/cs1019.cs : Test case for error # 1019
14781
14782         * ../errros/cs1020.cs : Test case for error # 1020
14783
14784         * cs-parser.jay : Clean out commented cruft.
14785         (dimension_separators, dimension_separator): Comment out. Ostensibly not
14786         used anywhere - non-reducing rule.
14787         (namespace_declarations): Non-reducing rule - comment out.
14788
14789         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
14790         with TypeContainer::AddEnum.
14791
14792         * delegate.cs : New file for delegate handling classes.
14793         (Delegate): Class for declaring delegates.
14794
14795         * makefile : Update.
14796
14797         * cs-parser.jay (delegate_declaration): Implement.
14798
14799 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
14800
14801         * class.cs (Event::Define): Implement.
14802         (Event.EventBuilder): New member.
14803
14804         * class.cs (TypeContainer::Populate): Update to define all enums and events
14805         we have.
14806         (Events): New property for the events arraylist we hold. Shouldn't we move to using
14807         readonly fields for all these cases ?
14808
14809 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
14810
14811         * class.cs (Property): Revamp to use the convention of making fields readonly.
14812         Accordingly modify code elsewhere.
14813
14814         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
14815         the Define method of the Property class.
14816
14817         * class.cs : Clean up applied patch and update references to variables etc. Fix 
14818         trivial bug.
14819         (TypeContainer::Populate): Update to define all the properties we have. Also
14820         define all enumerations.
14821
14822         * enum.cs (Define): Implement.
14823
14824 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
14825
14826         * cs-parser.jay (overloadable_operator): The semantic value is an
14827         enum of the Operator class.
14828         (operator_declarator): Implement actions.
14829         (operator_declaration): Implement.
14830
14831         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
14832         validity of definitions.
14833         (Operator::CheckBinaryOperator): Static method to check for binary operators
14834         (TypeContainer::AddOperator): New method to add an operator to a type.
14835
14836         * cs-parser.jay (indexer_declaration): Added line to actually call the
14837         AddIndexer method so it gets added ;-)
14838
14839         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
14840         already taken care of by the MS compiler ?  
14841
14842 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
14843
14844         * class.cs (Operator): New class for operator declarations.
14845         (Operator::OpType): Enum for the various operators.
14846
14847 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
14848
14849         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
14850         ostensibly handle this in semantic analysis.
14851
14852         * cs-parser.jay (general_catch_clause): Comment out
14853         (specific_catch_clauses, specific_catch_clause): Ditto.
14854         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
14855         (catch_args, opt_catch_args): New productions.
14856         (catch_clause): Rewrite to use the new productions above
14857         (catch_clauses): Modify accordingly.
14858         (opt_catch_clauses): New production to use in try_statement
14859         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
14860         and re-write the code in the actions to extract the specific and
14861         general catch clauses by being a little smart ;-)
14862
14863         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
14864         Hooray, try and catch statements parse fine !
14865
14866 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
14867
14868         * statement.cs (Block::GetVariableType): Fix logic to extract the type
14869         string from the hashtable of variables.
14870
14871         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
14872         I end up making that mistake ;-)
14873         (catch_clauses): Fixed gross error which made Key and Value of the 
14874         DictionaryEntry the same : $1 !!
14875
14876 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
14877
14878         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
14879
14880         * cs-parser.jay (event_declaration): Correct to remove the semicolon
14881         when the add and remove accessors are specified. 
14882
14883 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
14884
14885         * cs-parser.jay (IndexerDeclaration): New helper class to hold
14886         information about indexer_declarator.
14887         (indexer_declarator): Implement actions.
14888         (parsing_indexer): New local boolean used to keep track of whether
14889         we are parsing indexers or properties. This is necessary because 
14890         implicit_parameters come into picture even for the get accessor in the 
14891         case of an indexer.
14892         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
14893
14894         * class.cs (Indexer): New class for indexer declarations.
14895         (TypeContainer::AddIndexer): New method to add an indexer to a type.
14896         (TypeContainer::indexers): New member to hold list of indexers for the
14897         type.
14898
14899 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
14900
14901         * cs-parser.jay (add_accessor_declaration): Implement action.
14902         (remove_accessor_declaration): Implement action.
14903         (event_accessors_declaration): Implement
14904         (variable_declarators): swap statements for first rule - trivial.
14905
14906         * class.cs (Event): New class to hold information about event
14907         declarations.
14908         (TypeContainer::AddEvent): New method to add an event to a type
14909         (TypeContainer::events): New member to hold list of events.
14910
14911         * cs-parser.jay (event_declaration): Implement actions.
14912
14913 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
14914
14915         * cs-parser.jay (dim_separators): Implement. Make it a string
14916         concatenating all the commas together, just as they appear.
14917         (opt_dim_separators): Modify accordingly
14918         (rank_specifiers): Update accordingly. Basically do the same
14919         thing - instead, collect the brackets here.
14920         (opt_rank_sepcifiers): Modify accordingly.
14921         (array_type): Modify to actually return the complete type string
14922         instead of ignoring the rank_specifiers.
14923         (expression_list): Implement to collect the expressions
14924         (variable_initializer): Implement. We make it a list of expressions
14925         essentially so that we can handle the array_initializer case neatly too.
14926         (variable_initializer_list): Implement.
14927         (array_initializer): Make it a list of variable_initializers
14928         (opt_array_initializer): Modify accordingly.
14929
14930         * expression.cs (New::NType): Add enumeration to help us
14931         keep track of whether we have an object/delegate creation
14932         or an array creation.
14933         (New:NewType, New::Rank, New::Indices, New::Initializers): New
14934         members to hold data about array creation.
14935         (New:New): Modify to update NewType
14936         (New:New): New Overloaded contructor for the array creation
14937         case.
14938
14939         * cs-parser.jay (array_creation_expression): Implement to call
14940         the overloaded New constructor.
14941
14942 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
14943
14944         * class.cs (TypeContainer::Constructors): Return member
14945         constructors instead of returning null.
14946
14947 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
14948
14949         * typemanager.cs (InitCoreTypes): Initialize the various core
14950         types after we have populated the type manager with the user
14951         defined types (this distinction will be important later while
14952         compiling corlib.dll)
14953
14954         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
14955         on Expression Classification.  Now all expressions have a method
14956         `Resolve' and a method `Emit'.
14957
14958         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
14959         generation from working.     Also add some temporary debugging
14960         code. 
14961
14962 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
14963
14964         * codegen.cs: Lots of code generation pieces.  This is only the
14965         beginning, will continue tomorrow with more touches of polish.  We
14966         handle the fundamentals of if, while, do, for, return.  Others are
14967         trickier and I need to start working on invocations soon.
14968
14969         * gen-treedump.cs: Bug fix, use s.Increment here instead of
14970         s.InitStatement. 
14971
14972         * codegen.cs (EmitContext): New struct, used during code
14973         emission to keep a context.   Most of the code generation will be
14974         here. 
14975
14976         * cs-parser.jay: Add embedded blocks to the list of statements of
14977         this block.  So code generation proceeds in a top down fashion.
14978
14979 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
14980
14981         * statement.cs: Add support for multiple child blocks.
14982
14983 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * codegen.cs (EmitCode): New function, will emit the code for a
14986         Block of code given a TypeContainer and its ILGenerator. 
14987
14988         * statement.cs (Block): Standard public readonly optimization.
14989         (Block::Block constructors): Link children. 
14990         (Block::Child): Child Linker.
14991         (Block::EmitVariables): Emits IL variable declarations.
14992
14993         * class.cs: Drop support for MethodGroups here, delay until
14994         Semantic Analysis.
14995         (Method::): Applied the same simplification that I did before, and
14996         move from Properties to public readonly fields.
14997         (Method::ParameterTypes): Returns the parameter types for the
14998         function, and implements a cache that will be useful later when I
14999         do error checking and the semantic analysis on the methods is
15000         performed.
15001         (Constructor::GetCallingConvention): Renamed from CallingConvetion
15002         and made a method, optional argument tells whether this is a class
15003         or a structure to apply the `has-this' bit.
15004         (Method::GetCallingConvention): Implement, returns the calling
15005         convention. 
15006         (Method::Define): Defines the type, a second pass is performed
15007         later to populate the methods.
15008
15009         (Constructor::ParameterTypes): implement a cache similar to the
15010         one on Method::ParameterTypes, useful later when we do semantic
15011         analysis. 
15012
15013         (TypeContainer::EmitMethod):  New method.  Emits methods.
15014
15015         * expression.cs: Removed MethodGroup class from here.
15016
15017         * parameter.cs (Parameters::GetCallingConvention): new method.
15018
15019 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
15020
15021         * class.cs (TypeContainer::Populate): Drop RootContext from the
15022         argument. 
15023
15024         (Constructor::CallingConvention): Returns the calling convention.
15025         (Constructor::ParameterTypes): Returns the constructor parameter
15026         types. 
15027
15028         (TypeContainer::AddConstructor): Keep track of default constructor
15029         and the default static constructor.
15030
15031         (Constructor::) Another class that starts using `public readonly'
15032         instead of properties. 
15033
15034         (Constructor::IsDefault): Whether this is a default constructor. 
15035
15036         (Field::) use readonly public fields instead of properties also.
15037
15038         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
15039         track of static constructors;  If none is used, turn on
15040         BeforeFieldInit in the TypeAttributes. 
15041
15042         * cs-parser.jay (opt_argument_list): now the return can be null
15043         for the cases where there are no arguments. 
15044
15045         (constructor_declarator): If there is no implicit `base' or
15046         `this', then invoke the default parent constructor. 
15047
15048         * modifiers.cs (MethodAttr): New static function maps a set of
15049         modifiers flags into a MethodAttributes enum
15050         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
15051         MethodAttr, TypeAttr to represent the various mappings where the
15052         modifiers are used.
15053         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
15054
15055 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
15056
15057         * parameter.cs (GetParameterInfo): Fix bug where there would be no
15058         method arguments.
15059
15060         * interface.cs (PopulateIndexer): Implemented the code generator
15061         for interface indexers.
15062
15063 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * interface.cs (InterfaceMemberBase): Now we track the new status
15066         here.  
15067
15068         (PopulateProperty): Implement property population.  Woohoo!  Got
15069         Methods and Properties going today. 
15070
15071         Removed all the properties for interfaces, and replaced them with
15072         `public readonly' fields. 
15073
15074 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
15077         initialize their hashtables/arraylists only when they are needed
15078         instead of doing this always.
15079
15080         * parameter.cs: Handle refs and out parameters.
15081
15082         * cs-parser.jay: Use an ArrayList to construct the arguments
15083         instead of the ParameterCollection, and then cast that to a
15084         Parameter[] array.
15085
15086         * parameter.cs: Drop the use of ParameterCollection and use
15087         instead arrays of Parameters.
15088
15089         (GetParameterInfo): Use the Type, not the Name when resolving
15090         types. 
15091
15092 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
15095         and instead use public readonly fields.
15096
15097         * class.cs: Put back walking code for type containers.
15098
15099 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
15100
15101         * class.cs (MakeConstant): Code to define constants.
15102
15103         * rootcontext.cs (LookupType): New function.  Used to locate types 
15104
15105
15106 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
15109         this System.Reflection code is.  Kudos to Microsoft
15110
15111         * typemanager.cs: Implement a type cache and avoid loading all
15112         types at boot time.  Wrap in LookupType the internals.  This made
15113         the compiler so much faster.  Wow.  I rule!
15114
15115         * driver.cs: Make sure we always load mscorlib first (for
15116         debugging purposes, nothing really important).
15117
15118         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
15119         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
15120
15121         * rootcontext.cs: Lookup types on their namespace;  Lookup types
15122         on namespaces that have been imported using the `using' keyword.
15123
15124         * class.cs (TypeContainer::TypeAttr): Virtualize.
15125         (Class::TypeAttr): Return attributes suitable for this bad boy.
15126         (Struct::TypeAttr): ditto.
15127         Handle nested classes.
15128         (TypeContainer::) Remove all the type visiting code, it is now
15129         replaced with the rootcontext.cs code
15130
15131         * rootcontext.cs (GetClassBases): Added support for structs. 
15132
15133 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
15134
15135         * interface.cs, statement.cs, class.cs, parameter.cs,
15136         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
15137         Drop use of TypeRefs, and use strings instead.
15138
15139 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * rootcontext.cs: 
15142
15143         * class.cs (Struct::Struct): set the SEALED flags after
15144         checking the modifiers.
15145         (TypeContainer::TypeAttr): new property, returns the
15146         TypeAttributes for a class.  
15147
15148         * cs-parser.jay (type_list): Oops, list production was creating a
15149         new list of base types.
15150
15151         * rootcontext.cs (StdLib): New property.
15152         (GetInterfaceTypeByName): returns an interface by type name, and
15153         encapsulates error handling here.
15154         (GetInterfaces): simplified.
15155         (ResolveTree): Encapsulated all the tree resolution here.
15156         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
15157         types. 
15158
15159         * driver.cs: Add support for --nostdlib, to avoid loading the
15160         default assemblies.
15161         (Main): Do not put tree resolution here. 
15162
15163         * rootcontext.cs: Beginning of the class resolution.
15164
15165 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
15166
15167         * rootcontext.cs: Provide better error reporting. 
15168
15169         * cs-parser.jay (interface_base): set our $$ to be interfaces.
15170
15171         * rootcontext.cs (CreateInterface): Handle the case where there
15172         are no parent interfaces.
15173
15174         (CloseTypes): Routine to flush types at the end.
15175         (CreateInterface): Track types.
15176         (GetInterfaces): Returns an array of Types from the list of
15177         defined interfaces.
15178
15179         * typemanager.c (AddUserType): Mechanism to track user types (puts
15180         the type on the global type hash, and allows us to close it at the
15181         end). 
15182
15183 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
15186         RecordInterface instead.
15187
15188         * cs-parser.jay: Updated to reflect changes above.
15189
15190         * decl.cs (Definition): Keep track of the TypeBuilder type that
15191         represents this type here.  Not sure we will use it in the long
15192         run, but wont hurt for now.
15193
15194         * driver.cs: Smaller changes to accomodate the new code.
15195
15196         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
15197         when done. 
15198
15199         * rootcontext.cs (CreateInterface):  New method, used to create
15200         the System.TypeBuilder type for interfaces.
15201         (ResolveInterfaces): new entry point to resolve the interface
15202         hierarchy. 
15203         (CodeGen): Property, used to keep track of the code generator.
15204
15205 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
15206
15207         * cs-parser.jay: Add a second production for delegate_declaration
15208         with `VOID'.
15209
15210         (enum_body): Put an opt_comma here instead of putting it on
15211         enum_body or enum_member_declarations so we can handle trailing
15212         commas on enumeration members.  Gets rid of a shift/reduce.
15213
15214         (type_list): Need a COMMA in the middle.
15215
15216         (indexer_declaration): Tell tokenizer to recognize get/set
15217
15218         * Remove old targets.
15219
15220         * Re-add the parser target.
15221
15222 2001-07-13  Simon Cozens <simon@simon-cozens.org>
15223
15224         * cs-parser.jay: Add precendence rules for a number of operators
15225         ot reduce the number of shift/reduce conflicts in the grammar.
15226
15227 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
15228
15229         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
15230         and put it here.
15231
15232         Get rid of old crufty code.
15233
15234         * rootcontext.cs: Use this to keep track of the parsed
15235         representation and the defined types available to the program. 
15236
15237         * gen-treedump.cs: adjust for new convention.
15238
15239         * type.cs: Split out the type manager, and the assembly builder
15240         from here. 
15241
15242         * typemanager.cs: the type manager will live here now.
15243
15244         * cil-codegen.cs: And the code generator here. 
15245
15246 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
15247
15248         * makefile: Fixed up for easy making.
15249
15250 2001-07-13  Simon Cozens <simon@simon-cozens.org>
15251
15252         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
15253         the 
15254
15255         (unary_expression): Expand pre_increment_expression and
15256         post_decrement_expression to reduce a shift/reduce.
15257
15258 2001-07-11  Simon Cozens
15259
15260         * cs-tokenizer.cs: Hex numbers should begin with a 0.
15261
15262         Improve allow_keyword_as_indent name.
15263
15264 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * Adjustments for Beta2. 
15267
15268 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * decl.cs: Added `Define' abstract method.
15271         (InTransit): new property, used to catch recursive definitions. 
15272
15273         * interface.cs: Implement `Define'. 
15274
15275         * modifiers.cs: Map Modifiers.constants to
15276         System.Reflection.TypeAttribute flags.
15277
15278         * class.cs: Keep track of types and user-defined types.
15279         (BuilderInit): New method for creating an assembly
15280         (ResolveType): New function to launch the resolution process, only
15281         used by interfaces for now.
15282
15283         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
15284         that are inserted into the name space. 
15285
15286 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * ARGH.  I have screwed up my tree so many times due to the use of
15289         rsync rather than using CVS.  Going to fix this at once. 
15290
15291         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
15292         load types.
15293
15294 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * Experiment successful: Use System.Type rather that our own
15297         version of Type.  
15298
15299 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
15300
15301         * cs-parser.jay: Removed nsAliases from here.
15302
15303         Use new namespaces, handle `using XXX;' 
15304
15305         * namespace.cs: Reimplemented namespace handling, use a recursive
15306         definition of the class.  Now we can keep track of using clauses
15307         and catch invalid using clauses.
15308
15309 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
15310
15311         * gen-treedump.cs: Adapted for all the renaming.
15312
15313         * expression.cs (Expression): this class now has a Type property
15314         which returns an expression Type.
15315
15316         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
15317         `Type', as this has a different meaning now in the base
15318
15319 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
15320
15321         * interface.cs, class.cs: Removed from all the sources the
15322         references to signature computation, as we can not do method
15323         signature computation during the parsing time, as we are not
15324         trying to solve at that point distinguishing:
15325
15326         class X {
15327                 void a (Blah x) {}
15328                 void a (NS.Blah x) {}
15329         }
15330
15331         Which depending on the context might be valid or not, as we do not
15332         know if Blah is the same thing as NS.Blah at that point.
15333
15334         * Redid everything so the code uses TypeRefs now instead of
15335         Types.  TypeRefs are just temporary type placeholders, that need
15336         to be resolved.  They initially have a pointer to a string and the
15337         current scope in which they are used.  This is used later by the
15338         compiler to resolve the reference to an actual Type. 
15339
15340         * DeclSpace is no longer a CIR.Type, and neither are
15341         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
15342         are all DeclSpaces, but no Types. 
15343
15344         * type.cs (TypeRefManager): This implements the TypeRef manager,
15345         which keeps track of all the types that need to be resolved after
15346         the parsing has finished. 
15347
15348 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * ARGH.  We are going to have to store `foreach' as a class rather
15351         than resolving it, as we need to verify error 1579 after name
15352         resolution.   *OR* we could keep a flag that says `This request to
15353         IEnumerator comes from a foreach statement' which we can then use
15354         to generate the error.
15355
15356 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
15357
15358         * class.cs (TypeContainer.AddMethod): we now add methods to the
15359         MethodGroup instead of the method hashtable.  
15360
15361         * expression.cs: Add MethodGroup abstraction, which gets us one
15362         step closer to the specification in the way we handle method
15363         declarations.  
15364
15365         * cs-parser.jay (primary_expression): qualified_identifier now
15366         tried to match up an identifier to a local variable reference or
15367         to a parameter reference.
15368
15369         current_local_parameters is now a parser global variable that
15370         points to the current parameters for the block, used during name
15371         lookup.
15372
15373         (property_declaration): Now creates an implicit `value' argument to
15374         the set accessor.
15375
15376 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
15377
15378         * parameter.cs: Do not use `param' arguments as part of the
15379         signature, per the spec.
15380
15381 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * decl.cs: Base class for classes, structs and interfaces.  This
15384         is the "Declaration Space" 
15385
15386         * cs-parser.jay: Use CheckDef for checking declaration errors
15387         instead of having one on each function.
15388
15389         * class.cs: Factor out some code for handling error handling in
15390         accordance to the "Declarations" section in the "Basic Concepts"
15391         chapter in the ECMA C# spec.
15392
15393         * interface.cs: Make all interface member classes derive from
15394         InterfaceMemberBase.
15395
15396 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * Many things: all interfaces are parsed and generated in
15399         gen-treedump.  Support for member variables, constructors,
15400         destructors, properties, constants is there.
15401
15402         Beginning of the IL backend, but very little done, just there for
15403         testing purposes. 
15404
15405 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
15406
15407         * cs-parser.jay: Fix labeled statement.
15408
15409         * cs-tokenizer.cs (escape): Escape " and ' always.
15410         ref_line, ref_name: keep track of the line/filename as instructed
15411         by #line by the compiler.
15412         Parse #line.
15413
15414 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
15415
15416         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
15417         to match the values in System.CodeDOM.
15418
15419         Divid renamed to Divide.
15420
15421         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
15422         statements. 
15423         (Statements.set): remove.
15424
15425         * System.CodeDOM/CodeCatchClause.cs: always have a valid
15426         statements. 
15427
15428         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
15429         falseStatements always have valid values. 
15430
15431         * cs-parser.jay: Use System.CodeDOM now.
15432