2004-05-27 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2004-05-20  Martin Baulig  <martin@ximian.com>
2
3         * delegate.cs: Convert this file to Unix mode - like the original
4         version in mcs is.
5
6 2004-05-20  Martin Baulig  <martin@ximian.com>
7
8         * attribute.cs: Convert this file to Unix mode - like the original
9         version in mcs is.
10
11 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
12
13        Fix bug #58688 (MCS does not report error when the same attribute
14        is assigned twice)
15
16        * attribute.cs (Attribute.Emit): Distinction between null and default.
17
18 2004-05-19  Raja R Harinath  <rharinath@novell.com>
19
20        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
21        of a top-level attribute without an attribute target.
22        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
23        Make non-static.
24        (Attribute.Conditional_GetConditionName), 
25        (Attribute.Obsolete_GetObsoleteMessage): Update.
26        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
27        part of ScanForIndexerName.
28        (Attribute.CanIgnoreInvalidAttribute): New function.
29        (Attribute.ScanForIndexerName): Move to ...
30        (Attributes.ScanForIndexerName): ... here.
31        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
32        (Attributes.Search): New internal variant that can choose not to
33        complain if types aren't resolved.  The original signature now
34        complains.
35        (Attributes.GetClsCompliantAttribute): Use internal variant, with
36        complaints suppressed.
37        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
38        only if it not useful.
39        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
40        top-level for attributes that are shared between the assembly
41        and a top-level class.
42        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
43        * class.cs: Update to reflect changes.
44        (DefineIndexers): Fuse loops.
45        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
46        a couple more variants of attribute names.
47
48 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
49
50         Fix bug #52585 (Implemented explicit attribute declaration)
51
52         * attribute.cs:
53         (Attributable.ValidAttributeTargets): New abstract method. It gets
54         list of valid attribute targets for explicit target declaration.
55         (Attribute.Target): It holds target itself.
56         (AttributeSection): Removed.
57         (Attribute.CheckTargets): New method. It checks whether attribute
58         target is valid for the current element.
59
60         * class.cs:
61         (EventProperty): New class. For events that are declared like
62         property (with add and remove accessors).
63         (EventField): New class. For events that are declared like field.
64         class.cs
65
66         * cs-parser.jay: Implemented explicit attribute target declaration.
67
68         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
69         Override ValidAttributeTargets.
70
71         * parameter.cs:
72         (ReturnParameter): Class for applying custom attributes on 
73         the return type.
74         (ParameterAtribute): New class. Class for applying custom
75         attributes on the parameter type.
76
77 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
78
79         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
80         definitions. 
81
82         (Method): Allow UNSAFE here.
83
84         * modifiers.cs: Support unsafe reporting.
85
86 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
87
88         * decl.cs: Fix bug #58478.
89
90 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
91
92         * statement.cs: When checking for unreachable code on an EmptyStatement,
93         set the location. Fixes bug #58488.
94
95 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
96
97         * driver.cs: Add -pkg handling.
98
99         From Gonzalo: UseShelLExecute=false
100
101 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
102
103         * attribute.cs:
104         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
105         for attribute.
106         (Attribute.IsClsCompliaceRequired): Moved to base for better
107         accesibility.
108         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
109         when attribute is AttributeUsageAttribute.
110         (Attribute.GetValidTargets): Simplified.
111         (Attribute.GetAttributeUsage): New method returns AttributeUsage
112         attribute for this type.
113         (Attribute.ApplyAttributes): Method renamed to Emit and make
114         non-static.
115         (GlobalAttributeSection): New class for special handling of global
116         attributes (assembly, module).
117         (AttributeSection.Emit): New method.
118
119         * class.cs: Implemented Attributable abstract methods.
120         (MethodCore.LabelParameters): Moved to Parameter class.
121         (Accessor): Is back simple class.
122         (PropertyMethod): Implemented Attributable abstract class.
123         (DelegateMethod): Implemented Attributable abstract class.
124         (Event): New constructor for disctintion between normal Event
125         and Event with accessors.
126
127         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
128
129         * codegen.cs, const.cs, decl.cs, delegate.cs:
130         (CommonAssemblyModulClass): Implemented Attributable abstract class
131         and simplified.
132
133         * enum.cs: Implement IAttributeSupport interface.
134         (EnumMember): New class for emum members. Implemented Attributable
135         abstract class
136
137         * parameter.cs:
138         (ParameterBase): Is abstract.
139         (ReturnParameter): New class for easier [return:] attribute handling.
140
141         * typemanager.cs: Removed builder_to_attr.
142
143 2004-05-11  Raja R Harinath  <rharinath@novell.com>
144
145         Fix bug #57151.
146         * attribute.cs (Attribute.GetPositionalValue): New function.
147         * class.cs (TypeContainer.VerifyMembers): New function.
148         (TypeContainer.Emit): Use it.
149         (ClassOrStruct): New base class for Class and Struct.
150         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
151         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
152         class.
153         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
154         then each non-static field should have a FieldOffset attribute.
155         Otherwise, none of the fields should have a FieldOffset attribute.
156         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
157         and FieldOffset attributes.
158         * typemanager.cs (TypeManager.struct_layout_attribute_type)
159         (TypeManager.field_offset_attribute_type): New core types.
160         (TypeManager.InitCoreTypes): Initialize them.
161
162 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
163
164         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
165         Return correct type.
166         From bug #58270.
167
168 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
169
170         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
171         be implicitly converted to ulong.
172         
173         * expression.cs: The logic for allowing operator &, | and ^ worked
174         was wrong, it worked before because we did not report an error in
175         an else branch.  Fixes 57895.
176
177         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
178         allow volatile fields to be reference types.
179
180 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
181
182         * driver.cs: Add support for /debug-
183
184 2004-05-07  Raja R Harinath  <rharinath@novell.com>
185
186         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
187         Add a 'complain' parameter to silence errors.
188         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
189         silently overlooked type-resolutions.
190         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
191         to reflect changes.
192         (Attributes.Search): New function.
193         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
194         (Attributes.GetAttributeFullName): Remove hack.
195         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
196         Update to reflect changes.
197         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
198         Use Attributes.Search instead of nested loops.
199
200 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
201
202         * decl.cs:
203         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
204         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
205         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
206
207         * report.cs: (Report.Warning): Renamed to Warning_T because of
208         parameter collision.
209
210 2004-05-05  Raja R Harinath  <rharinath@novell.com>
211
212         * expression.cs (MemberAccess.ResolveMemberAccess):
213         Exit with non-zero status after Report.Error.
214         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
215         Likewise.
216         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
217
218 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
219
220         * support.cs: Don't hang when the file is empty.
221
222 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
223
224         * support.cs: In SeekableStreamReader, compute the preamble size of the
225           underlying stream. Position changes should take into account that initial
226           count of bytes.
227
228 2004-05-03  Todd Berman  <tberman@sevenl.net>
229
230         * driver.cs: remove unused GetSysVersion function.
231
232 2004-05-03  Todd Berman  <tberman@sevenl.net>
233
234         * driver.cs: Remove the hack from saturday, as well as the hack
235         from jackson (LoadAssemblyFromGac), also adds the CWD to the
236         link_paths to get that bit proper.
237
238 2004-05-01  Todd Berman  <tberman@sevenl.net>
239
240         * driver.cs: Try a LoadFrom before a Load, this checks the current
241         path. This is currently a bug in mono that is be fixed, however, this
242         provides a workaround for now. This will be removed when the bug
243         is fixed.
244
245 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
246
247         * CryptoConvert.cs: Updated to latest version. Fix issue with 
248         incomplete key pairs (#57941).
249
250 2004-05-01  Todd Berman  <tberman@sevenl.net>
251
252         * driver.cs: Remove '.' from path_chars, now System.* loads properly
253         from the GAC
254
255 2004-04-30  Jackson Harper  <jackson@ximian.com>
256
257         * codegen.cs: Open keys readonly.
258         
259 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
260
261         * typemanager.cs: don't report cyclic struct layout when a struct
262         contains 2 or more fields of the same type. Failed for Pango.AttrShape
263         which has 2 Pango.Rectangle fields.
264
265 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
266
267         * expression.cs: Handle IntPtr comparisons with IL code
268         rather than a method call.
269
270 2004-04-29  Martin Baulig  <martin@ximian.com>
271
272         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
273         the list of PropertyInfo's in class hierarchy and find the
274         accessor.  Fixes #56013.
275
276 2004-04-29  Martin Baulig  <martin@ximian.com>
277
278         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
279
280 2004-04-29  Martin Baulig  <martin@ximian.com>
281
282         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
283
284         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
285
286 2004-04-29  Martin Baulig  <martin@ximian.com>
287
288         * class.cs (ConstructorInitializer.Resolve): Check whether the
289         parent .ctor is accessible.  Fixes #52146.
290
291 2004-04-29  Martin Baulig  <martin@ximian.com>
292
293         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
294
295         * statement.cs (Using.EmitLocalVariableDecls): Use
296         TypeManager.idisposable_type, not typeof (IDisposable).
297         (Foreach.EmitCollectionForeach): Added support for valuetypes.
298
299 2004-04-29  Martin Baulig  <martin@ximian.com>
300
301         * class.cs (Event.Define): Don't emit the field and don't set
302         RTSpecialName and SpecialName for events on interfaces.  Fixes
303         #57703. 
304
305 2004-04-29  Raja R Harinath  <rharinath@novell.com>
306
307         Refactor Attribute.ApplyAttributes.
308         * attribute.cs (Attributable): New base class for objects that can
309         have Attributes applied on them.
310         (Attribute): Make AttributeUsage fields public.
311         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
312         (Attribute.IsInternalCall): New property.
313         (Attribute.UsageAttr): Convert to a public read-only property.
314         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
315         (Attribute.ResolveType, Attribute.Resolve)
316         (Attribute.ScanForIndexerName): Update to reflect changes.
317         (Attribute.CheckAttributeTarget): Re-format.
318         (Attribute.ApplyAttributes): Refactor, to various
319         Attributable.ApplyAttributeBuilder methods.
320         * decl.cs (MemberCore): Make Attributable.
321         * class.cs (Accessor): Make Attributable.
322         (MethodData.ApplyAttributes): Use proper attribute types, not
323         attribute names.
324         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
325         (TypeContainer.ApplyAttributeBuilder)
326         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
327         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
328         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
329         (Operator.ApplyAttributeBuilder): New factored-out methods.
330         * const.cs (Const.ApplyAttributeBuilder): Likewise.
331         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
332         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
333         * parameter.cs (ParameterBase): New Attributable base class
334         that can also represent Return types.
335         (Parameter): Update to the changes.
336
337 2004-04-29  Jackson Harper  <jackson@ximian.com>
338
339         * driver.cs: Prefer the corlib system version when looking for
340         assemblies in the GAC. This is still a hack, but its a better hack
341         now.
342         
343 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
344
345         * decl.cs, enum.cs: Improved error 3005 reporting.
346   
347         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
348         (related_symbols): New private member for list of symbols
349         related to reported error/warning.
350         
351         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
352
353 2004-04-29  Martin Baulig  <martin@ximian.com>
354
355         * ecore.cs (Expression.Constantify): If we're an enum and
356         TypeManager.TypeToCoreType() doesn't give us another type, use
357         t.UnderlyingSystemType.  Fixes #56178.  
358
359 2004-04-29  Martin Baulig  <martin@ximian.com>
360
361         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
362         interfaces and for each interface, only add members directly
363         declared in that interface.  Fixes #53255.
364
365 2004-04-28  Martin Baulig  <martin@ximian.com>
366
367         * expression.cs (ConditionalLogicalOperator): Use a temporary
368         variable for `left' to avoid that we evaluate it more than once;
369         bug #52588.
370
371 2004-04-28  Martin Baulig  <martin@ximian.com>
372
373         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
374         `void[]' (CS1547).
375
376 2004-04-28  Martin Baulig  <martin@ximian.com>
377
378         * statement.cs (LocalInfo.Resolve): Check whether the type is not
379         void (CS1547).
380
381         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
382         whether the type is not void (CS1547).
383
384 2004-04-28  Martin Baulig  <martin@ximian.com>
385
386         * expression.cs (Unary.DoResolveLValue): Override this and report
387         CS0131 for anything but Operator.Indirection.
388
389 2004-04-28  Martin Baulig  <martin@ximian.com>
390
391         Committing a patch from Ben Maurer; see bug #50820.
392
393         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
394         check for classes.
395
396         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
397         classes.        
398
399 2004-04-28  Martin Baulig  <martin@ximian.com>
400
401         Committing a patch from Ben Maurer; see bug #50820.
402
403         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
404         check for classes.
405
406         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
407         classes.        
408
409 2004-04-28  Martin Baulig  <martin@ximian.com>
410
411         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
412         (Block.AddLabel): Call DoLookupLabel() to only search in the
413         current block.
414
415 2004-04-28  Martin Baulig  <martin@ximian.com>
416
417         * cfold.cs (ConstantFold.BinaryFold): Added special support for
418         comparing StringConstants and NullLiterals in Equality and Inequality.
419
420 2004-04-28  Jackson Harper  <jackson@ximian.com>
421
422         * driver.cs: Attempt to load referenced assemblies from the
423         GAC. This is the quick and dirty version of this method that
424         doesnt take into account versions and just takes the first
425         canidate found. Will be good enough for now as we will not have more
426         then one version installed into the GAC until I update this method.
427
428 2004-04-28  Martin Baulig  <martin@ximian.com>
429
430         * typemanager.cs (TypeManager.CheckStructCycles): New public
431         static method to check for cycles in the struct layout.
432
433         * rootcontext.cs (RootContext.PopulateTypes): Call
434         TypeManager.CheckStructCycles() for each TypeContainer.
435         [Note: We only need to visit each type once.]
436
437 2004-04-28  Martin Baulig  <martin@ximian.com>
438
439         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
440
441         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
442         success and added `out object value'.  Use a `bool resolved' field
443         to check whether we've already been called rather than
444         `ConstantValue != null' since this breaks for NullLiterals.
445
446 2004-04-28  Raja R Harinath  <rharinath@novell.com>
447
448         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
449         setting of this flag, since the 'set' method may be non-public.
450
451 2004-04-28  Raja R Harinath  <rharinath@novell.com>
452
453         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
454         check on current_vector.Block.
455
456 2004-04-27  Martin Baulig  <martin@ximian.com>
457
458         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
459         a field initializer.  Fixes #56459.
460
461 2004-04-27  Martin Baulig  <martin@ximian.com>
462
463         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
464         we're not attempting to use an indexer.  Fixes #52154.
465
466 2004-04-27  Martin Baulig  <martin@ximian.com>
467
468         * statement.cs (Return): Don't create a return label if we don't
469         need it; reverts my change from January 20th.  Thanks to Ben
470         Maurer for this.
471
472 2004-04-27  Martin Baulig  <martin@ximian.com>
473
474         According to the spec, `goto' can only leave a nested scope, but
475         never enter it.
476
477         * statement.cs (Block.LookupLabel): Only lookup in the current
478         block, don't recurse into parent or child blocks.
479         (Block.AddLabel): Check in parent and child blocks, report
480         CS0140/CS0158 if we find a duplicate.
481         (Block): Removed this indexer for label lookups.
482         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
483         this already does the error reporting for us.
484
485         * flowanalysis.cs
486         (FlowBranching.UsageVector.Block): New public variable; may be null.
487         (FlowBranching.CreateSibling): Added `Block' argument.
488         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
489         label for the target of a `goto' and check whether we're not
490         leaving a `finally'.
491
492 2004-04-27  Martin Baulig  <martin@ximian.com>
493
494         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
495         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
496         just for returns).
497
498 2004-04-27  Martin Baulig  <martin@ximian.com>
499
500         * statement.cs (Block.AddLabel): Also check for implicit blocks
501         and added a CS0158 check.
502
503 2004-04-27  Martin Baulig  <martin@ximian.com>
504
505         * flowanalysis.cs (FlowBranchingLoop): New class.
506         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
507         UsageVector's instead of an ArrayList.
508         (FlowBranching.Label): Likewise.
509         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
510         (FlowBranching.AddBreakVector): New method.
511
512 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
513
514         * attribute.cs: Small regression fix: only convert the type if we
515         the type is different, fixes System.Drawing build.
516
517 2004-04-27  Martin Baulig  <martin@ximian.com>
518
519         * attribute.cs (Attribute.Resolve): If we have a constant value
520         for a named field or property, implicity convert it to the correct
521         type.
522
523 2004-04-27  Raja R Harinath  <rharinath@novell.com>
524
525         * statement.cs (Block.Block): Implicit blocks share
526         'child_variable_names' fields with parent blocks.
527         (Block.AddChildVariableNames): Remove.
528         (Block.AddVariable): Mark variable as "used by a child block" in
529         every surrounding block.
530         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
531         been used in a child block, complain about violation of "Invariant
532         meaning in blocks" rule.
533         * cs-parser.jay (declare_local_variables): Don't use
534         AddChildVariableNames.
535         (foreach_statement): Don't create an implicit block: 'foreach'
536         introduces a scope.
537
538 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
539
540         * convert.cs (ImplicitNumericConversion): 0 is also positive when
541         converting from 0L to ulong.  Fixes 57522.
542
543 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
544
545         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
546         derived class hides via 'new' keyword field from base class (test-242.cs).
547         TODO: Handle this in the more general way.
548         
549         * class.cs (CheckBase): Ditto.
550
551 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
552
553         * decl.cs (caching_flags): New member for storing cached values
554         as bit flags.
555         (MemberCore.Flags): New enum where bit flags for caching_flags
556         are defined.
557         (MemberCore.cls_compliance): Moved to caching_flags.
558         (DeclSpace.Created): Moved to caching_flags.
559
560         * class.cs: Use caching_flags instead of DeclSpace.Created
561         
562 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
563
564         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
565         if we are only a derived class, not a nested class.
566
567         * typemanager.cs: Same as above, but do this at the MemberLookup
568         level (used by field and methods, properties are handled in
569         PropertyExpr).   Allow for the qualified access if we are a nested
570         method. 
571
572 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
573
574         * class.cs: Refactoring.
575         (IMethodData): New inteface; Holds links to parent members
576         to avoid member duplication (reduced memory allocation).
577         (Method): Implemented IMethodData interface.
578         (PropertyBase): New inner classes for get/set methods.
579         (PropertyBase.PropertyMethod): Implemented IMethodData interface
580         (Event): New inner classes for add/remove methods.
581         (Event.DelegateMethod): Implemented IMethodData interface.
582
583         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
584         EmitContext (related to class.cs refactoring).
585
586 2004-04-21  Raja R Harinath  <rharinath@novell.com>
587
588         * delegate.cs (Delegate.VerifyApplicability): If the number of
589         arguments are the same as the number of parameters, first try to
590         verify applicability ignoring  any 'params' modifier on the last
591         parameter.
592         Fixes #56442.
593
594 2004-04-08  Martin Baulig  <martin@ximian.com>
595
596         Merged latest changes into gmcs.  Please keep this comment in
597         here, it makes it easier for me to see what changed in MCS since
598         the last time I merged.
599
600 2004-04-16  Raja R Harinath  <rharinath@novell.com>
601
602         * class.cs (TypeContainer.AddIndexer): Use
603         'ExplicitInterfaceName' to determine if interface name was
604         explicitly specified.  'InterfaceType' is not initialized at this time.
605         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
606         Indexers array is already in the required order.  Initialize
607         'IndexerName' only if there are normal indexers.
608         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
609         (TypeContainer.Emit): Emit DefaultMember attribute only if
610         IndexerName is initialized.
611         Fixes #56300.
612
613 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
614
615         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
616         Fixes #57007
617
618 2004-04-15  Raja R Harinath  <rharinath@novell.com>
619
620         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
621         attributes.
622         Fix for #56456.
623
624         * attribute.cs (Attribute.Resolve): Check for duplicate named
625         attributes.
626         Fix for #56463.
627
628 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
629
630         * iterators.cs (MarkYield): track whether we are in an exception,
631         and generate code accordingly.  Use a temporary value to store the
632         result for our state.
633
634         I had ignored a bit the interaction of try/catch with iterators
635         since their behavior was not entirely obvious, but now it is
636         possible to verify that our behavior is the same as MS .NET 2.0
637
638         Fixes 54814
639
640 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
641
642         * iterators.cs: Avoid creating temporaries if there is no work to
643         do. 
644
645         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
646         Enumerations, use TypeManager.EnumToUnderlying and call
647         recursively. 
648
649         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
650         bug #57013
651
652         (This.Emit): Use EmitContext.EmitThis to emit our
653         instance variable.
654
655         (This.EmitAssign): Ditto.
656
657         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
658         codepaths, we will move all the functionality into
659         Mono.CSharp.This 
660
661         (FieldExpr.EmitAssign): Ditto.
662
663         This fixes several hidden bugs that I uncovered while doing a code
664         review of this today.
665
666         * codegen.cs (EmitThis): reworked so the semantics are more clear
667         and also support value types "this" instances.
668
669         * iterators.cs: Changed so that for iterators in value types, we
670         do not pass the value type as a parameter.  
671
672         Initialization of the enumerator helpers is now done in the caller
673         instead of passing the parameters to the constructors and having
674         the constructor set the fields.
675
676         The fields have now `assembly' visibility instead of private.
677
678 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
679
680         * expression.cs (Argument.Resolve): Check if fields passed as ref
681         or out are contained in a MarshalByRefObject.
682
683         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
684         another compiler type.
685
686 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
687
688         * class.cs (Indexer.Define): use the new name checking method.
689         Also, return false on an error.
690         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
691         (is_identifier_[start/part]_character): make static.
692
693 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
694
695         * expression.cs (Binary.ResolveOperator): Do no append strings
696         twice: since we can be invoked more than once (array evaluation)
697         on the same concatenation, take care of this here.  Based on a fix
698         from Ben (bug #56454)
699
700 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
701
702         * codegen.cs: Fix another case where CS1548 must be reported (when 
703         delay-sign isn't specified and no private is available #56564). Fix
704         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
705         error when MCS is used on the MS runtime and we need to delay-sign 
706         (which seems unsupported by AssemblyBuilder - see #56621).
707
708 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
709
710         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
711         (TypeManager.ComputeNamespaces): Faster implementation for
712         Microsoft runtime.
713
714         * compiler.csproj: Updated AssemblyName to mcs.
715
716 2004-05-11  Jackson Harper  <jackson@ximian.com>
717
718         * Makefile: Preserve MONO_PATH
719         
720 2004-05-11  Jackson Harper  <jackson@ximian.com>
721
722         * Makefile: Use mono and mcs to build gmcs
723         
724 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
725
726         * codegen.cs: Add patch from Robert Shade
727         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
728         sync with mcs.
729
730 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
731
732         * CryptoConvert.cs: Updated to latest version. Fix issue with 
733         incomplete key pairs (#57941).
734
735 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
736
737         * codegen.cs: Fix another case where CS1548 must be reported (when 
738         delay-sign isn't specified and no private is available #56564). Fix
739         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
740         error when MCS is used on the MS runtime and we need to delay-sign 
741         (which seems unsupported by AssemblyBuilder - see #56621).
742
743 2004-04-29  Jackson Harper  <jackson@ximian.com>
744
745         * Makefile: Set MONO_PATH to use the bootstrap corlib
746         * driver.cs: Check the GAC for referenced assemblies.
747                 
748 2004-04-29  Martin Baulig  <martin@ximian.com>
749
750         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
751
752 2004-04-07  Martin Baulig  <martin@ximian.com>
753
754         * expression.cs (Binary.ResolveOperator): Added special case for
755         Equality/Inequality between a type parameter and a null literal.
756
757 2004-04-07  Martin Baulig  <martin@ximian.com>
758
759         * convert.cs: Check null literal -> type parameter conversions.
760
761 2004-04-07  Martin Baulig  <martin@ximian.com>
762
763         * generic.cs (ConstructedType.CheckConstraints): Enforce the
764         `class' and `struct' constraints.
765
766 2004-04-07  Martin Baulig  <martin@ximian.com>
767
768         * generic.cs (SpecialConstraint): New public enum.
769         (Constraints.Resolve): Added support for the `class' and `struct'
770         constraints.
771
772         * cs-parser.jay (type_parameter_constraint): Added support for the
773         `class' and `struct' constraints.
774
775 2004-04-07  Martin Baulig  <martin@ximian.com>
776
777         * support.cs (GenericConstraints): Replaced `Types' by
778         `ClassConstraint' and `InterfaceConstraints'; added
779         `HasClassConstraint'.   
780
781 2004-04-07  Martin Baulig  <martin@ximian.com>
782
783         * generic.cs
784         (Constraints.InterfaceConstraints): New public property.
785         (Constraints.Types): Make this property public
786         (TypeParameter): Implement IMemberContainer.
787         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
788         instead of a TypeBuilder/MethodBuilder; pass the interface
789         constraints to TypeManager.AddTypeParameter().
790         (TypeParameter.DefineType): Just take an EmitContext and no
791         TypeBuilder/MethodBuilder.  Use the new public API.
792
793         * typemanager.cs (TypeManager.AddTypeParameter): Added
794         `TypeExpr[]' argument; add the interfaces to the
795         `builder_to_ifaces' hash.
796         (TypeManager.LookupMemberContainer): For
797         GenericTypeParameterBuilders, get the TypeParameter from the
798         `builder_to_type_param'.
799         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
800         the TypeParameter and call FindMembers on it.
801
802 2004-04-07  Martin Baulig  <martin@ximian.com>
803
804         * class.cs
805         (MethodCore.GenericMethod): Moved this field here from Method.
806         (MethodCore.IsDuplicateImplementation): Take the number of type
807         parameters into account if we're a generic method.
808
809         * expression.cs (Invocation.InferTypeArguments): Don't return true
810         if `arguments' is null; we still need to check whether we actually
811         don't need to infer anything in this case.
812         (MemberAccess): Merged the functionality from GenericMemberAccess
813         into this class.
814
815         * generic.cs (GenericMemberAccess): Removed.
816
817 2004-04-05  Martin Baulig  <martin@ximian.com>
818
819         * decl.cs (MemberCore): For generic classes, interfaces and
820         structs, `Name' now includes the number of type parameters
821         ("Stack!1.Node!1").
822         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
823         encode the number of type arguments in the type name.
824
825         * expression.cs (Expression.MemberLookup): Removed the
826         `num_type_args' argument; we now encode the number of type
827         arguments in the type name.
828
829         * ecore.cs (SimpleName): Encode the number of type arguments in
830         the type name itself.
831
832         * generic.cs (ConstructedType): Likewise.
833
834         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
835         `MemberName'; we now include the number of type parameters in the
836         type name.
837
838         * typemanager.cs (TypeManager.CheckGeneric): Removed.
839         (TypeManager.MemberLookup): Removed the
840         `num_type_args' argument; we now encode the number of type
841         arguments in the type name.     
842
843 2004-04-03  Martin Baulig  <martin@ximian.com>
844
845         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
846         (MemberCore.MemberName): Moved here from MemberBase.
847         (DeclSpace.SetParameterInfo): Just take the constraints as an
848         ArrayList; we already have the type parameters in our
849         `MemberName'; also do the CS0080 reporting here.
850
851         * cs-parser.jay (struct_declaration): Use `member_name' instead of
852         `IDENTIFIER opt_type_parameter_list'; when constructing our
853         `MemberName', it'll already include our type parameters.
854         (class_declaration, interface_declaration): Likewise.
855         (delegate_declaration): Likewise.
856         (MakeName): Take a MemberName and return a MemberName.
857         The following two changes are required to avoid shift/reduce conflicts:
858         (member_name): Don't include a TypeName anymore; ie. this is now
859         just 'IDENTIFIER opt_type_parameter_list'.
860         (property_declaration, event_declaration): Use a
861         `namespace_or_type_name' instead of a `member_name'.            
862
863 2004-04-03  Martin Baulig  <martin@ximian.com>
864
865         * decl.cs (MemberName): Renamed to `TypeName' and created a new
866         `MemberName' class.
867         (TypeName): Formerly known as MemberName.
868
869         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
870         instead of a `MemberName'.
871
872         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
873         (member_name): New rule; create a MemberName.
874
875 2004-04-02  Martin Baulig  <martin@ximian.com>
876
877         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
878         (CS0305 and CS0308).
879
880 2004-04-02  Martin Baulig  <martin@ximian.com>
881
882         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
883         support for nested types.
884
885 2004-04-02  Martin Baulig  <martin@ximian.com>
886
887         * ecore.cs (IAlias): New public interface.
888         (TypeExpr, TypeExpression): Implement IAlias.
889         (TypeAliasExpression): New public class.
890
891         * namespace.cs (Namespace): Implement IAlias.
892         (Namespace.Lookup): Return an IAlias instead on an object.
893         (Namespace.DefineName): Take an IAlias instead of an object.
894         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
895         an object.
896         (NamespaceEntry.UsingAlias): Take a Membername instead of an
897         Expression.
898         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
899         object.
900         (NamespaceEntry.Lookup): Likewise.
901
902         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
903         instead of a Type.      
904
905         * decl.cs (DeclSpace): Implement IAlias.
906         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
907
908         * generic.cs (ConstructedType): Improved error checking.
909
910 2004-04-02  Martin Baulig  <martin@ximian.com>
911
912         * convert.cs: Added type parameter conversions.
913
914         * ecore.cs
915         (UnboxCast.Emit): Emit an `unbox.any' for type params.
916         (ClassCast.Emit): If the source type is a type parameter, box it.
917         If the target type is a type parameter, emit an `unbox.any'
918         instead of a `classcast'.1      
919
920 2004-04-01  Martin Baulig  <martin@ximian.com>
921
922         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
923
924 2004-04-01  Martin Baulig  <martin@ximian.com>
925
926         * expression.cs (Invocation.EmitCall): If we're invoking a method
927         on a type parameter, use the new `Constrained' prefix opcode.
928
929 2004-04-01  Martin Baulig  <martin@ximian.com>
930
931         * generic.cs (ConstructedType.CheckConstraints): Use
932         Convert.ImplicitStandardConversionExists(); user-defined implicit
933         conversions are not allowed according to the spec.
934
935 2004-03-30  Martin Baulig  <martin@ximian.com>
936
937         * expression.cs (New): Added support for type parameters.
938
939         * typemanager.cs
940         (TypeManager.activator_type): New public static field.
941         (TypeManager.activator_create_instance): Likewise.
942
943 2004-03-30  Martin Baulig  <martin@ximian.com>
944
945         * typemanager.cs (TypeManager.HasConstructorConstraint): New
946         public method.
947
948 2004-03-30  Martin Baulig  <martin@ximian.com>
949
950         * generic.cs (ConstructedType.CheckConstraints): Actually follow
951         the spec here: the argument type must be convertible to the
952         constraints.
953
954 2004-03-30  Martin Baulig  <martin@ximian.com>
955
956         * generic.cs
957         (TypeParameter.Define, TypeParameter.DefineMethod): Call
958         TypeManager.AddTypeParameter().
959         (ConstructedType.CheckConstraints): Re-enable this and actually
960         check whether we have a constructor constraint.
961
962         * typemanager.cs
963         (TypeManager.builder_to_type_param): New static field.
964         (TypeManager.AddTypeParameter): New static method.
965         (TypeManager.LookupTypeParameter): New public method.
966
967 2004-03-30  Martin Baulig  <martin@ximian.com>
968
969         * generic.cs (TypeParameter.DefineType): Return a boolean and use
970         the new API to actually define the constructor constraint.
971
972         * typemanager.cs
973         (TypeManager.new_constraint_attr_type): New static field.
974         (TypeManager.InitCoreTypes): Initialize it.
975
976 2004-03-30  Martin Baulig  <martin@ximian.com>
977
978         * generic.cs (Constraints): Completed error checking, use correct
979         error numbers.
980
981 2004-03-29  Martin Baulig  <martin@ximian.com>
982
983         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
984
985         * expression.cs (Invocation.InferTypeArguments): Added overloaded
986         public version which takes a `ParameterData pd' instead of an
987         `ArrayList args'.
988
989 2004-03-29  Martin Baulig  <martin@ximian.com>
990
991         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
992         not a MethodInfo.       
993
994 2004-03-29  Martin Baulig  <martin@ximian.com>
995
996         * expression.cs (Argument.ResolveMethodGroup): If we're a
997         ConstructedType, call GetMemberAccess() on it.  
998
999 2004-03-29  Martin Baulig  <martin@ximian.com>
1000
1001         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
1002         (MethodCore.CheckGenericOverride): When overriding a generic
1003         method, check whether the constraints match.
1004
1005         * support.cs (GenericConstraints): New public interface.
1006         (ParameterData.GenericConstraints): New public method.
1007
1008         * parameter.cs (Parameter.Resolve): Check whether we're a generic
1009         method parameter and compute our constraints if appropriate.
1010         (Parameter.GenericConstraints): New public property.
1011
1012         * generic.cs (Constraints): Implement GenericConstraints.
1013
1014 2004-03-29  Martin Baulig  <martin@ximian.com>
1015
1016         * decl.cs (MemberCache.FindMemberToOverride): Use
1017         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
1018
1019 2004-03-29  Martin Baulig  <martin@ximian.com>
1020
1021         * generic.cs (GenericMethod.Define): Resolve our type parameters.
1022
1023 2004-03-29  Martin Baulig  <martin@ximian.com>
1024
1025         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
1026         not allowed on non-generic declarations").
1027
1028 2004-03-29  Martin Baulig  <martin@ximian.com>
1029
1030         * expression.cs (Invocation.InferTypeArguments): Added overloaded
1031         public version of this method.
1032
1033         * class.cs (MethodCore.IsDuplicateImplementation): Use
1034         Invocation.InferTypeArguments() to check this.
1035
1036 2004-03-29  Martin Baulig  <martin@ximian.com>
1037
1038         * convert.cs: Use TypeManager.IsDelegateType() instead of
1039         comparing types correctly.
1040
1041 2004-03-29  Martin Baulig  <martin@ximian.com>
1042
1043         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
1044         types directly to make it work for generic instances.
1045
1046         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
1047
1048 2004-03-29  Martin Baulig  <martin@ximian.com>
1049
1050         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
1051         support for arrays.     
1052
1053 2004-03-24  Martin Baulig  <martin@ximian.com>
1054
1055         * decl.cs (DeclSpace.FindType): Also use
1056         TypeManager.CheckGeneric() for types from the using clauses.
1057
1058 2004-03-23  Martin Baulig  <martin@ximian.com>
1059
1060         * expression.cs (Invocation.OverloadResolve): Added `bool
1061         may_fail' argument and use it instead of the Location.IsNull() hack.
1062
1063 2004-03-23  Martin Baulig  <martin@ximian.com>
1064
1065         * expression.cs (Invocation.InferType): Use correct type inference
1066         rules here.     
1067
1068 2004-03-23  Martin Baulig  <martin@ximian.com>
1069
1070         * ecore.cs (MethodGroupExpr.Name): Use
1071         TypeManager.CSharpSignature() instead of just the name.
1072
1073         * expression.cs (Invocation.OverloadResolve): Provide better error
1074         reporting.
1075         (Invocation.DoResolve): OverloadResolve() never returns null
1076         without reporting an error, so removed the error -6 reporting here.
1077
1078 2004-03-23  Martin Baulig  <martin@ximian.com>
1079
1080         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
1081         generic methods.
1082
1083         * cs-parser.jay (delegate_declaration): Support generic delegates.
1084
1085         * delegate.cs: Support generic delegates.
1086
1087 2004-03-22  Martin Baulig  <martin@ximian.com>
1088
1089         * expression.cs (Invocation.InferParamsTypeArguments): New static
1090         method; does type inference for params arguments.
1091
1092 2004-03-21  Martin Baulig  <martin@ximian.com>
1093
1094         * typemanager.cs (TypeManager.IsGenericMethod): New public static
1095         method; checks whether a method is a generic method.    
1096
1097         * expression.cs (Invocation.InferTypeArguments): New static method;
1098         infer type arguments for generic method invocation.
1099
1100         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
1101         property; we set this to true if we're resolving a generic method
1102         invocation and the user specified type arguments, ie. we're not
1103         doing type inference.
1104
1105 2004-03-20  Martin Baulig  <martin@ximian.com>
1106
1107         * class.cs (MethodData.DeclaringType): New public property.
1108         (MethodData.Define): Set DeclaringType here.
1109         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
1110         instead of OperatorMethodBuilder.DeclaringType.
1111
1112 2004-03-20  Martin Baulig  <martin@ximian.com>
1113
1114         * cs-tokenizer.cs (xtoken): Return a special
1115         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
1116
1117         * cs-parser.jay (default_value_expression): Switch to the new
1118         syntax (14.5.13).
1119
1120 2004-03-19  Martin Baulig  <martin@ximian.com>
1121
1122         * decl.cs (MemberName): New class.  We use this to "construct"
1123         namespace_or_type_name's.
1124
1125         * generics.cs (TypeArguments.GetDeclarations): New public method;
1126         returns the type arguments as a string[] and reports a CS0081 if
1127         one of them is not an identifier.
1128
1129         * class.cs (MemberBase): The .ctor now takes the name as a
1130         MemberName instead of a string.
1131         (MemberBase.ExplicitInterfaceName): Changed type from string to
1132         Expression.
1133         (MemberBase.DoDefine): If we're an explicit implementation, the
1134         InterfaceType may be a generic instance.
1135
1136         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
1137         (namespace_name): Call MemberName.GetName () to transform the
1138         MemberName into a string and ensure we don't have any type
1139         arguments.
1140         (type_name): Call MemberName.GetTypeExpression() to transfrom the
1141         MemberName into an expression.
1142         (method_header): Use namespace_or_type_name instead of member_name.     
1143
1144 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
1145
1146         * rootcontext.cs: Add new types to the boot resolution.
1147
1148         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
1149         MulticastDelegate is not allowed.
1150
1151         * typemanager.cs: Add new types to lookup: System.TypedReference
1152         and ArgIterator.
1153
1154         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
1155         check for TypedReference or ArgIterator, they are not allowed. 
1156
1157         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
1158         makes us properly catch 1510 in some conditions (see bug 56016 for
1159         details). 
1160
1161 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
1162
1163         * CryptoConvert.cs: update from corlib version
1164         with endian fixes.
1165
1166 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
1167
1168         * class.cs (Indexer.Define): Check indexername declaration
1169
1170 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
1171
1172         * attribute.cs (IsClsCompliant): Fixed problem with handling
1173         all three states (compliant, not-compliant, undetected).
1174
1175 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
1176
1177         * attribute.cs (Attribute): Location is now public.
1178         (Resolve): Store resolved arguments (pos_values) in attribute class.
1179         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
1180         (GetClsCompliantAttributeValue): New method that gets
1181         CLSCompliantAttribute value.
1182         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
1183         if exists else null.
1184         (AttributeTester): New class for CLS-Compliant verification routines.
1185
1186         * class.cs (Emit): Add CLS-Compliant verification.
1187         (Method.GetSignatureForError): Implemented.
1188         (Constructor.GetSignatureForError): Implemented
1189         (Constructor.HasCompliantArgs): Returns if constructor has
1190         CLS-Compliant arguments.
1191         (Constructor.Emit): Override.
1192         (Construcor.IsIdentifierClsCompliant): New method; For constructors
1193         is needed to test only parameters.
1194         (FieldBase.GetSignatureForError): Implemented.
1195         (TypeContainer): New member for storing base interfaces.
1196         (TypeContainer.FindMembers): Search in base interfaces too.
1197
1198         * codegen.cs (GetClsComplianceAttribute): New method that gets
1199         assembly or module CLSCompliantAttribute value.
1200         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
1201         for assembly.
1202         (ModuleClass.Emit): Add error 3012 test.
1203
1204         * const.cs (Emit): Override and call base for CLS-Compliant tests.
1205
1206         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
1207         state for all decl types.
1208         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
1209         if CLS-Compliant tests are required.
1210         (IsClsCompliaceRequired): New method. Analyze whether code
1211         must be CLS-Compliant.
1212         (IsExposedFromAssembly): New method. Returns true when MemberCore
1213         is exposed from assembly.
1214         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
1215         value or gets cached value.
1216         (HasClsCompliantAttribute): New method. Returns true if MemberCore
1217         is explicitly marked with CLSCompliantAttribute.
1218         (IsIdentifierClsCompliant): New abstract method. This method is
1219         used to testing error 3005.
1220         (IsIdentifierAndParamClsCompliant): New method. Common helper method
1221         for identifier and parameters CLS-Compliant testing.
1222         (VerifyClsCompliance): New method. The main virtual method for
1223         CLS-Compliant verifications.
1224         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
1225         null. I don't know why is null (too many public members !).
1226         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
1227         and get value of first CLSCompliantAttribute that found.
1228
1229         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
1230         (VerifyClsCompliance): Override and add extra tests.
1231
1232         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
1233         clscheck- disable CLS-Compliant verification event if assembly is has
1234         CLSCompliantAttribute(true).
1235
1236         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
1237         ApllyAttribute is now called in emit section as in the other cases.
1238         Possible future Emit integration.
1239         (IsIdentifierClsCompliant): New override.
1240         (VerifyClsCompliance): New override.
1241         (GetEnumeratorName): Returns full enum name.
1242
1243         * parameter.cs (GetSignatureForError): Implemented.
1244
1245         * report.cs (WarningData): New struct for Warning message information.
1246         (LocationOfPreviousError): New method.
1247         (Warning): New method. Reports warning based on the warning table.
1248         (Error_T): New method. Reports error based on the error table.
1249
1250         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
1251         verifications are done here.
1252
1253         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
1254
1255         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
1256         CLSCompliantAttribute.
1257         (all_imported_types): New member holds all imported types from other
1258         assemblies.
1259         (LoadAllImportedTypes): New method fills static table with exported types
1260         from all referenced assemblies.
1261         (Modules): New property returns all assembly modules.
1262
1263 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
1264
1265         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
1266         throwing a parser error.
1267
1268         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
1269         which removes the hardcoded get_/set_ prefixes for properties, as
1270         IL allows for the properties to be named something else.  
1271
1272         Bug #56013
1273
1274         * expression.cs: Do not override operand before we know if it is
1275         non-null.  Fix 56207
1276
1277 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1278
1279         * typemanager.cs: support for pinned variables.
1280
1281 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1282
1283         * decl.cs, typemanager.cs: Avoid using an arraylist
1284         as a buffer if there is only one result set.
1285
1286 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1287
1288         * expression.cs: Make sure you cant call a static method
1289         with an instance expression, bug #56174.
1290
1291 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
1292
1293         * class.cs (IsDuplicateImplementation): Improve error reporting to
1294         flag 663 (method only differs in parameter modifier).
1295
1296         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
1297         in preprocessor directives.
1298
1299         * location.cs (LookupFile): Allow for the empty path.
1300
1301         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
1302         better approach for some of that patch, but its failing with the
1303         CharSet enumeration.  For now try/catch will do.
1304
1305         * typemanager.cs: Do not crash if a struct does not have fields.
1306         Fixes 56150.
1307
1308 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
1309
1310         * expression.cs: cs0213, cant fix a fixed expression.
1311         fixes 50231.
1312
1313 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
1314
1315         * cs-parser.jay: detect invalid embeded statements gracefully.
1316         bug #51113.
1317
1318 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
1319
1320         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
1321         As a regex:
1322         s/
1323         the invocation type may not be a subclass of the tye of the item/
1324         The type of the item must be a subclass of the invocation item.
1325         /g
1326
1327         Fixes bug #50820.
1328
1329 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
1330
1331         * attribute.cs: Added methods to get a string and a bool from an
1332         attribute. Required to information from AssemblyKeyFileAttribute,
1333         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
1334         * codegen.cs: Modified AssemblyName creation to include support for
1335         strongnames. Catch additional exceptions to report them as CS1548.
1336         * compiler.csproj: Updated include CryptoConvert.cs.
1337         * compiler.csproj.user: Removed file - user specific configuration.
1338         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
1339         Mono.Security assembly. The original class is maintained and tested in
1340         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
1341         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
1342         like CSC 8.0 (C# v2) supports.
1343         * Makefile: Added CryptoConvert.cs to mcs sources.
1344         * rootcontext.cs: Added new options for strongnames.
1345
1346 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
1347
1348         * driver.cs: For --expect-error, report error code `2'
1349         if the program compiled with no errors, error code `1' if
1350         it compiled with an error other than the one expected.
1351
1352 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
1353
1354         * compiler.csproj: Updated for Visual Studio .NET 2003.
1355         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
1356         * compiler.sln: Updated for Visual Studio .NET 2003.
1357
1358 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
1359
1360         * expression.cs: Fix bug #47234. We basically need to apply the
1361         rule that we prefer the conversion of null to a reference type
1362         when faced with a conversion to 'object' (csc behaviour).
1363
1364 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1365
1366         * statement.cs: Shorter form for foreach, eliminates
1367         a local variable. r=Martin.
1368
1369 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1370
1371         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
1372         checks if we can use brtrue/brfalse to test for 0.
1373         * expression.cs: use the above in the test for using brtrue/brfalse.
1374         cleanup code a bit.
1375
1376 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1377
1378         * expression.cs: Rewrite string concat stuff. Benefits:
1379
1380         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
1381         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
1382         rather than a concat chain.
1383
1384         * typemanager.cs: Add lookups for more concat overloads.
1385
1386 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
1387
1388         * expression.cs: Emit shorter il code for array init.
1389
1390         newarr
1391         dup
1392         // set 1
1393
1394         // set 2
1395
1396         newarr
1397         stloc.x
1398
1399         ldloc.x
1400         // set 1
1401
1402         ldloc.x
1403         // set 2
1404
1405 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
1406
1407         * statement.cs: Before, two switch blocks would be merged if the
1408         total size of the blocks (end_item - begin_item + 1) was less than
1409         two times the combined sizes of the blocks.
1410
1411         Now, it will only merge if after the merge at least half of the
1412         slots are filled.
1413
1414         fixes 55885.
1415
1416 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
1417
1418         * class.cs : csc build fix for GetMethods(). See bug #52503.
1419
1420 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
1421
1422         * expression.cs: Make sure fp comparisons work with NaN.
1423         This fixes bug #54303. Mig approved this patch a long
1424         time ago, but we were not able to test b/c the runtime
1425         had a related bug.
1426
1427 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
1428
1429         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
1430
1431 2004-03-19  Martin Baulig  <martin@ximian.com>
1432
1433         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
1434         two overloads may unify for some type parameter substitutions and
1435         report a CS0408 if appropriate.
1436
1437 2004-03-19  Martin Baulig  <martin@ximian.com>
1438
1439         * class.cs (MemberCore.IsDuplicateImplementation): Report the
1440         error here and not in our caller.
1441
1442 2004-03-19  Martin Baulig  <martin@ximian.com>
1443
1444         * interface.cs: Completely killed this file.
1445         (Interface): We're now a TypeContainer and live in class.cs.
1446
1447         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
1448         argument; we're now also called for interfaces.
1449         (TypeContainer.DefineMembers): Allow this method being called
1450         multiple times.
1451         (TypeContainer.GetMethods): New public method; formerly known as
1452         Interface.GetMethod().  This is used by PendingImplementation.
1453         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
1454         it's now private and non-static.
1455         (Interface): Moved this here; it's now implemented similar to
1456         Class and Struct.
1457         (Method, Property, Event, Indexer): Added `bool is_interface'
1458         argument to their .ctor's.
1459         (MemberBase.IsInterface): New public field.
1460
1461         * cs-parser.jay: Create normal Method, Property, Event, Indexer
1462         instances instead of InterfaceMethod, InterfaceProperty, etc.
1463         (opt_interface_base): Removed; we now use `opt_class_base' instead.
1464         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
1465
1466 2004-03-19  Martin Baulig  <martin@ximian.com>
1467
1468         * class.cs (MethodCore.IsDuplicateImplementation): New private
1469         method which does the CS0111 checking.
1470         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
1471         Use IsDuplicateImplementation().
1472
1473 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
1474
1475         * decl.cs (FindMemberToOverride): New method to find the correct
1476         method or property to override in the base class.
1477         * class.cs
1478             - Make Method/Property use the above method to find the
1479               version in the base class.
1480             - Remove the InheritableMemberSignatureCompare as it is now
1481               dead code.
1482
1483         This patch makes large code bases much faster to compile, as it is
1484         O(n) rather than O(n^2) to do this validation.
1485
1486         Also, it fixes bug 52458 which is that nested classes are not
1487         taken into account when finding the base class member.
1488
1489         Reviewed/Approved by Martin.
1490
1491 2004-03-17  Martin Baulig  <martin@ximian.com>
1492
1493         * expression.cs (MemberAccess.DoResolve): Take the parent's number
1494         of type arguments into account; use the `real_num_type_args'
1495         approach like in DoResolveAsTypeStep().
1496
1497         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
1498         nested types.
1499
1500 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
1501
1502         * interface.cs: In all interface classes removed redundant
1503         member initialization.
1504
1505 2004-03-16  Martin Baulig  <martin@ximian.com>
1506
1507         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
1508
1509 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
1510
1511         * decl.cs (DefineTypeAndParents): New helper method to define a
1512         type's containers before the type itself is defined;  This is a
1513         bug exposed by the recent changes to Windows.Forms when an
1514         implemented interface was defined inside a class that had not been
1515         built yet.   
1516
1517         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
1518
1519         (Check): Loop correctly to report errors modifiers
1520         (UNSAFE was not in the loop, since it was the same as TOP).
1521
1522         * interface.cs: Every interface member now takes a ModFlags,
1523         instead of a "is_new" bool, which we set on the base MemberCore. 
1524
1525         Every place where we called "UnsafeOk" in the interface, now we
1526         call the proper member (InterfaceMethod.UnsafeOK) instead to get
1527         the unsafe settings from the member declaration instead of the
1528         container interface. 
1529
1530         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
1531
1532         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
1533         `set_indexer_name' to the pending bits (one per type).
1534
1535         We fixed a bug today that was picking the wrong method to
1536         override, since for properties the existing InterfaceMethod code
1537         basically ignored the method name.  Now we make sure that the
1538         method name is one of the valid indexer names.
1539
1540 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
1541  
1542         * support.cs (SeekableStreamReader): Keep track of stream byte
1543         positions and don't mix them with character offsets to the buffer.
1544
1545         Patch from Gustavo Giráldez
1546
1547 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
1548
1549         * interface.cs (InterfaceSetGetBase): Removed double member
1550         initialization, base class does it as well.
1551
1552 2004-03-13  Martin Baulig  <martin@ximian.com>
1553
1554         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
1555         when compiling corlib.
1556
1557 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
1558
1559         * convert.cs (ExplicitConversion): We were reporting an error on
1560         certain conversions (object_type source to a value type, when the
1561         expression was `null') before we had a chance to pass it through
1562         the user defined conversions.
1563
1564         * driver.cs: Replace / and \ in resource specifications to dots.
1565         Fixes 50752
1566
1567         * class.cs: Add check for duplicate operators.  Fixes 52477
1568
1569 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
1570
1571         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
1572         that are in the middle of the statements, not only at the end.
1573         Fixes #54987
1574
1575         * class.cs (TypeContainer.AddField): No longer set the
1576         `HaveStaticConstructor' flag, now we call it
1577         `UserDefineStaticConstructor' to diferentiate the slightly
1578         semantic difference.
1579
1580         The situation is that we were not adding BeforeFieldInit (from
1581         Modifiers.TypeAttr) to classes that could have it.
1582         BeforeFieldInit should be set to classes that have no static
1583         constructor. 
1584
1585         See:
1586
1587         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
1588
1589         And most importantly Zoltan's comment:
1590
1591         http://bugzilla.ximian.com/show_bug.cgi?id=44229
1592
1593         "I think beforefieldinit means 'it's ok to initialize the type sometime 
1594          before its static fields are used', i.e. initialization does not need
1595          to be triggered by the first access to the type. Setting this flag
1596          helps the JIT to compile better code, since it can run the static
1597          constructor at JIT time, and does not need to generate code to call it
1598          (possibly lots of times) at runtime. Unfortunately, mcs does not set
1599          this flag for lots of classes like String. 
1600          
1601          csc sets this flag if the type does not have an explicit static 
1602          constructor. The reasoning seems to be that if there are only static
1603          initalizers for a type, and no static constructor, then the programmer
1604          does not care when this initialization happens, so beforefieldinit
1605          can be used.
1606          
1607          This bug prevents the AOT compiler from being usable, since it 
1608          generates so many calls to mono_runtime_class_init that the AOT code
1609          is much slower than the JITted code. The JITted code is faster, 
1610          because it does not generate these calls if the vtable is type is
1611          already initialized, which is true in the majority of cases. But the
1612          AOT compiler can't do this."
1613
1614 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
1615
1616         * class.cs (MethodData.Emit): Refactor the code so symbolic
1617         information is generated for destructors;  For some reasons we
1618         were taking a code path that did not generate symbolic information
1619         before. 
1620
1621 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
1622
1623         * class.cs: Create a Constructor.CheckBase method that
1624         takes care of all validation type code. The method
1625         contains some code that was moved from Define.
1626
1627         It also includes new code that checks for duplicate ctors.
1628         This fixes bug #55148.
1629
1630 2004-03-09  Joshua Tauberer <tauberer@for.net>
1631
1632         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
1633         a { ... }-style array creation invokes EmitStaticInitializers
1634         which is not good for reference-type arrays.  String, decimal
1635         and now null constants (NullCast) are not counted toward
1636         static initializers.
1637
1638 2004-03-05  Martin Baulig  <martin@ximian.com>
1639
1640         * location.cs (SourceFile.HasLineDirective): New public field;
1641         specifies whether the file contains or is referenced by a "#line"
1642         directive.
1643         (Location.DefineSymbolDocuments): Ignore source files which
1644         either contain or are referenced by a "#line" directive.        
1645
1646 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
1647
1648         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
1649         direct access to our parent, so check the method inline there.
1650
1651 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
1652
1653         * expression.cs (Invocation.EmitCall): Miguel's last commit
1654         caused a regression. If you had:
1655
1656             T t = null;
1657             t.Foo ();
1658
1659         In Foo the implict this would be null.
1660
1661 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
1662
1663         * expression.cs (Invocation.EmitCall): If the method is not
1664         virtual, do not emit a CallVirt to it, use Call.
1665
1666         * typemanager.cs (GetFullNameSignature): Improve the method to
1667         cope with ".ctor" and replace it with the type name.
1668
1669         * class.cs (ConstructorInitializer.Resolve): Now the method takes
1670         as an argument the ConstructorBuilder where it is being defined,
1671         to catch the recursive constructor invocations.
1672
1673 2004-03-16  Martin Baulig  <martin@ximian.com>
1674
1675         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
1676         ConstructedType, call ResolveType() on it to get the type rather
1677         than just using `expr.Type'.
1678
1679 2004-03-16  Martin Baulig  <martin@ximian.com>
1680
1681         * generics.cs (ConstructedType.GetMemberAccess): Take the
1682         EmitContext instead on the TypeExpr and use
1683         ec.TypeContainer.CurrentType/ec.ContainerType.
1684
1685 2004-03-16  Martin Baulig  <martin@ximian.com>
1686
1687         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
1688         parameters before aliases.
1689
1690 2004-03-16  Martin Baulig  <martin@ximian.com>
1691
1692         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
1693         New oublic function; checks whether two generic instances may become
1694         equal under some instantiations (26.3.1).
1695
1696         * class.cs (TypeContainer.Define): Call
1697         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
1698         error.
1699
1700 2004-03-16  Martin Baulig  <martin@ximian.com>
1701
1702         * class.cs (TypeContainer.GetClassBases): Moved
1703         Error_TypeParameterAsBase() here and also check whether the base
1704         class is not an attribute.
1705
1706 2004-03-16  Martin Baulig  <martin@ximian.com>
1707
1708         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
1709
1710 2004-03-16  Martin Baulig  <martin@ximian.com>
1711
1712         * class.cs (Error_TypeParameterAsBase): Use correct error number
1713         here (CS0689).  
1714
1715 2004-03-16  Martin Baulig  <martin@ximian.com>
1716
1717         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
1718         for generics.
1719
1720         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
1721         error reporting.
1722
1723 2004-03-15  Martin Baulig  <martin@ximian.com>
1724
1725         * typemanager.cs (TypeManager.GetFullName): New public method.
1726         (TypeManager.MemberLookup): Added `int_num_type_arguments'
1727         argument; only return members with the correct number of type
1728         arguments.
1729         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
1730         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
1731         whether the number of type arguments matches.
1732
1733         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
1734         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
1735
1736         * expression.cs (MemberAccess): Added public `NumTypeArguments'
1737         field; it's set by the protected .ctor when we're actually a
1738         GenericMemberAccess.
1739         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
1740         arguments and pass it to MemberLookupFinal ().
1741
1742         * ecore.cs (Expression.MemberLookup): Added `int
1743         num_type_arguments' argument; only return members with the correct
1744         number of type arguments.
1745         (Expression.MemberLookupFailed): Check whether the MemberLookup
1746         failed because we did not have the correct number of type
1747         arguments; report CS0305 in this case.
1748
1749         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
1750         `e.ResolveAsTypeTerminal()' already did so.
1751
1752 2004-03-15  Martin Baulig  <martin@ximian.com>
1753
1754         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
1755         we're a ConstructedType; in this case, the caller must report an
1756         error (for instance CS0131).
1757
1758         * generic.cs (TypeArguments): Added Location argument to the .ctor.
1759         (TypeArguments.Resolve): Actually report errors here.
1760
1761 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
1762
1763         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
1764         `set_indexer_name' to the pending bits (one per type).
1765
1766         We fixed a bug today that was picking the wrong method to
1767         override, since for properties the existing InterfaceMethod code
1768         basically ignored the method name.  Now we make sure that the
1769         method name is one of the valid indexer names.
1770
1771 2004-03-15  Martin Baulig  <martin@ximian.com>
1772
1773         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
1774         for generic instances.
1775
1776 2004-03-13  Martin Baulig  <martin@ximian.com>
1777
1778         * class.cs (TypeContainer.DefineType): Call
1779         TypeManager.AddUserType() immediately after creating the
1780         TypeBuilder; pass all type parameters when creating the
1781         CurrentType.
1782
1783         * decl.cs (DeclSpace.FindNestedType): New public method.
1784         (DeclSpace.FindType): Added `int num_type_args' argument; only
1785         return types with the correct number of type parameters.
1786         (DeclSpace.CountTypeParams): New public property.
1787
1788         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
1789         the number of type parameters; defaults to zero.
1790
1791         * generic.cs (TypeArguments.Count): New public property.
1792         (ConstructedType.DoResolveAsTypeStep): First call
1793         ds.FindNestedType() to find out whether we're nested in the
1794         current generic type; in this case, we inherit all type parameters
1795         from the current class.
1796
1797         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
1798         num_type_args' argument.
1799         (RootContext.LookupType): Added overloaded version which takes the
1800         number of type arguments; only return types with the correct
1801         number of type arguments.
1802
1803         * typemanager.cs (TypeManager.CheckGeneric): New public function;
1804         checks whether `Type t' has `int num_type_args'.
1805
1806 2004-03-13  Martin Baulig  <martin@ximian.com>
1807
1808         * generic.cs (GenericMethod.DefineType): New method; calls
1809         DefineType() on all the type parameters.
1810
1811         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
1812         (MethodData.Define): If we're a generic method, call
1813         GenericMethod.DefineType() to define the type parameters.       
1814
1815 2004-03-10  Martin Baulig  <martin@ximian.com>
1816
1817         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
1818         instead of IsAssignableFrom.    
1819
1820 2004-03-10  Martin Baulig  <martin@ximian.com>
1821
1822         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
1823
1824         * support.cs (ParameterData.HasArrayParameter): New property.
1825         (ReflectionParameters.ctor): Take a MethodBase instead of a
1826         ParameterInfo[].  If we have any type parameters, get the generic
1827         method definition and ask it whether we have variable arguments.
1828
1829 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
1830
1831         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
1832         routines to check if a type is an enumerable/enumerator allow
1833         classes that implement the IEnumerable or IEnumerator interfaces.
1834
1835         * class.cs (Property, Operator): Implement IIteratorContainer, and
1836         implement SetYields.
1837
1838         (Property.Define): Do the block swapping for get_methods in the
1839         context of iterators.   We need to check if Properties also
1840         include indexers or not.
1841
1842         (Operator): Assign the Block before invoking the
1843         OperatorMethod.Define, so we can trigger the Iterator code
1844         replacement. 
1845
1846         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
1847         Property and Operator classes are not created when we parse the
1848         declarator but until we have the block completed, so we use a
1849         singleton SimpleIteratorContainer.Simple to flag whether the
1850         SetYields has been invoked.
1851
1852         We propagate this setting then to the Property or the Operator to
1853         allow the `yield' to function.
1854
1855 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
1856
1857         * codegen.cs: Implemented attribute support for modules.
1858         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
1859         Assembly/Module functionality.
1860
1861         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
1862         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
1863         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
1864
1865 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
1866
1867         * interface.cs (FindMembers): The operation is performed on all base
1868         interfaces and not only on the first. It is required for future CLS Compliance patch.
1869
1870 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
1871
1872         * statement.cs, codegen.cs:
1873         This patch deals with patterns such as:
1874
1875         public class List : IEnumerable {
1876
1877                 public MyEnumerator GetEnumerator () {
1878                         return new MyEnumerator(this);
1879                 }
1880
1881                 IEnumerator IEnumerable.GetEnumerator () {
1882                         ...
1883                 }
1884                 
1885                 public struct MyEnumerator : IEnumerator {
1886                         ...
1887                 }
1888         }
1889
1890         Before, there were a few things we did wrong:
1891         1) we would emit callvirt on a struct, which is illegal
1892         2) we emited ldarg when we needed to emit ldarga
1893         3) we would mistakenly call the interface methods on an enumerator
1894         type that derived from IEnumerator and was in another assembly. For example:
1895
1896         public class MyEnumerator : IEnumerator
1897
1898         Would have the interface methods called, even if there were public impls of the
1899         method. In a struct, this lead to invalid IL code.
1900
1901 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
1902
1903         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
1904           renamed to Emit.
1905
1906         * delegate.cs (Define): Fixed crash when delegate type is undefined.
1907
1908 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
1909
1910         * cs-parser.jay: Fix small regression: we were not testing V2
1911         compiler features correctly.
1912
1913         * interface.cs: If the emit context is null, then create one
1914
1915 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
1916
1917         * decl.cs (GetSignatureForError): New virtual method to get full name
1918           for error messages.
1919
1920         * attribute.cs (IAttributeSupport): New interface for attribute setting.
1921           Now it is possible to rewrite ApplyAttributes method to be less if/else.
1922
1923         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
1924           Duplicated members and code in these classes has been removed.
1925           Better encapsulation in these classes.
1926
1927 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
1928
1929         * assign.cs (Assign.DoResolve): When dealing with compound
1930         assignments, there is a new rule in ECMA C# 2.4 (might have been
1931         there before, but it is documented here) that states that in:
1932
1933         a op= b;
1934
1935         If b is of type int, and the `op' is a shift-operator, then the
1936         above is evaluated as:
1937
1938         a = (int) a op b 
1939
1940         * expression.cs (Binary.ResolveOperator): Instead of testing for
1941         int/uint/long/ulong, try to implicitly convert to any of those
1942         types and use that in pointer arithmetic.
1943
1944         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
1945         method to print information for from the type, not from the
1946         null-method we were given.
1947
1948 2004-02-01  Duncan Mak  <duncan@ximian.com>
1949
1950         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
1951         parsing for cmd, fixes bug #53694.
1952
1953 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
1954
1955         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
1956         in the member name duplication tests. Property and operator name duplication
1957         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
1958
1959 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
1960
1961         * interface.cs (PopulateMethod): Fixed crash when interface method
1962         returns not existing type (error test cs0246-3.cs).
1963
1964 2004-02-02  Ravi Pratap M <ravi@ximian.com>
1965
1966         * cs-parser.jay (interface_accessors): Re-write actions to also
1967         store attributes attached to get and set methods. Fix spelling
1968         while at it.
1969
1970         (inteface_property_declaration): Modify accordingly.
1971
1972         (InterfaceAccessorInfo): New helper class to store information to pass
1973         around between rules that use interface_accessors.
1974
1975         * interface.cs (Emit): Apply attributes on the get and set
1976         accessors of properties and indexers too.
1977
1978         * attribute.cs (ApplyAttributes): Modify accordingly to use the
1979         right MethodBuilder when applying attributes to the get and set accessors.
1980
1981 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
1982
1983         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
1984
1985 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
1986
1987         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
1988
1989 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
1990
1991         * cs-parser.jay: Remove YIELD token, instead use the new grammar
1992         changes that treat `yield' specially when present before `break'
1993         or `return' tokens.
1994
1995         * cs-tokenizer.cs: yield is no longer a keyword.
1996
1997 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
1998
1999         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
2000         setting for default constructors.
2001         For default constructors are almost every time set wrong Modifier. The
2002         generated IL code has been alright. But inside mcs this values was
2003         wrong and this was reason why several of my CLS Compliance tests
2004         failed.
2005
2006 2004-02-27  Martin Baulig  <martin@ximian.com>
2007
2008         * generics.cs (ConstructedType.ResolveType): Make the nested type
2009         stuff actually work.
2010
2011 2004-02-25  Martin Baulig  <martin@ximian.com>
2012
2013         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
2014         property; returns the type parameters just from the current type,
2015         ie. with the ones from outer classes.
2016         (DeclSpace.LookupGeneric): First search in the current class, then
2017         in outer classes.
2018         (DeclSpace.initialize_type_params): When hiding a type parameter
2019         from an outer class, put it into the `type_param_list' anyways.
2020
2021         * expression.cs (MemberAccess.expr): Made this field protected.
2022
2023         * class.cs (TypeContainer.Define): The `CurrentType' just contains
2024         the type parameters from the current class.
2025
2026         * generic.cs (ConstructedType.ResolveType): Support nested generic
2027         types by taking the type parameters which we inherit from outer
2028         classes into account.
2029         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
2030         support for nested generic types.
2031
2032 2004-02-23  Martin Baulig  <martin@ximian.com>
2033
2034         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
2035         field and check whether we're nested inside a generic type.
2036         (DeclSpace.ResolveType): If we're resolving to a generic type
2037         definition, create a ConstructedType and return its resolved type.
2038         (DeclSpace.initialize_type_params): New private method;
2039         initializes the `type_param_list' field from the type parameters
2040         from this and all enclosing classes.
2041         (DeclSpace.TypeParameters): Call initialize_type_params() unless
2042         we're already initialized.
2043
2044 2004-02-23  Martin Baulig  <martin@ximian.com>
2045
2046         * class.cs (Method.Define): Create the generic method before
2047         calling DoDefine().
2048         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
2049         the TypeContainer one); we use this for generic methods.
2050
2051         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
2052         parent's TypeBuilder.
2053
2054 2004-02-18  Martin Baulig  <martin@ximian.com>
2055
2056         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
2057         to check for equality.
2058
2059 2004-02-05  Martin Baulig  <martin@ximian.com>
2060
2061         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
2062         `ec.TypeContainer.CurrentType', use it instead of
2063         `ec.ContainerType' to check whether we're in the type's ctor.
2064
2065 2004-01-29  Martin Baulig  <martin@ximian.com>
2066
2067         * expression.cs (Invocation.DoResolve): If we're a
2068         `ConstructedType', then we're actually a generic method, so
2069         rewrite the expr as a GenericMemberAccess.
2070
2071         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
2072         here; manually parse it into a string.
2073
2074 2004-01-28  Martin Baulig  <martin@ximian.com>
2075
2076         * typemanager.cs (TypeManager.IsEqual): New static method.
2077         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
2078         check for equality instead of using `=='.
2079
2080 2004-01-26  Martin Baulig  <martin@ximian.com>
2081
2082         * decl.cs (DeclSpace.CurrentType): New public field.
2083
2084         * expression.cs (This.ResolveBase): If we have an
2085         `ec.TypeContainer.CurrentType', use it instead of
2086         `ec.ContainerType'.
2087
2088         * class.cs (TypeContainer.DefineType): If we're a generic type,
2089         create the `CurrentType' (unresolved).
2090         (TypeContainer.GenericType): New private field.
2091         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
2092         it and store it in `GenericType' before creating the MemberCache.
2093         (TypeContainer.GetMembers): If we have a `GenericType', call
2094         TypeManager.FindMembers() on it.
2095
2096         * interface.cs (Interface.GenericType): New private field.
2097         (Interface.DefineType): If we're a generic type, create the
2098         `CurrentType' (unresolved).
2099         (Interface.DefineMembers): If we have a `CurrentType', resolve it
2100         and store it in `GenericType' before creating the MemberCache.
2101         (Interface.GetMembers): If we have a `GenericType', call
2102         TypeManager.FindMembers() on it.
2103
2104 2004-01-22  Martin Baulig  <martin@ximian.com>
2105
2106         * cs-parser.jay (namespace_or_type_name): Return an Expression,
2107         not a QualifiedIdentifier.  This is what `type_name_expression'
2108         was previously doing.
2109         (type_name_expression): Removed; the code is now in
2110         `namespace_or_type_name'.
2111         (qualified_identifier): Removed, use `namespace_or_type_name'
2112         instead.
2113         (QualifiedIdentifier): Removed this class.      
2114
2115 2004-01-22  Martin Baulig  <martin@ximian.com>
2116
2117         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
2118         not a string as alias name.
2119
2120 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
2121
2122         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
2123         #52730 bug, and instead compute correctly the need to use a
2124         temporary variable when requesting an address based on the
2125         static/instace modified of the field and the constructor.
2126  
2127 2004-01-21  Martin Baulig  <martin@ximian.com>
2128
2129         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
2130         class and namespace before looking up aliases.  Fixes #52517.
2131
2132 2004-01-21  Martin Baulig  <martin@ximian.com>
2133
2134         * flowanalysis.cs (UsageVector.Merge): Allow variables being
2135         assinged in a 'try'; fixes exception4.cs.
2136
2137 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
2138         * class.cs : Implemented parameter-less constructor for TypeContainer
2139
2140         * decl.cs: Attributes are now stored here. New property OptAttributes
2141
2142         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
2143
2144         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
2145
2146 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
2147
2148         * typemanager.cs (CSharpSignature): Now reports also inner class name.
2149           (CSharpSignature): New method for indexer and property signature.
2150
2151 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
2152
2153         * pending.cs (IsVirtualFilter): Faster implementation.
2154
2155 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
2156
2157         * typemanager.cs: Avoid inclusion of same assembly more than once.
2158
2159 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
2160
2161         * cs-parser.jay: Fixed problem where the last assembly attribute
2162           has been applied also to following declaration (class, struct, etc.)
2163           
2164 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
2165
2166         * class.cs: Added error CS0538, CS0539 reporting.
2167         Fixed crash on Microsoft runtime when field type is void.
2168
2169         * cs-parser.jay: Added error CS0537 reporting.
2170
2171         * pending.cs: Added error CS0535 reporting.
2172         Improved error report for errors CS0536, CS0534.
2173
2174 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
2175
2176         Merge a few bits from the Anonymous Method MCS tree.
2177
2178         * statement.cs (ToplevelBlock): New class for toplevel methods,
2179         will hold anonymous methods, lifted variables.
2180
2181         * cs-parser.jay: Create toplevel blocks for delegates and for
2182         regular blocks of code. 
2183
2184 2004-01-20  Martin Baulig  <martin@ximian.com>
2185
2186         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
2187         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
2188         and `NeedExplicitReturn'; added `IsLastStatement'.
2189         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
2190         have a `ReturnLabel' or we're not unreachable.
2191
2192         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
2193         child's reachability; don't just override ours with it.  Fixes
2194         #58058 (lluis's example).
2195         (FlowBranching): Added public InTryOrCatch(), InCatch(),
2196         InFinally(), InLoop(), InSwitch() and
2197         BreakCrossesTryCatchBoundary() methods.
2198
2199         * statement.cs (Return): Do all error checking in Resolve().
2200         Unless we are the last statement in a top-level block, always
2201         create a return label and jump to it.
2202         (Break, Continue): Do all error checking in Resolve(); also make
2203         sure we aren't leaving a `finally'.
2204         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
2205         statement in a top-level block.
2206         (Block.Flags): Added `IsDestructor'.
2207         (Block.IsDestructor): New public property.
2208
2209 2004-01-20  Martin Baulig  <martin@ximian.com>
2210
2211         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
2212
2213 2004-01-20  Martin Baulig  <martin@ximian.com>
2214
2215         * statement.cs (Statement.ResolveUnreachable): New public method.
2216         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
2217         (Block.Resolve): Resolve unreachable statements.
2218
2219 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
2220
2221         * expression.cs: We need to fix the case where we do
2222         not have a temp variable here.
2223
2224         * assign.cs: Only expression compound assignments need
2225         temporary variables.
2226
2227 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
2228
2229         * flowanalysis.cs: Reduce memory allocation in a few ways:
2230           - A block with no variables should not allocate a bit
2231             vector for itself.
2232           - A method with no out parameters does not need any tracking
2233             for assignment of the parameters, so we need not allocate
2234             any data for it.
2235           - The arrays:
2236                 public readonly Type[] VariableTypes;
2237                 public readonly string[] VariableNames;
2238             Are redundant. The data is already stored in the variable
2239             map, so we need not allocate another array for it.
2240           - We need to add alot of checks for if (params | locals) == null
2241             due to the first two changes.
2242
2243 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
2244
2245         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
2246         implement IMemoryLocation, we store a copy on a local variable and
2247         take the address of it.  Patch from Benjamin Jemlich
2248
2249         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
2250         to use a special "type_name_expression" rule which reduces the
2251         number of "QualifiedIdentifier" classes created, and instead
2252         directly creates MemberAccess expressions.
2253
2254 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
2255
2256         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
2257         that fixes #52853.  Null literal assignment to ValueType
2258
2259         * class.cs (MethodData.Emit): Instead of checking the name of the
2260         method to determine if its a destructor, create a new derived
2261         class from Method called Destructor, and test for that.  
2262
2263         * cs-parser.jay: Create a Destructor object instead of a Method.  
2264
2265         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
2266
2267         Fixes: 52933
2268
2269 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
2270
2271         * expression.cs (Binary.ResolveOperator): Perform an implicit
2272         conversion from MethodGroups to their delegate types on the
2273         Addition operation.
2274
2275         * delegate.cs: Introduce a new class DelegateCreation that is the
2276         base class for `NewDelegate' and `ImplicitDelegateCreation',
2277         factor some code in here.
2278
2279         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
2280         conversion from MethodGroups to compatible delegate types. 
2281
2282         * ecore.cs (Expression.Resolve): Do not flag error 654
2283         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
2284         we allow conversions from MethodGroups to delegate types now.
2285
2286         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
2287         assignments in v2 either.
2288
2289 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
2290
2291         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
2292         static read-only fields in ctors.
2293
2294         Applied patch from Benjamin Jemlich 
2295
2296         * expression.cs (UnaryMutator): Avoid leaking local variables. 
2297
2298 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
2299
2300         * cs-tokenizer.cs (IsCastToken): Allow the various native types
2301         here to return true, as they can be used like this:
2302
2303                 (XXX) int.MEMBER ()
2304
2305         Fixed 49836 and all the other dups
2306
2307 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
2308
2309         * driver.cs: Implement /win32res and /win32icon.
2310
2311 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
2312
2313         * cs-parser.jay: Add a rule to improve error handling for the
2314         common mistake of placing modifiers after the type.
2315
2316 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
2317
2318         * cs-parser.jay (interface_event_declaration): Catch
2319         initialization of events on interfaces, and report cs0068
2320
2321         * cs-parser.jay (interface_event_declaration): Catch
2322         initialization of events. 
2323
2324         * ecore.cs: Better report missing constructors.
2325
2326         * expression.cs (Binary.ResolveOperator): My previous bug fix had
2327         the error reporting done in the wrong place.  Fix.
2328
2329         * expression.cs (Binary.ResolveOperator): Catch the 
2330         operator + (E x, E y) error earlier, and later allow for implicit
2331         conversions in operator +/- (E e, U x) from U to the underlying
2332         type of E.
2333
2334         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
2335         52596, if the container class is abstract, the default constructor
2336         is protected otherwise its public (before, we were always public).
2337
2338         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
2339         fixed statement.
2340
2341         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
2342         Jemlich that fixes bug #52597, MCS was generating invalid code for
2343         idisposable structs.   Thanks to Ben for following up with this
2344         bug as well.
2345
2346 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
2347
2348         * driver.cs: Allow assemblies without code to be generated, fixes
2349         52230.
2350
2351 2004-01-07  Nick Drochak <ndrochak@gol.com>
2352
2353         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
2354
2355 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
2356
2357         * cs-parser.jay: Add rules to improve error reporting if fields or
2358         methods are declared at the namespace level (error 116)
2359
2360         * Add rules to catch event add/remove
2361
2362 2004-01-04  David Sheldon <dave-mono@earth.li>
2363
2364   * expression.cs: Added matching ")" to error message for 
2365   CS0077
2366
2367 2004-01-03 Todd Berman <tberman@gentoo.org>
2368
2369         * ecore.cs, attribute.cs:
2370         Applying fix from #52429.
2371
2372 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2373
2374         * ecore.cs, expression.cs, statement.cs:
2375         Total rewrite of how we handle branching. We
2376         now handle complex boolean expressions with fewer
2377         jumps. As well if (x == 0) no longer emits a ceq.
2378
2379         if (x is Foo) is much faster now, because we generate
2380         better code.
2381
2382         Overall, we get a pretty big improvement on our benchmark
2383         tests. The code we generate is smaller and more readable.
2384
2385         I did a full two-stage bootstrap. The patch was reviewed
2386         by Martin and Miguel.
2387
2388 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2389
2390         * cs-parser.jay: Make primary_expression not take a QI.
2391         we dont need this because the member_access rule covers
2392         us here. So we replace the rule with just IDENTIFIER.
2393
2394         This has two good effects. First, we remove a s/r conflict.
2395         Second, we allocate many fewer QualifiedIdentifier objects.
2396
2397 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2398
2399         * attribute.cs: Handle MarshalAs attributes as pseudo, and
2400         set the correct information via SRE. This prevents
2401         hanging on the MS runtime. Fixes #29374.
2402
2403 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
2404
2405         * convert.cs: correctly handle conversions to value types
2406         from Enum and ValueType as unboxing conversions.
2407
2408         Fixes bug #52569. Patch by Benjamin Jemlich.
2409
2410 2004-01-02  Ravi Pratap  <ravi@ximian.com>
2411
2412         * expression.cs (BetterConversion): Prefer int -> uint
2413         over int -> ulong (csc's behaviour). This fixed bug #52046.
2414
2415 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
2416
2417         * decl.cs (MemberCache.FindMembers): now returns a
2418         MemberInfo [].
2419
2420         * typemanager.cs: In general, go with with ^^.
2421         (CopyNewMethods): take an IList.
2422         (RealMemberLookup): Only allocate an arraylist
2423         if we copy from two sets of methods.
2424
2425         This change basically does two things:
2426         1) Fewer array lists allocated due to CopyNewMethods.
2427         2) the explicit cast in MemberList costed ALOT.
2428
2429 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
2430
2431         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
2432         a hashtable to avoid needless string allocations when an identifier is
2433         used more than once (the common case).
2434
2435 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
2436
2437         * pending.cs: MS's TypeBuilder.GetInterfaces ()
2438         is broken, it will not return anything. So, we
2439         have to use the information we have in mcs to
2440         do the task.
2441
2442         * typemanager.cs: Add a cache for GetInterfaces,
2443         since this will now be used more often (due to ^^)
2444
2445         (GetExplicitInterfaces) New method that gets the
2446         declared, not effective, interfaces on a type
2447         builder (eg, if you have interface IFoo, interface
2448         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
2449         { IBar }.
2450
2451         This patch makes MCS able to bootstrap itself on
2452         Windows again.
2453
2454 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
2455
2456         * expression.cs: Remove the Nop's that Miguel put
2457         in by mistake.
2458
2459 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2460
2461         * report.cs, codegen.cs: Give the real stack trace to
2462         the error when an exception is thrown.
2463
2464 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2465
2466         * decl.cs: only allocate hashtables for ifaces if 
2467         it is an iface!
2468
2469 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2470
2471         * expression.cs: fix the error from cs0121-2.cs
2472         (a parent interface has two child interfaces that
2473         have a function with the same name and 0 params
2474         and the function is called through the parent).
2475
2476 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2477
2478         * class.cs, rootcontext.cs, typmanager.cs: do not
2479         leak pointers.
2480
2481 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2482
2483         * codegen.cs: remove stack for the ec flow branching.
2484         It is already a linked list, so no need.
2485
2486 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
2487
2488         * Makefile: Allow custom profiler here.
2489
2490 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
2491
2492         * typemanager.cs (LookupType):
2493           - Use a static char [], because split takes
2494             a param array for args, so it was allocating
2495             every time.
2496           - Do not store true in a hashtable, it boxes.
2497
2498 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
2499
2500         * flowanalysis.cs: bytify common enums.
2501
2502 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
2503
2504         * modifiers.cs: Add a new set of flags for the
2505         flags allowed on explicit interface impls.
2506         * cs-parser.jay: catch the use of modifiers in
2507         interfaces correctly.
2508         * class.cs: catch private void IFoo.Blah ().
2509
2510         All related to bug #50572.
2511
2512 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
2513
2514         * decl.cs: Rewrite the consistant accessability checking.
2515         Accessability is not linear, it must be implemented in
2516         a tableish way. Fixes #49704.
2517
2518 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
2519
2520         * expression.cs: Handle negation in a checked context.
2521         We must use subtraction from zero. Fixes #38674.
2522
2523 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2524
2525         * class.cs: Ignore static void main in DLLs.
2526         * rootcontext.cs: Handle the target type here,
2527         since we are have to access it from class.cs
2528         * driver.cs: account for the above.
2529
2530 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2531
2532         * report.cs: Give line numbers and files if available.
2533
2534 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
2535
2536         * driver.cs: Implement /addmodule.
2537
2538         * typemanager.cs:  Change 'modules' field so it now contains Modules not
2539         ModuleBuilders.
2540
2541 2003-12-20  Martin Baulig  <martin@ximian.com>
2542
2543         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
2544         (FieldBase.IsAssigned): Removed this field.
2545         (FieldBase.SetAssigned): New public method.
2546         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
2547
2548 2003-12-20  Martin Baulig  <martin@ximian.com>
2549
2550         * expression.cs (LocalVariableReference.DoResolve): Don't set
2551         `vi.Used' if we're called from DoResolveLValue().
2552
2553         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
2554         returns the usage vector it just merged into the current one -
2555         pass this one to UsageWarning().
2556         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
2557         of the `EmitContext', don't call this recursively on our children.
2558
2559 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
2560
2561         * driver.cs: Implement /target:module.
2562
2563 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
2564
2565         * support.cs (CharArrayHashtable): New helper class.
2566
2567         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
2568         char arrays, not strings, so we can avoid creating a string in
2569         consume_identifier if the identifier is a keyword.
2570
2571 2003-12-16  Martin Baulig  <martin@ximian.com>
2572
2573         * statement.cs (LocalInfo.Assigned): Removed this property.
2574         (LocalInfo.Flags): Removed `Assigned'.
2575         (LocalInfo.IsAssigned): New public method; takes the EmitContext
2576         and uses flow analysis.
2577         (Block.UsageWarning): Made this method private.
2578         (Block.Resolve): Call UsageWarning() if appropriate.
2579
2580         * expression.cs (LocalVariableReference.DoResolve): Always set
2581         LocalInfo.Used here.
2582
2583 2003-12-13  Martin Baulig  <martin@ximian.com>
2584
2585         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
2586         any value here; we're now using flow analysis to figure out
2587         whether a statement/block returns a value.
2588
2589 2003-12-13  Martin Baulig  <martin@ximian.com>
2590
2591         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
2592         working again.
2593         (FlowBranching.MergeFinally): Don't call
2594         `branching.CheckOutParameters()' here, this is called in
2595         MergeTopBlock().
2596         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
2597         when adding the `finally' vector.       
2598
2599 2003-12-13  Martin Baulig  <martin@ximian.com>
2600
2601         * flowanalysis.cs
2602         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
2603         actually work and also fix #48962.
2604
2605 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
2606
2607         * decl.cs: Do not check System.Object for nested types,
2608         since we know it does not have any. Big bang for buck:
2609
2610         BEFORE:
2611            Run 1:   8.35 seconds
2612            Run 2:   8.32 seconds
2613            corlib:  17.99 seconds
2614         AFTER:
2615            Run 1:   8.17 seconds
2616            Run 2:   8.17 seconds
2617            corlib:  17.39 seconds
2618
2619 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
2620
2621         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
2622         time we are returning 0 members, so we save alot here.
2623
2624 2003-12-11  Martin Baulig  <martin@ximian.com>
2625
2626         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
2627         `MergeChild()', also just take the `FlowBranching' as argument;
2628         call Merge() on it and return the result.
2629         (FlowBranching.Merge): We don't need to do anything if we just
2630         have one sibling.
2631
2632 2003-12-11  Martin Baulig  <martin@ximian.com>
2633
2634         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
2635         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
2636         Maurer for this idea.
2637
2638 2003-12-11  Martin Baulig  <martin@ximian.com>
2639
2640         * flowanalysis.cs (MergeResult): This class is now gone; we now
2641         use the `UsageVector' for this.  The reason for this is that if a
2642         branching just has one sibling, we don't need to "merge" them at
2643         all - that's the next step to do.
2644         (FlowBranching.Merge): We now return a `UsageVector' instead of a
2645         `MergeResult'.
2646
2647 2003-12-11  Martin Baulig  <martin@ximian.com>
2648
2649         Reworked flow analyis and made it more precise and bug-free.  The
2650         most important change is that we're now using a special `Reachability'
2651         class instead of having "magic" meanings of `FlowReturns'.  I'll
2652         do some more cleanups and optimizations and also add some more
2653         documentation this week.
2654
2655         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
2656         largely reworked this class.
2657         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
2658         the new `Reachability' class instead of having "magic" values here.
2659         (FlowBranching): We're now using an instance of `Reachability'
2660         instead of having separate `Returns', `Breaks' etc. fields.
2661
2662         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
2663         based on flow analysis; ignore the return value of block.Emit ().
2664
2665 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
2666
2667         * driver.cs typemanager.cs: Find the mono extensions to corlib even
2668         if they are private.
2669
2670 2003-12-09  Martin Baulig  <martin@ximian.com>
2671
2672         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
2673         call them directly on the UsageVector.
2674
2675 2003-12-09  Martin Baulig  <martin@ximian.com>
2676
2677         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
2678         Changed return type from `FlowReturns' to `Reachability'.
2679
2680 2003-12-09  Martin Baulig  <martin@ximian.com>
2681
2682         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
2683         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
2684         `Reachable' fields with a single `Reachability' one.
2685
2686 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2687
2688         * class.cs (FindMembers): Remove foreach's.
2689
2690         Bootstrap times:
2691
2692         BEFORE
2693                 Run 1:   8.74 seconds
2694                 Run 2:   8.71 seconds
2695
2696         AFTER
2697                 Run 1:   8.64 seconds
2698                 Run 2:   8.58 seconds
2699
2700
2701 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2702
2703         * cs-parser.jay:
2704         * gen-treedump.cs:
2705         * statement.cs:
2706         This patch does a few things:
2707                 1. EmptyStatement is now a singleton, so it is never reallocated.
2708                 2. All blah is EmptyStatement constructs have been changed to
2709                    blah == EmptyStatement.Value, which is much faster and valid
2710                    now that EmptyStatement is a singleton.
2711                 3. When resolving a block, rather than allocating a new array for
2712                    the non-empty statements, empty statements are replaced with
2713                    EmptyStatement.Value
2714                 4. Some recursive functions have been made non-recursive.
2715         Mainly the performance impact is from (3), however (1) and (2) are needed for
2716         this to work. (4) does not make a big difference in normal situations, however
2717         it makes the profile look saner.
2718
2719         Bootstrap times:
2720
2721         BEFORE
2722         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
2723         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
2724         Total memory allocated: 56397 KB
2725
2726         AFTER
2727         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
2728         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
2729         Total memory allocated: 55666 KB
2730
2731 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2732
2733         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
2734         than the hashtable in a hashtable version
2735
2736         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
2737         we always end up concating a string. This results in a huge perf
2738         loss, because many strings have to be tracked by the GC. In this
2739         patch, we first use a hashtable that works with two keys, so that
2740         the strings do not need to be concat'ed.
2741
2742         Bootstrap times:
2743         BEFORE
2744                 Run 1:   8.74 seconds
2745                 Run 2:   8.71 seconds
2746
2747         AFTER
2748                 Run 1:   8.65 seconds
2749                 Run 2:   8.56 seconds
2750
2751 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
2752
2753         * Makefile: Add a new target `do-time' that does a quick and simple
2754         profile, leaving easy to parse output.
2755
2756 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
2757
2758         * codegen.cs (Init): Create the dynamic assembly with 
2759         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
2760
2761 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
2762
2763         * support.cs: Make the PtrHashtable use only one
2764         instance of its comparer.
2765
2766 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
2767
2768         * typemanager.cs: Fix lookup of GetNamespaces.
2769
2770 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
2771
2772         * expression.cs: Removed redundant line.
2773
2774         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
2775         ArrayLists, use for loops with bounds.  
2776
2777         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
2778         arraylist.
2779
2780         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
2781         arraylists, use for loop with bounds.
2782
2783         The above three changes give us a 0.071 second performance
2784         improvement out of 3.294 seconds down to 3.223.  On my machine
2785         the above changes reduced the memory usage by 1,387 KB during
2786         compiler bootstrap.
2787
2788         * cs-parser.jay (QualifiedIdentifier): New class used to represent
2789         QualifiedIdentifiers.  Before we created a new string through
2790         concatenation, and mostly later on, the result would be
2791         manipulated by DecomposeQI through string manipulation.
2792
2793         This reduced the compiler memory usage for bootstrapping from
2794         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
2795         compile times in 0.05 seconds.
2796
2797 2003-11-28  Dick Porter  <dick@ximian.com>
2798
2799         * support.cs: Do string compares with the Invariant culture.
2800
2801         * rootcontext.cs: 
2802         * gen-treedump.cs: 
2803         * expression.cs: 
2804         * driver.cs: 
2805         * decl.cs: 
2806         * codegen.cs: 
2807         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
2808         the comparison is done with the Invariant culture.
2809
2810 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
2811
2812         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
2813         GetEnumerator method.
2814
2815         (ProbeCollectionType): Iterate starting at the most specific type
2816         upwards looking for a GetEnumerator
2817
2818         * expression.cs: Shift count can be up to 31 for int/uint and 63
2819         for long/ulong.
2820
2821 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
2822
2823         * statement.cs (Block.LookupLabel): Also look for the label on the
2824         children blocks.  Use a hash table to keep track of visited
2825         nodes. 
2826
2827         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
2828         we actually did transform the other operand, otherwise fall back
2829         to the common codepath that casts to long.
2830
2831         * cs-tokenizer.cs: Use the same code pattern as the int case.
2832         Maybe I should do the parsing myself, and avoid depending on the
2833         Parse routines to get this done.
2834
2835 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
2836
2837         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
2838         which fixes bug 51347.  This time test it.
2839
2840         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
2841         attributes for example can not tell the difference between these.
2842         The difference was only a syntax feature of the language. 
2843
2844         * attribute.cs: Apply attributes to delegates.
2845
2846         * delegate.cs: Call the apply attributes method.
2847
2848 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
2849
2850         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
2851         comparing 0 vs Byte.MinValue, not the value
2852
2853         (ImplicitConversionRequired): When reporting a conversion error,
2854         use error 31 to print out the constant error instead of the
2855         simpler 29.
2856
2857         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
2858         which fixes bug 51347.
2859
2860 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
2861
2862         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
2863         which fixes the -warnaserror command line option.
2864
2865 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
2866
2867         * cfold.cs (DoNumericPromotions): During constant folding of
2868         additions on UIntConstant, special case intconstants with
2869         IntConstants like we do on the expression binary operator. 
2870
2871 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
2872
2873         * convert.cs (ImplicitReferenceConversion): We were missing a case
2874         (System.Enum are not value types or class types, so we need to
2875         classify them separatedly).
2876
2877         * driver.cs: We do not support error 2007.
2878
2879 2003-11-12 Jackson Harper <jackson@ximian.com>
2880
2881         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
2882         system directory. Also use the full file name so users can
2883         libraries names mscorlib-o-tron.dll in a non system dir.
2884         
2885 2004-01-04  David Sheldon <dave-mono@earth.li>
2886
2887         * expression.cs: Added matching ")" to error message for CS0077.
2888
2889 2003-12-19  Martin Baulig  <martin@ximian.com>
2890
2891         * typemanager.cs (TypeManager.IsEqualGenericType): New public
2892         static method; see documentation in the method.
2893         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
2894
2895         * convert.cs (Convert.ImplicitReferenceConversion,
2896         Convert.ImplicitReferenceConversionExists): Add support for
2897         generic type declarations; see gen-36.cs.
2898
2899 2003-12-19  Martin Baulig  <martin@ximian.com>
2900
2901         * pending.cs (Pending.InterfaceMethod): Use
2902         `Type.IsAssignableFrom()' instead of `=='.
2903
2904 2003-12-18  Martin Baulig  <martin@ximian.com>
2905
2906         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
2907         byref types first.
2908
2909         * convert.cs (Convert.ImplicitStandardConversionExists): Use
2910         `expr_type.Equals (target_type)' instead of `=='.
2911
2912 2003-12-08  Martin Baulig  <martin@ximian.com>
2913
2914         * generics.cs (Constraints.Types): Removed.
2915         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
2916         to Type's.
2917         (Constraints.ResolveTypes): New public method; resolves the
2918         TypeExpr's to Type's.
2919         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
2920         longer takes the constraints.
2921         (TypeParameter.DefineMethod): Likewise.
2922         (TypeParameter.DefineType): New public method.  Calls
2923         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
2924         the constraints.
2925
2926 2003-12-08  Martin Baulig  <martin@ximian.com>
2927
2928         * convert.cs (Convert.ImplicitConversionStandard): Use
2929         `expr_type.Equals (target_type)' instead of `=='.
2930
2931 2003-12-08  Martin Baulig  <martin@ximian.com>
2932
2933         * typemanager.cs (TypeManager.GetReferenceType): Call
2934         `Type.MakeByRefType ()'.
2935
2936 2003-12-08  Martin Baulig  <martin@ximian.com>
2937
2938         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
2939         just has some special meaning in some situations.  For instance,
2940         it is allowed to use `where' as the name of a variable etc.
2941
2942 2003-12-04  Martin Baulig  <martin@ximian.com>
2943
2944         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2945         `Type.MakeArrayType()' for array types.
2946
2947 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
2948
2949         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
2950         debugging message.
2951
2952         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
2953         corlib to compile.
2954
2955 2003-11-16  Martin Baulig  <martin@ximian.com>
2956
2957         * codegen.cs (EmitContext.IsGeneric): Removed.
2958
2959         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
2960         ResolveGeneric() on the DeclSpace.
2961
2962 2003-11-16  Martin Baulig  <martin@ximian.com>
2963
2964         * generic.cs (TypeArguments.Resolve):
2965         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
2966         `ResolveType()' on it to get the Type.
2967
2968 2003-11-15  Martin Baulig  <martin@ximian.com>
2969
2970         * generic.cs (ConstructedType.GetInterfaces): Override this.
2971
2972 2003-11-14  Martin Baulig  <martin@ximian.com>
2973
2974         * interface.cs (Interface.DefineType): Define all type parameters
2975         before adding the interfaces we inherit.
2976
2977 2003-11-11  Martin Baulig  <martin@ximian.com>
2978
2979         * generic.cs (ConstructedType.ResolveType): Always call
2980         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
2981
2982 2003-11-10  Martin Baulig  <martin@ximian.com>
2983
2984         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
2985         (TypeManager.InitCoreTypes): Initialize them here, but instead of
2986         calling `ResolveType()' on them, directly assign their `Type'.
2987
2988 2003-11-08  Martin Baulig  <martin@ximian.com>
2989
2990         * generic.cs (ConstructedType): Override `IsClass' etc.
2991
2992 2003-11-08  Martin Baulig  <martin@ximian.com>
2993
2994         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
2995         return value and the `out parent' parameter.
2996         (TypeContainer.DefineType): Moved the CS0644 check into
2997         GetClassBases().  Don't pass the interface types to the
2998         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
2999         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
3000
3001         * ecore.cs (TypeExpr.IsAttribute): New property.
3002         (TypeExpr.GetInterfaces): New method.
3003
3004         * interface.cs (Interface.GetInterfaceTypeByName): Return a
3005         TypeExpr instead of a Type.
3006         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
3007         (Interface.DefineType): Don't pass the interface types to the
3008         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
3009         them later and then call `TypeBulider.AddInterfaceImplementation()'.
3010
3011         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
3012         instead of a `Type[]'.
3013         (TypeManager.RegisterBuilder): Likewise.
3014         (TypeManager.AddUserInterface): Likewise.
3015         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
3016         `Type[]' and also return a `TypeExpr[]'.
3017         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
3018
3019 2003-11-08  Martin Baulig  <martin@ximian.com>
3020
3021         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
3022         Expression.     
3023
3024 2003-11-08  Martin Baulig  <martin@ximian.com>
3025
3026         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
3027         TypeManager.ResolveExpressionTypes().
3028
3029         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
3030         instead of an Expression.
3031         (TypeExpr): This is now an abstract base class for `TypeExpression'.
3032         (TypeExpression): New public class; formerly known as `TypeExpr'.
3033
3034         * expression.cs (ComposedCast): Derive from TypeExpr.
3035
3036         * typemanager.cs (TypeManager.system_*_expr): These are now
3037         TypExpr's instead of Expression's.
3038         (TypeManager.ResolveExpressionTypes): New public static function;
3039         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
3040         of them.        
3041
3042 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
3043
3044         * expression.cs (New.DoResolve): Do not dereference value that
3045         might be a null return.
3046
3047         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
3048         sure that the constant value has the right type.  Fixes an
3049         unreported bug, similar to 50425.
3050
3051         * const.cs (Const.LookupConstantValue): Call
3052         ImplicitStandardConversionExists before doing a conversion to
3053         avoid havng the TypeManager.ChangeType do conversions.
3054
3055         Reduced the number of casts used
3056
3057         (Const.ChangeType): New routine to enable reuse of the constant
3058         type changing code from statement.
3059
3060         * typemanager.cs (ChangeType): Move common initialization to
3061         static global variables.
3062
3063         Fixes #50425.
3064
3065         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
3066         every value type to go through, even if it was void.  Fix that. 
3067
3068         * cs-tokenizer.cs: Use is_identifier_start_character on the start
3069         character of the define, and the is_identifier_part_character for
3070         the rest of the string.
3071
3072 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
3073
3074         * expression.cs (UnaryMutator.EmitCode): When I updated
3075         LocalVariableReference.DoResolve, I overdid it, and dropped an
3076         optimization done on local variable references.
3077
3078 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
3079
3080         * ecore.cs: Convert the return from Ldlen into an int.
3081
3082 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
3083
3084         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
3085         the accessibility, this is a special case for toplevel non-public
3086         classes (internal for instance).
3087
3088 2003-10-20  Nick Drochak <ndrochak@gol.com>
3089
3090         * ecore.cs: Fix typo and build.  Needed another right paren.
3091
3092 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
3093
3094         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
3095         `internal' case regular and protected, but not allowing protected
3096         to be evaluated later.  Bug 49840
3097
3098 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
3099
3100         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
3101         to kb.Nlast, and not the kb.nFirst to isolate the switch
3102         statement.
3103
3104         Extract the underlying type, so enumerations of long/ulong are
3105         treated like long/ulong.
3106
3107 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
3108
3109         * expression.cs (New): Overload the meaning of RequestedType to
3110         track the possible creation of the NewDelegate type, since
3111         DoResolve is invoked more than once for new constructors on field
3112         initialization.
3113
3114         See bugs: #48800 and #37014
3115
3116         * cs-parser.jay (declare_local_constants): Take an arraylist
3117         instead of a single constant.
3118
3119         (local_constant_declaration): It should take a
3120         constant_declarators, not a constant_declarator.  Fixes 49487
3121
3122         * convert.cs: Fix error report.
3123
3124 2003-10-13 Jackson Harper <jackson@ximian.com>
3125
3126         * typemanager.cs (TypeToCoreType): Add float and double this fixes
3127         bug #49611
3128         
3129 2003-11-03  Martin Baulig  <martin@ximian.com>
3130
3131         * expression.cs (ArrayAccess.GetStoreOpcode): Added
3132         `out bool has_type_arg'; if set, we need to pass the type to
3133         ig.Emit().
3134         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
3135         Stelem_Any/Ldelem_Any for generic parameters.   
3136
3137 2003-11-02  Martin Baulig  <martin@ximian.com>
3138
3139         * expression.cs (Invocation.EmitCall): Use
3140         `TypeManager.IsValueType()' to check whether it's a value type.
3141         Don't set `struct_call' when calling a method on a type parameter.
3142
3143 2003-11-02  Martin Baulig  <martin@ximian.com>
3144
3145         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
3146         and removed the TypeBuilder argument.
3147
3148         * typemanager.cs (TypeManager.IsValueType): Return
3149         `t.IsGenericParameter || t.IsValueType'.
3150
3151 2003-10-25  Martin Baulig  <martin@ximian.com>
3152
3153         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
3154         call ConstructedType.Resolve() on it.
3155
3156         * generic.cs (ConstructedType.Resolve): Set `type' on success.
3157
3158 2003-10-25  Martin Baulig  <martin@ximian.com>
3159
3160         * class.cs (TypeContainer.GetClassBases): Changed
3161         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
3162         CS8214 reporting here.
3163         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
3164         instead of a `Type' for our parent.  In case of a recursive
3165         declaration (see tests/gen-23.cs for an example), our parent is a
3166         ConstructedType and it doesn't have its type set.  So, first
3167         create our own TypeBuilder, then call constructed.Resolve() to get
3168         the parent's type and finally TypeBuilder.SetParent() it.
3169
3170         * ecore.cs (TypeExpr.Name): New public virtual property.
3171
3172         * generic.cs
3173         (ConstructedType): We're now a TypeExpr and not just an Expression.
3174         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
3175         arguments here; this is done later.
3176         (ConstructedType.Resolve): New public method to resolve the type
3177         arguments and bind them.
3178
3179 2003-10-21  Martin Baulig  <martin@ximian.com>
3180
3181         * convert.cs: Use `TypeManager.IsValueType' instead of
3182         'type.IsValueType' everywhere.
3183
3184         * typemanager.cs (TypeManager.IsValueType): Return true for type
3185         parameters.  The reason for this is that we need to box a type
3186         parameter when converting it to a reference type.
3187
3188         * cs-parser.jay: Added support for default value expressions.
3189
3190         * generics.cs (DefaultValueExpression): New public class.       
3191
3192 2003-10-17  Martin Baulig  <martin@ximian.com>
3193
3194         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
3195         TypeContainer so we can also use this for Interfaces.
3196         (TypeParameter.Resolve): Likewise.
3197
3198         * interface.cs (Interface.DefineType): Added support for generic
3199         interfaces.
3200
3201         * cs-parser.jay: Added support for generic structs and interfaces.
3202
3203 2003-10-17  Martin Baulig  <martin@ximian.com>
3204
3205         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
3206         call generic methods :-)
3207
3208 2003-10-16  Martin Baulig  <martin@ximian.com>
3209
3210         * cs-parser.jay (namespace_or_type_name): Only create a
3211         GenericMemberAccess if we actually have type arguments.
3212
3213 2003-10-13  Martin Baulig  <martin@ximian.com>
3214
3215         * class.cs (Method.Define): If we're a generic method, call
3216         TypeBuilder.DefineGenericMethod () before resolving
3217         the parameters.
3218         (MethodData): Added .ctor which takes an additional MethodBuilder
3219         argument; this is used for generic methods.
3220         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
3221         we already have a MethodBuilder.
3222
3223 2003-10-10  Martin Baulig  <martin@ximian.com>
3224
3225         * class.cs (Method): Added .ctor which takes a `GenericMethod'
3226         instead of a `DeclSpace'.  This is used for generic methods.
3227
3228         * cs-parser.jay (method_header): Added support for generic
3229         methods; create a `GenericMethod' instance and pass it to the
3230         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
3231         parameters and locals.
3232
3233         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
3234         since we already have the location.  Check whether we're a generic
3235         type declaration or a generic method and create the correct type
3236         parameter.
3237
3238         * generic.cs (TypeParameter.DefineMethod): New public method.
3239         (GenericMethod): New public class; derives from DeclSpace and is
3240         used for generic methods.       
3241
3242 2003-10-09  Martin Baulig  <martin@ximian.com>
3243
3244         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
3245         to the .ctor.
3246         (MethodCore.DoDefineParameters): Removed the TypeContainer
3247         argument; use the DeclSpace which was passed to the .ctor instead.
3248         (MethodCore.CheckParameter): Take a DeclSpace instead of a
3249         TypeContainer; we only need a DeclSpace here.
3250
3251 2003-10-09  Martin Baulig  <martin@ximian.com>
3252
3253         * class.cs (MethodData): Added additional `DeclSpace ds' argument
3254         to the .ctor.
3255         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
3256         EmitContext's .ctor.    
3257
3258 2003-10-09  Martin Baulig  <martin@ximian.com>
3259
3260         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
3261         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
3262         AsAccessible(), moved them as well.
3263
3264         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
3265
3266 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
3267
3268         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
3269         generation for >=, as spotted by Paolo, bug 48679.  
3270         Patch from David Waite.
3271
3272         * cs-tokenizer.cs: Add handling for #pragma.
3273
3274         * cs-parser.jay: Allow for both yield and yield return in the
3275         syntax.  The anti-cobolization of C# fight will go on!
3276
3277         * class.cs (TypeBuilder.DefineType): Catch error condition here
3278         (Parent.DefineType erroring out and returning null).
3279
3280         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
3281         coping with enumerations variables, we were mistakenly processing
3282         them as a regular value type instead of built-in types.  Fixes the
3283         bug #48063
3284
3285         * typemanager.cs (IsBuiltinOrEnum): New method.
3286
3287 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
3288
3289         * cs-parser.jay: Upgrade: yield now needs the return clause.
3290
3291 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
3292
3293         * cs-parser.jay : Renamed yyName to yyNames related to jay.
3294
3295 2003-09-29  Martin Baulig  <martin@ximian.com>
3296
3297         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
3298         inflated generic methods.
3299
3300         * generics.cs (ConstructedType): Distinguish between open and
3301         closed constructed types; correctly resolve the arguments.
3302
3303 2003-09-22  Martin Baulig  <martin@ximian.com>
3304
3305         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
3306         all type arguments meet their constraints.
3307
3308 2003-09-19  Martin Baulig  <martin@ximian.com>
3309
3310         * decl.cs (MemberCache.SetupCacheForInterface): Take a
3311         `MemberCache parent' argument.  Normally, an interface doesn't
3312         have a parent type except System.Object, but we use this in gmcs
3313         for generic type parameters.
3314
3315 2003-09-18  Martin Baulig  <martin@ximian.com>
3316
3317         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
3318         on `type.IsInterface'; don't check whether the type has a parent
3319         to determine whether it's an interface.
3320
3321 2003-09-17  Martin Baulig  <martin@ximian.com>
3322
3323         * generic.cs (ConstructedType.ToString): Always use `name' as the
3324         type name.
3325
3326 2003-09-15  Martin Baulig  <martin@ximian.com>
3327
3328         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
3329
3330         * generic.cs (Constraints.Resolve): New public method; this is
3331         called to resolve the constraint types and to check whether all
3332         the constraints are correct.
3333         (Constraints.Types): New public property.
3334         (TypeParameter.Resolve): New public method; resolves all the
3335         type's constraints.
3336
3337         * class.cs (TypeContainer.DefineType): Call
3338         TypeParameter.Resolve() before actually defining the type.
3339
3340 2003-09-15  Martin Baulig  <martin@ximian.com>
3341
3342         * class.cs (TypeContainer.DefineType): Added an error flag to
3343         avoid reporting duplicate CS0146's ("class definition is
3344         circular.").
3345
3346         * driver.cs (Driver.MainDriver): Abort if
3347         RootContext.ResolveTree() reported any errors.
3348
3349 2003-09-07  Martin Baulig  <martin@ximian.com>
3350
3351         * report.cs (Error, Warning): Added overloaded versions which take
3352         a `params object[] args' and call String.Format().
3353
3354 2003-09-07  Martin Baulig  <martin@ximian.com>
3355
3356         * decl.cs (DeclSpace..ctor): Don't call
3357         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
3358         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
3359         (DeclSpace.RecordDecl): New method.
3360
3361         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
3362
3363 2003-09-02  Ravi Pratap  <ravi@ximian.com>
3364
3365         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
3366         value attributes to be applied to ParameterBuilders.
3367
3368         * class.cs (MethodCore.LabelParameters): Make static and more
3369         generic so that it can be used from other places - like interface
3370         methods, for instance.
3371
3372         * interface.cs (Interface.Emit): Call LabelParameters before
3373         emitting attributes on the InterfaceMethod.
3374
3375 2003-09-07  Martin Baulig  <martin@ximian.com>
3376
3377         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
3378         if the number of type parameters doesn't match.
3379
3380 2003-09-04  Martin Baulig  <martin@ximian.com>
3381
3382         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
3383         for arrays of generic type params (ie. `!0[]').
3384
3385 2003-09-04  Martin Baulig  <martin@ximian.com>
3386
3387         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
3388         for the moment.
3389
3390 2003-09-04  Martin Baulig  <martin@ximian.com>
3391
3392         * decl.cs (DeclSpace.LookupGeneric): New method.
3393         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
3394         moment.
3395
3396         * generic.cs (TypeParameterExpr): Take a TypeParameter as
3397         argument, not just a string.
3398         (TypeParameter.Define): New public method; this is called to
3399         actually define the generic parameter; after this, you can use the
3400         new `Type' property to get the type.
3401
3402 2003-09-04  Martin Baulig  <martin@ximian.com>
3403
3404         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
3405         is now an ArrayList; initialize the result of the `TypeParameters'
3406         property here.
3407         (DeclSpace.GetGenericData): Removed.
3408         (DeclSpace.LookupGeneric): Temporarily removed; we need to
3409         implement this in a different way.
3410         (DeclSpace.GetTypeParameters): Removed; there's now a
3411         `TypeParameters' property.
3412         (DeclSpace.TypeParameters): New public property.
3413
3414         * generic.cs (Constraints): Make this class public.
3415         (TypeParameter): New public class.
3416
3417 2003-09-04  Martin Baulig  <martin@ximian.com>
3418
3419         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
3420         generic parameters.
3421
3422         * class.cs (TypeContainer.DefineType): Call
3423         TypeBuilder.DefineGenericParameter () on all generic parameters if
3424         this is a generic type.
3425
3426 2003-08-28  Martin Baulig  <martin@ximian.com>
3427
3428         * sample-stack.il: Compile this with ilasm: "ilasm /dll
3429         sample-stack.il".
3430
3431         * sample-hello.cs: Compile this with gmcs: "gmcs
3432         /r:sample-stack.dll sample-hello.cs".
3433
3434 2003-08-28  Martin Baulig  <martin@ximian.com>
3435
3436         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
3437         the parameters to the generic type.
3438
3439 2003-08-28  Martin Baulig  <martin@ximian.com>
3440
3441         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
3442
3443 2003-08-28  Martin Baulig  <martin@ximian.com>
3444
3445         * cs-parser.jay (opt_type_argument_list): Use
3446         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
3447         (primary_expression): Replace `qualified_identifier' with `type_name'.
3448         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
3449
3450         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
3451         parser to check whether it is syntactically a type parameter list;
3452         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
3453         this case.
3454
3455 2003-08-26  Martin Baulig  <martin@ximian.com>
3456
3457         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
3458         resolving aliases; fixes #47927.
3459
3460 2003-08-26  Martin Baulig  <martin@ximian.com>
3461
3462         * statement.cs (Using.DoResolve): This is internally emitting a
3463         try/finally clause, so we need to set ec.NeedExplicitReturn if we
3464         do not always return.  Fixes #47681.
3465
3466 2003-08-26  Martin Baulig  <martin@ximian.com>
3467
3468         * decl.cs (MemberCore): Moved WarningNotHiding(),
3469         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
3470         into MemberBase.
3471         (AdditionResult): Make this nested in DeclSpace.
3472         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
3473         argument; call NamespaceEntry.Define() unless we're nested in a
3474         class or struct.
3475
3476         * namespace.cs (Namespace.DefineName): New public function.  This
3477         is called from DeclSpace's .ctor to add 
3478         (Namespace.Lookup): Include DeclSpaces in the lookup.
3479
3480         * class.cs (Operator): Derive from MemberBase, not MemberCore.
3481
3482         * const.cs (Const): Derive from MemberBase, not MemberCore.     
3483
3484 2003-08-25  Martin Baulig  <martin@ximian.com>
3485
3486         * convert.cs (Convert.ExplicitReferenceConversion): When
3487         converting from an interface type to a class, unbox if the target
3488         type is a struct type.  Fixes #47822.
3489
3490 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3491
3492         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
3493         #47854.
3494
3495 2003-08-22  Martin Baulig  <martin@ximian.com>
3496
3497         * class.cs (TypeManager.DefineType): When defining a nested type,
3498         call DefineType() on our parent; fixes #47801.
3499
3500 2003-08-22  Martin Baulig  <martin@ximian.com>
3501
3502         * class.cs (MethodData.Define): While checking if a method is an
3503         interface implementation, improve the test a bit more to fix #47654.
3504
3505 2003-08-22  Martin Baulig  <martin@ximian.com>
3506
3507         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
3508         correctly; fixes #47722.
3509
3510 2003-08-22  Martin Baulig  <martin@ximian.com>
3511
3512         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
3513         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
3514
3515         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
3516
3517 2003-08-22  Martin Baulig  <martin@ximian.com>
3518
3519         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
3520         can only be assigned in static constructors.  Fixes #47161.
3521
3522 2003-08-22  Martin Baulig  <martin@ximian.com>
3523
3524         Rewrote and improved the flow analysis code.
3525
3526         * flowbranching.cs (FlowBranching): Make this class abstract.
3527         (FlowBranching.CreateBranching): New static function to create a
3528         new flow branching.
3529         (FlowBranchingBlock, FlowBranchingException): New classes.
3530         (FlowBranching.UsageVector.Type): New public readonly field.
3531         (FlowBranching.UsageVector.Breaks): Removed the setter.
3532         (FlowBranching.UsageVector.Returns): Removed the setter.
3533         (FlowBranching.UsageVector): Added Break(), Return(),
3534         NeverReachable() and Throw() methods to modify the reachability.
3535         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
3536         done by FlowBranching.Merge().
3537         (FlowBranching.UsageVector.MergeChild): New method; merges the
3538         merge result into the current vector.
3539         (FlowBranching.Merge): New abstract method to merge a branching.
3540
3541 2003-08-12  Martin Baulig  <martin@ximian.com>
3542
3543         * expression.cs (Indirection.CacheTemporaries): Create the
3544         LocalTemporary with the pointer type, not its element type.
3545
3546 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
3547
3548         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
3549         token was a keyword or not.
3550
3551         Add `error' options where an IDENTIFIER was expected;  Provide
3552         CheckToken and CheckIdentifierToken convenience error reporting
3553         functions. 
3554
3555         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
3556
3557         * decl.cs: Rename `NamespaceEntry Namespace' public field into
3558         NameSpaceEntry NameSpaceEntry.
3559
3560         (LookupInterfaceOrClass): Avoid creating a full qualified name
3561         from namespace and name: avoid doing lookups when we know the
3562         namespace is non-existant.   Use new Tree.LookupByNamespace which
3563         looks up DeclSpaces based on their namespace, name pair.
3564
3565         * driver.cs: Provide a new `parser verbose' to display the
3566         exception thrown during parsing.  This is turned off by default
3567         now, so the output of a failure from mcs is more graceful.
3568
3569         * namespace.cs: Track all the namespaces defined in a hashtable
3570         for quick lookup.
3571
3572         (IsNamespace): New method
3573
3574 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
3575
3576         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
3577         we know that we need to concatenate (full typename can never be
3578         null). 
3579
3580         * class.cs: ditto.
3581
3582         * statement.cs: Use a bitfield;  Do not initialize to null things
3583         which are done by the constructor by default.
3584
3585         * cs-parser.jay: bug fix, parameter was 4, not 3.
3586
3587         * expression.cs: Just use the property;
3588
3589         * statement.cs: No need for GetVariableInfo method.
3590
3591 2003-08-08  Martin Baulig  <martin@ximian.com>
3592
3593         * flowanalysis.cs (FlowReturns): This is now nested in the
3594         `FlowBranching' class.
3595         (MyBitVector): Moved this here from statement.cs.
3596         (FlowBranching.SiblingType): New enum type.
3597         (FlowBranching.CreateSibling): Added `SiblingType' argument.
3598
3599 2003-08-07  Martin Baulig  <martin@ximian.com>
3600
3601         * flowanalysis.cs (FlowBranchingType): This is now nested in the
3602         `FlowBranching' class and called `BranchingType'.
3603
3604 2003-08-07  Martin Baulig  <martin@ximian.com>
3605
3606         * flowanalysis.cs: Moved all the control flow analysis code into
3607         its own file.
3608
3609 2003-08-07  Martin Baulig  <martin@ximian.com>
3610
3611         * assign.cs (Assign.DoResolve): `target' must either be an
3612         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
3613         #37319.
3614
3615 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
3616
3617         * expression.cs (BinaryMethod): This kind of expression is created by the
3618         Binary class if it determines that the operator has to be handled
3619         by a method.
3620
3621         (BinaryDelegate): This kind of expression is created if we are
3622         dealing with a + or - operator on delegates.
3623
3624         (Binary): remove method, argumetns, and DelegateOperator: when
3625         dealing with methods, 
3626
3627         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
3628
3629         * statement.cs (Block): use bitfields for the three extra booleans
3630         we had in use.   Remove unused topblock parameter.
3631
3632         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
3633
3634         * assign.cs: Drop extra unneeded tests.
3635
3636 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
3637
3638         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
3639
3640         * statement.cs (Foreach): Use VariableStorage instead of
3641         LocalBuilders.   
3642
3643         * codegen.cs (VariableStorage): New class used by clients that
3644         require a variable stored: locals or fields for variables that
3645         need to live across yield.
3646
3647         Maybe provide a convenience api for EmitThis+EmitLoad?
3648
3649         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
3650         these bad boys.
3651
3652 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
3653
3654         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
3655         RemapParameterLValue): New methods that are used to turn a
3656         precomputed FieldInfo into an expression like this:
3657
3658                 instance.FieldInfo
3659
3660         The idea is to use this instead of making LocalVariableReference
3661         have more than one meaning.
3662
3663         * cs-parser.jay: Add error production to BASE.
3664
3665         * ecore.cs: Deal with TypeManager.GetField returning null, which
3666         is now a valid return value.
3667
3668         (FieldExprNoAddress): New expression for Fields whose address can
3669         not be taken.
3670
3671         * expression.cs (LocalVariableReference): During the resolve
3672         phases, create new expressions if we are in a remapping context.
3673         Remove code that dealt with remapping here.
3674
3675         (ParameterReference): same.
3676
3677         (ProxyInstance): New expression, like the `This' expression, but
3678         it is born fully resolved.  We know what we are doing, so remove
3679         the errors that are targeted to user-provided uses of `this'.
3680
3681         * statement.cs (Foreach): our variable is now stored as an
3682         Expression;  During resolution, follow the protocol, dont just
3683         assume it will return this.
3684
3685 2003-08-06  Martin Baulig  <martin@ximian.com>
3686
3687         * support.cs (SeekableStreamReader.cs): New public class.
3688
3689         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
3690         SeekableStreamReader instead of the normal StreamReader.
3691
3692 2003-08-04  Martin Baulig  <martin@ximian.com>
3693
3694         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
3695         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
3696         deambiguate casts and delegate invocations.
3697         (parenthesized_expression): Use the new tokens to ensure this is
3698         not a cast of method invocation.
3699
3700         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
3701         when reading a `)' and Deambiguate_CloseParens () was previously
3702         called.
3703
3704         * expression.cs (ParenthesizedExpression): New class.  This is
3705         just used for the CS0075 test.
3706         (Binary.DoResolve): Check for CS0075.   
3707
3708 2003-07-29  Ravi Pratap  <ravi@ximian.com>
3709
3710         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
3711         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
3712         reference comparison.
3713
3714         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
3715         examine the ReturnType for equality - this is necessary in the
3716         cases of implicit and explicit operators whose signature also
3717         includes the return type.
3718
3719 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
3720
3721         * namespace.cs: Cache the result of the namespace computation,
3722         instead of computing it every time.
3723
3724 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
3725
3726         * decl.cs: Use a global arraylist that we reuse over invocations
3727         to avoid excesive memory consumption.  Reduces memory usage on an
3728         mcs compile by one meg (45 average).
3729
3730         * typemanager.cs (LookupTypeReflection): In .NET pointers are
3731         private, work around that.
3732
3733 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
3734
3735         * literal.cs (IntLiteral): Define Zero and One static literals. 
3736
3737         * cs-parser.jay (integer_literal): use static literals to reduce
3738         memory usage for the most used literals (0, 1 and -1).  211kb
3739         reduced in memory usage.
3740
3741         Replace all calls to `new ArrayList' with `new
3742         ArrayList(4)' which is a good average number for most allocations,
3743         and also requires only 16 bytes of memory for its buffer by
3744         default. 
3745
3746         This reduced MCS memory usage in seven megabytes for the RSS after
3747         bootstrapping.
3748
3749 2003-07-28  Ravi Pratap  <ravi@ximian.com>
3750
3751         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
3752         handle params methods the correct way by forming only one
3753         applicable set with params and normal methods in them. Earlier we
3754         were looking at params methods only if we found no normal methods
3755         which was not the correct thing to do.
3756
3757         (Invocation.BetterFunction): Take separate arguments indicating
3758         when candidate and the best method are params methods in their
3759         expanded form.
3760
3761         This fixes bugs #43367 and #46199.
3762
3763         * attribute.cs: Documentation updates.
3764
3765         (CheckAttribute): Rename to CheckAttributeTarget.
3766         (GetValidPlaces): Rename to GetValidTargets.
3767
3768         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
3769         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
3770
3771         Fixes bug #44468.
3772
3773 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
3774
3775         * codegen.cs: Compute IsGeneric correctly.
3776
3777         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
3778         resolution. 
3779
3780         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
3781         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
3782         regressions, and I was chasing more bugs than I required.
3783
3784         * interface.cs: Use expressions for base type names (like classes
3785         and structs have been doing for a while now), and resolve that.
3786         This patch should probably go into head as well.
3787
3788         This makes it one less user of FindType.
3789
3790 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
3791
3792         This compiler can not self host currently.  Need to fix that.
3793         
3794         * Makefile: compile to `gmcs.exe'
3795
3796         * driver.cs: Turn on v2 by default on gmcs.
3797
3798         * generic.cs (ConstructedType): Does no longer take a container
3799         type argument;  That will be taken care of later.
3800
3801         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
3802         Use SimpleName to resolve for now, so we can continue the work on
3803         the parser, until we get Type.GetType that understands generics.
3804
3805         (ConstructedType.ToString): Implement
3806
3807         (TypeArguments.Resolve): Resolve the child expressions as types. 
3808         
3809         * cs-parser.jay: Rename interface_constraints to
3810         type_parameter_constraints
3811
3812         (namespace_or_type_name): Only use constructed types for the basic
3813         construction, we will deal with identifier<...> later.
3814
3815         (type/type_name): No longer call DecomposeQI, as
3816         namespace_or_type_name is always decoded now.
3817         
3818 2003-07-22  Ravi Pratap  <ravi@ximian.com>
3819
3820         * expression.cs (Invocation.OverloadResolve): Follow the spec more
3821         closely: we eliminate methods in base types when we have an
3822         applicable method in a top-level type.
3823
3824         Please see section 14.5.5.1 for an exact description of what goes
3825         on. 
3826
3827         This fixes bug #45127 and a host of other related to corlib compilation.
3828
3829         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
3830         array is the method corresponding to the top-level type (this is
3831         because of the changes made to icall.c) so we change this
3832         accordingly.
3833
3834         (MethodGroupExpr.Name): This too.
3835
3836         * typemanager.cs (GetElementType): New method which does the right
3837         thing when compiling corlib. 
3838
3839         * everywhere: Make use of the above in the relevant places.
3840
3841 2003-07-22  Martin Baulig  <martin@ximian.com>
3842
3843         * cs-parser.jay (invocation_expression): Moved
3844         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
3845         `cast_expression', but create a InvocationOrCast which later
3846         resolves to either an Invocation or a Cast.
3847
3848         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
3849         method; call this before EmitStatement() to make sure that this
3850         expression can be used as a statement.
3851
3852         * expression.cs (InvocationOrCast): New class; resolves to either
3853         an Invocation or a Cast.
3854
3855         * statement.cs (StatementExpression): Call ResolveStatement() on
3856         the ExpressionStatement before emitting it.
3857
3858 2003-07-21  Martin Baulig  <martin@ximian.com>
3859
3860         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
3861         `ref' and `out' attributes match; fixes #46220.
3862         (MemberAccess.ResolveMemberAccess): You can't reference a type
3863         through an expression; fixes #33180.
3864         (Indexers.GetIndexersForType): Don't return the indexers from
3865         interfaces the class implements; fixes #46502.
3866
3867 2003-07-21  Martin Baulig  <martin@ximian.com>
3868
3869         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
3870         CS0661 checks; fixes bug #30442.
3871
3872 2003-07-21  Martin Baulig  <martin@ximian.com>
3873
3874         * decl.cs (AdditionResult): Added `Error'.
3875
3876         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
3877
3878         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
3879         cs0031.cs actually work.
3880
3881  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
3882  
3883         * cs-parser.jay (namespace_name): do not use
3884         namespace_or_type_name, use qualified_identifier, because
3885         namespace_or_type_name will soon return a composed expression
3886         instead of a string.
3887  
3888         (namespace_or_type_name): Instead of returning a string, now this
3889         production returns an expression.
3890  
3891         * codegen.cs (EmitContext): Setup IsGeneric property based on
3892         whether our DeclSpace is generic, our the method is generic.
3893  
3894         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
3895         the method is generic.
3896  
3897         * cs-parser.jay (type_arguments, opt_type_argument_list,
3898         type_parameters, type_parameter_list, opt_type_parameter_list,
3899         type_parameter,, opt_type_parameter_constraints_clauses,
3900         type_parameter_constraints_clauses,
3901         type_parameter_constraint_clause, type_parameter_constraint,
3902         interface_constraints): Add new production
3903  
3904         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
3905         DeclSpace is generic or not.
3906  
3907         (DeclSpace.SetParameterInfo): New routine, used to set the
3908         parameter info for a type.
3909  
3910         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
3911         returns a GenericTypeExpr
3912  
3913         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
3914         generic, lookup the generic argument.
3915  
3916         * attribute.cs: Do not allow TypeParameterExpressions in
3917         Attributes.
3918  
3919         * class.cs: Do not allow the Main method to be defined in a
3920         Generic container.
3921  
3922         * expression.cs (SizeOf): Do not allow generic types to be used as
3923         arguments to sizeof.
3924  
3925         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
3926         it: whether a type is generic or not.  Only works for types we are
3927         currently building for now.
3928         
3929 2003-07-20  Martin Baulig  <martin@ximian.com>
3930
3931         * namespace.cs: Fixed that bug which caused a crash when compiling
3932         the debugger's GUI.
3933
3934 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
3935
3936         * typemanager.cs (LookupTypeReflection): Never expose types which
3937         are NotPublic, NestedPrivate, NestedAssembly, or
3938         NestedFamANDAssem.  We used to return these, and later do a check
3939         that would report a meaningful error, but the problem is that we
3940         would not get the real match, if there was a name override.
3941
3942 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
3943
3944         * namespace.cs (Namespace, Name): Do not compute the namespace
3945         name dynamically, compute it in the constructor.  This reduced
3946         memory usage by 1697 KB.
3947
3948         * driver.cs: Use --pause to pause at the end.
3949
3950 2003-07-17  Peter Williams  <peter@newton.cx>
3951
3952         * Makefile: Change the name of the test target so that it doesn't
3953         conflict with the recursive test target.
3954
3955 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
3956
3957         * expression.cs (LocalVariableReference.Emit, EmitAssign,
3958         AddressOf): Do not use EmitThis, that was wrong, use the actual
3959         this pointer.
3960
3961 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
3962
3963         * class.cs (MethodData.Define): While checking if a method is an
3964         interface implementation, improve the test: If we are not public
3965         (use new test here: use the computed MethodAttributes directly,
3966         instead of the parsed modifier flags) check if the `implementing'
3967         method comes from an interface or not.
3968
3969         * pending.cs (VerifyPendingMethods): Slightly better error
3970         message.
3971
3972         * makefile: add test target that does the mcs bootstrap.
3973
3974 2003-07-16  Ravi Pratap  <ravi@ximian.com>
3975
3976         * interface.cs (Define): Do nothing here since there are no
3977         members to populate etc. Move the attribute emission out of here
3978         since this was just totally the wrong place to put it. Attribute
3979         application happens during the 'Emit' phase, not in the 'Define'
3980         phase.
3981
3982         (Emit): Add this method and move the attribute emission here
3983
3984         * rootcontext.cs (EmitCode): Call the Emit method on interface
3985         types too.
3986
3987 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
3988
3989         * expression.cs (OverloadResolve): Report error only if Location
3990         is not 'Null' which means that there was a probe going on.
3991
3992 2003-07-14  Martin Baulig  <martin@ximian.com>
3993
3994         * expression.cs (ConditionalLogicalOperator): New public class to
3995         implement user defined conditional logical operators.
3996         This is section 14.11.2 in the spec and bug #40505.
3997
3998 2003-07-14  Martin Baulig  <martin@ximian.com>
3999
4000         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
4001
4002 2003-07-14  Martin Baulig  <martin@ximian.com>
4003
4004         * codegen.cs (EmitContext.InFixedInitializer): New public field.
4005
4006         * ecore.cs (IVariable.VerifyFixed): New interface method.
4007
4008         * expression.cs (Unary.ResolveOperator): When resolving the `&'
4009         operator, check whether the variable is actually fixed.  Fixes bug
4010         #36055.  Set a variable definitely assigned when taking its
4011         address as required by the spec.
4012
4013         * statement.cs (LocalInfo.IsFixed): New field.
4014         (LocalInfo.MakePinned): Set `IsFixed' to true.
4015
4016 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
4017
4018         * attribute.cs (Attribute.Resolve): While doing a Member lookup
4019         for .ctors, ensure that we only ask for members declared in the
4020         attribute type (BindingFlags.DeclaredOnly).
4021
4022         Fixes bug #43632.
4023
4024         * expression.cs (Error_WrongNumArguments): Report error 1501
4025         correctly the way CSC does.
4026
4027 2003-07-13  Martin Baulig  <martin@ximian.com>
4028
4029         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
4030         lookup on the fully qualified name, to make things like "X.X" work
4031         where "X.X" is a fully qualified type name, but we also have a
4032         namespace "X" in the using list.  Fixes #41975.
4033
4034 2003-07-13  Martin Baulig  <martin@ximian.com>
4035
4036         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
4037         function. If we're a CompoundAssign, we need to create an embedded
4038         CompoundAssign, not an embedded Assign.
4039         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
4040         Fixes #45854.
4041
4042 2003-07-13  Martin Baulig  <martin@ximian.com>
4043
4044         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
4045         work to fix bug #46088.
4046
4047 2003-07-13  Ravi Pratap <ravi@ximian.com>
4048
4049         * class.cs (Operator.Emit): Do not emit attributes here - it is
4050         taken care of by the Method class that we delegate too. This takes
4051         care of bug #45876.
4052
4053 2003-07-10  Martin Baulig  <martin@ximian.com>
4054
4055         * expression.cs (TypeOfVoid): New class.
4056         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
4057
4058 2003-07-10  Martin Baulig  <martin@ximian.com>
4059
4060         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
4061         bug #35957.
4062
4063 2003-07-10  Martin Baulig  <martin@ximian.com>
4064
4065         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
4066         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
4067
4068         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
4069
4070         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
4071
4072 2003-07-10  Martin Baulig  <martin@ximian.com>
4073
4074         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
4075         of decimal.  Fixes #42850.
4076
4077         NOTE: I also fixed the created byte blob, but this doesn't work on
4078         the MS runtime and csc never produces any byte blobs for decimal
4079         arrays.
4080
4081 2003-07-10  Martin Baulig  <martin@ximian.com>
4082
4083         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
4084         structs; fixes #32068.
4085         (Block.AddChildVariableNames): Fixed #44302.
4086
4087 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4088
4089         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
4090
4091 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4092
4093         * attribute.cs: And this test is onger needed.
4094
4095 2003-07-08  Martin Baulig  <martin@ximian.com>
4096
4097         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
4098         inaccessible types.  Fixes #36313.
4099
4100         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
4101
4102         * namespace.cs (NamespaceEntry): Create implicit entries for all
4103         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
4104         implicit entries for N1.N2 and N1.
4105
4106 2003-07-08  Martin Baulig  <martin@ximian.com>
4107
4108         Rewrote the handling of namespaces to fix a lot of the issues
4109         wrt. `using' aliases etc.
4110
4111         * namespace.cs (Namespace): Splitted this class into a
4112         per-assembly `Namespace' and a per-file `NamespaceEntry'.
4113
4114         * typemanager.cs (TypeManager.IsNamespace): Removed.
4115         (TypeManager.ComputeNamespaces): Only compute namespaces from
4116         loaded assemblies here, not the namespaces from the assembly we're
4117         currently compiling.
4118
4119 2003-07-08  Martin Baulig  <martin@ximian.com>
4120
4121         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
4122
4123 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4124
4125         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
4126         already fixed it.  
4127
4128         I thought about the memory savings here, but LookupTypeReflection
4129         is used under already very constrained scenarios.  Compiling
4130         corlib or mcs only exposes one hit, so it would not really reduce
4131         any memory consumption.
4132
4133 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4134
4135         * typemanager.cs: fixes bug #45889 by only adding public types from
4136         other assemblies to the list of known types.
4137
4138 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4139
4140         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
4141         on the type we resolved.
4142
4143 2003-07-05  Martin Baulig  <martin@ximian.com>
4144
4145         * pending.cs (PendingImplementation.ParentImplements): Don't
4146         create the proxy if the parent is abstract.
4147
4148         * class.cs (TypeContainer.DefineIndexers): Process explicit
4149         interface implementations first.  Fixes #37714.
4150
4151 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
4152
4153         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
4154         defined recursively;  but since we modify the input parameters
4155         (left is set to `this' temporarily), we reset this value if the
4156         left_is_explicit is false, which gives the original semantics to
4157         the code.  
4158
4159         * literal.cs (NullPointer): new class used to represent a null
4160         literal in a pointer context.
4161
4162         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
4163         type is a pointer, use a NullPointer object instead of a
4164         NullLiteral.   Closes 43687
4165
4166         (ExplicitConversion): Convert pointer values using
4167         the conv opcode to the proper type.
4168
4169         * ecore.cs (New): change ValueTypeVariable property into a method,
4170         that returns whether the valuetype is suitable for being used.
4171
4172         * expression.cs (Binary.DoNumericPromotions): Only return if we
4173         the int constant was a valid uint, and we can return both left and
4174         right as uints.  If not, we continue processing, to trigger the
4175         type conversion.  This fixes 39018.
4176
4177         * statement.cs (Block.EmitMeta): During constant resolution, set
4178         the CurrentBlock property on the emitcontext, so that we resolve
4179         constants propertly.
4180
4181 2003-07-02  Martin Baulig  <martin@ximian.com>
4182
4183         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
4184         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
4185
4186         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
4187         than emitting it here.
4188
4189         * statement.cs: Fixed some more flow analysis bugs.
4190
4191 2003-07-02  Martin Baulig  <martin@ximian.com>
4192
4193         * class.cs (MethodData.Define): When implementing interface
4194         methods, set Final unless we're Virtual.
4195
4196         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
4197         check work for interface methods.
4198
4199 2003-07-01  Martin Baulig  <martin@ximian.com>
4200
4201         * ecore.cs (EmitContext.This): Replaced this property with a
4202         GetThis() method which takes a Location argument.  This ensures
4203         that we get the correct error location for a CS0188.
4204
4205 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
4206
4207         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
4208         ImplicitStandardConversion.
4209
4210         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
4211
4212 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
4213
4214         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
4215         optimization.
4216
4217 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
4218
4219         * class.cs (Constructor.Define): Turn off initlocals for unsafe
4220         constructors.
4221
4222         (MethodData.Define): Turn off initlocals for unsafe methods.
4223
4224 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
4225
4226         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
4227         complete;  Fixes #37521.
4228
4229         * delegate.cs: Use Modifiers.TypeAttr to compute the
4230         TypeAttributes, instead of rolling our own.  This makes the flags
4231         correct for the delegates.
4232
4233 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
4234
4235         * class.cs (Constructor.Define): Set the private flag for static
4236         constructors as well.
4237
4238         * cs-parser.jay (statement_expression): Set the return value to
4239         null, to avoid a crash when we catch an error.
4240
4241 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
4242
4243         * cs-parser.jay: Applied patch from Jackson that adds support for
4244         extern and unsafe modifiers to destructor declarations.
4245
4246         * expression.cs: Report error 21 if the user is trying to index a
4247         System.Array.
4248
4249         * driver.cs: Add an error message, suggested by the bug report.
4250
4251         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
4252         if we do not have a ": this ()" constructor initializer.  Fixes 45149
4253
4254 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
4255
4256         * namespace.cs: Add some information to reduce FAQs.
4257
4258 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
4259
4260         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
4261         underlying enumeration types.  Fixes #43915.
4262
4263         * expression.cs: Treat ushort/short as legal values to be used in
4264         bitwise operations.
4265
4266 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
4267
4268         * delegate.cs: transfer custom attributes for paramenters from
4269         the delegate declaration to Invoke and BeginInvoke.
4270
4271 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
4272
4273         * attribute.cs: handle custom marshalers and emit marshal info
4274         for fields, too.
4275
4276 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
4277
4278         * makefile.gnu: Added anonymous.cs to the compiler sources.
4279
4280 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
4281
4282         * iterators.cs: Change the name of the proxy class to include two
4283         underscores.
4284
4285         * cs-parser.jay: Update grammar to include anonymous methods.
4286
4287         * anonymous.cs: new file.
4288
4289 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
4290
4291         * class.cs (Field.Define): Add missing test for pointers and
4292         safety. 
4293
4294 2003-05-27  Ravi Pratap  <ravi@ximian.com>
4295
4296         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
4297         we use the stobj opcode.
4298
4299         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
4300         since it wasn't the correct fix. 
4301
4302         It still is puzzling that we are required to use stobj for IntPtr
4303         which seems to be a ValueType.
4304
4305 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
4306
4307         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
4308         during regular simple name resolution.   Now, the trick is that
4309         instead of returning for processing the simplename, we do a
4310         TypeManager.LookupType (ie, a rooted lookup as opposed to a
4311         contextual lookup type).   If a match is found, return that, if
4312         not, return for further composition.
4313
4314         This fixes long-standing 30485.
4315
4316         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4317         using the address to initialize an object, do an Stobj instead of
4318         using the regular Stelem.
4319
4320         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
4321         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
4322         Because if we are a BaseIndexerAccess that value will be true.
4323         Fixes 43643.
4324
4325         * statement.cs (GotoCase.Resolve): Return after reporting an
4326         error, do not attempt to continue. 
4327
4328         * expression.cs (PointerArithmetic.Emit): If our operand is a
4329         long, convert our constants to match the operand before
4330         multiplying.  Convert to I type before adding.   Fixes 43670.
4331
4332 2003-05-14  Ravi Pratap  <ravi@ximian.com>
4333
4334         * enum.cs (ImplicitConversionExists) : Rename to
4335         ImplicitEnumConversionExists to remove ambiguity. 
4336
4337         * ecore.cs (NullCast): New type of cast expression class which
4338         basically is very similar to EmptyCast with the difference being
4339         it still is a constant since it is used only to cast a null to
4340         something else
4341         (eg. (string) null)
4342
4343         * convert.cs (ImplicitReferenceConversion): When casting a null
4344         literal, we return a NullCast.
4345
4346         * literal.cs (NullLiteralTyped): Remove - I don't see why this
4347         should be around anymore.
4348
4349         The renaming (reported was slightly wrong). Corrections:
4350
4351         ConvertImplicitStandard -> ImplicitConversionStandard
4352         ConvertExplicitStandard -> ExplicitConversionStandard
4353
4354         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
4355         before passing them in !
4356
4357         * convert.cs (ImplicitConversionStandard): When comparing for
4358         equal expr and target types, ensure that expr is not a
4359         NullLiteral.
4360
4361         In general, we must not be checking (expr_type ==
4362         target_type) in the top level conversion methods
4363         (ImplicitConversion, ExplicitConversion etc). This checking is
4364         done in the methods that they delegate to.
4365
4366 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
4367
4368         * convert.cs: Move Error_CannotConvertType,
4369         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
4370         ImplicitNumericConversion, ImplicitConversionExists,
4371         ImplicitUserConversionExists, StandardConversionExists,
4372         FindMostEncompassedType, FindMostSpecificSource,
4373         FindMostSpecificTarget, ImplicitUserConversion,
4374         ExplicitUserConversion, GetConversionOperators,
4375         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
4376         TryImplicitIntConversion, Error_CannotConvertImplicit,
4377         ConvertImplicitRequired, ConvertNumericExplicit,
4378         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
4379         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
4380         its own file.
4381
4382         Perform the following renames:
4383
4384         StandardConversionExists -> ImplicitStandardConversionExists
4385         ConvertImplicit -> ImplicitConversion
4386         ConvertImplicitStandard -> ImplicitStandardConversion
4387         TryImplicitIntConversion -> ImplicitIntConversion
4388         ConvertImplicitRequired -> ImplicitConversionRequired
4389         ConvertNumericExplicit -> ExplicitNumericConversion
4390         ConvertReferenceExplicit -> ExplicitReferenceConversion
4391         ConvertExplicit -> ExplicitConversion
4392         ConvertExplicitStandard -> ExplicitStandardConversion
4393
4394 2003-05-19  Martin Baulig  <martin@ximian.com>
4395
4396         * statement.cs (TypeInfo.StructInfo): Made this type protected.
4397         (TypeInfo): Added support for structs having structs as fields.
4398
4399         * ecore.cs (FieldExpr): Implement IVariable.
4400         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
4401         VariableInfo for the field.
4402
4403 2003-05-18  Martin Baulig  <martin@ximian.com>
4404
4405         * expression.cs (This.DoResolve): Report a CS0027 if we're
4406         emitting a field initializer.
4407
4408 2003-05-18  Martin Baulig  <martin@ximian.com>
4409
4410         * expression.cs (This.ResolveBase): New public function.
4411         (This.DoResolve): Check for CS0188.
4412
4413         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
4414         This.Resolve().
4415
4416         * ecore.cs (MethodGroupExpr.DoResolve): Set the
4417         `instance_expression' to null if we don't have any non-static
4418         methods.
4419
4420 2003-05-18  Martin Baulig  <martin@ximian.com>
4421
4422         Reworked the way how local variables and parameters are handled by
4423         the flow analysis code.
4424
4425         * statement.cs (TypeInfo, VariableMap): New public classes.
4426         (VariableInfo): New public class.  This is now responsible for
4427         checking whether a variable has been assigned.  It is used for
4428         parameters and local variables.
4429         (Block.EmitMeta): Take the InternalParameters as argument; compute
4430         the layout of the flow vectors here.
4431         (Block.LocalMap, Block.ParameterMap): New public properties.
4432         (FlowBranching): The .ctor doesn't get the InternalParameters
4433         anymore since Block.EmitMeta() now computes the layout of the flow
4434         vector.
4435         (MyStructInfo): This class is now known as `StructInfo' and nested
4436         in `TypeInfo'; we don't access this directly anymore.
4437
4438         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
4439         property and removed IsAssigned(), IsFieldAssigned(),
4440         SetAssigned() and SetFieldAssigned(); we now call them on the
4441         VariableInfo so we don't need to duplicate this code everywhere.
4442
4443         * expression.cs (ParameterReference): Added `Block block' argument
4444         to the .ctor.
4445         (LocalVariableReference, ParameterReference, This): The new
4446         VariableInfo class is now responsible for all the definite
4447         assignment stuff.
4448
4449         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
4450         IsParameterAssigned, SetParameterAssigned): Removed.
4451
4452 2003-05-18  Martin Baulig  <martin@ximian.com>
4453
4454         * typemanager.cs (InitCoreTypes): Try calling
4455         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
4456         the 3-args-version.  Corlib now also needs our `void_type'.
4457         (GetMethod): Added overloaded version which takes an optional
4458         `bool report_errors' to allow lookups of optional methods.
4459
4460 2003-05-12  Martin Baulig  <martin@ximian.com>
4461
4462         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
4463         only used for locals and not for parameters.
4464
4465 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
4466
4467         * support.cs (InternalParameters.ParameterType): Return the
4468         ExternalType of the parameter.
4469
4470         * parameter.cs (Parameter.ExternalType): drop the two arguments,
4471         they were unused.
4472
4473 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
4474
4475         * class.cs (MethodData.Define): Do not set the `newslot' on
4476         interface members, if they are also flagged as "override".
4477
4478         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
4479         better code for ++i and i++.  This only works for static fields
4480         and local variables.
4481
4482         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
4483         want to pull the DeclSpace out of the builder_to_declspace instead
4484         of the TypeBuilder (like in TypeContainer.FindMembers).
4485
4486         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
4487         instead of LookupTypeContainer.  Fixes the crash on .NET for
4488         looking up interface members.
4489
4490         * const.cs: Create our own emit context during the Definition
4491         stage, so that constants are evaluated in the proper context, when
4492         a recursive definition happens.
4493
4494 2003-05-11  Martin Baulig  <martin@ximian.com>
4495
4496         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
4497         new block for a switch section.
4498         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
4499         the adding/lookup in the switch block.  Fixes #39828.
4500
4501 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
4502
4503         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
4504         functionality: I needed to convert the data after I had performed
4505         the add/sub operation into the operands type size.
4506
4507         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
4508         pass the type for the box operation, otherwise the resulting
4509         object would have been of type object.
4510
4511         (BoxedCast): Add constructor to specify the type to box as.
4512
4513 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
4514
4515         * iterators.cs: I was reusing the `count' variable inadvertently,
4516         take steps to not allow this to happen.
4517
4518 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
4519
4520         * attribute.cs (Attribute.Resolve): Params attributes are encoded
4521         by creating an array at the point where the params starts and
4522         putting all those arguments there, then adjusting the size of the
4523         array.
4524
4525 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
4526
4527         * expression.cs (New.AddressOf): Implement interface
4528         IMemoryLocation.  This is used when the `new' operator is used in
4529         the context of an invocation to a method on a value type.
4530
4531         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
4532         example. 
4533
4534         * namespace.cs: Also check the using aliases here.
4535
4536         * driver.cs: Move the test for using validity after the types have
4537         been entered, so we do a single pass that also includes the using
4538         aliases. 
4539
4540         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
4541         in the regular case.   CreateSiblingForFinally is doing extra
4542         error checking.
4543
4544         * attribute.cs (GetAttributeArgumentExpression): Store the result
4545         on an out value, and use the return value to indicate failure
4546         instead of using null (which is a valid return for Constant.GetValue).
4547
4548         * statement.cs: Perform the analysis flow for the increment
4549         portion after the statement, because this will be the real flow of
4550         execution.  Fixes #42385
4551
4552         * codegen.cs (EmitContext.EmitArgument,
4553         EmitContext.EmitStoreArgument): New helper functions when the
4554         RemapToProxy flag is set.
4555
4556         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
4557         function.
4558
4559         Add support for remapping parameters. 
4560
4561         * iterators.cs: Propagate parameter values;  Store parameter
4562         values in the proxy classes.
4563
4564 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
4565
4566         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
4567         need a proxy reference;  I do not know what I was thinking
4568
4569         * cs-parser.jay (constructor_initializer): catch another error,
4570         and display nice message.
4571
4572         (field_declaration): catch void field declaration
4573         to flag a better error. 
4574
4575         * class.cs (MemberBase.CheckBase): Report an error instead of a
4576         warning if a new protected member is declared in a struct. 
4577         (Field.Define): catch the error of readonly/volatile.
4578
4579         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
4580
4581         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
4582         volatile variable is taken
4583
4584 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
4585
4586         * statement.cs (Fixed.Resolve): Report an error if we are not in
4587         an unsafe context.
4588
4589 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
4590
4591         * typemanager.cs: reuse the code that handles type clashes for
4592         delegates and enumerations.
4593
4594         * class.cs (Report28): Always report.
4595
4596         * expression.cs (EncodeAsAttribute): Allow nulls here.
4597
4598 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
4599
4600         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
4601         the functionality for testing whether an expression is valid for
4602         an attribute here.  Also handle the case of arrays of elements
4603         being stored. 
4604
4605         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
4606         encoding a linear array into an array of objects that are suitable
4607         to be passed to an CustomAttributeBuilder.
4608
4609         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
4610
4611         * ecore.cs: (FieldExpr): Handle field remapping here.
4612
4613         * iteratators.cs: Pass the instance variable (if the method is an
4614         instance method) to the constructors, so we can access the field
4615         variables on the class.
4616
4617         TODO: Test this with structs.  I think the THIS variable on
4618         structs might have to be a pointer, and not a refenrece
4619
4620 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
4621
4622         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
4623         local variables to fields in a proxy class.
4624
4625         * iterators.cs (PopulateProxy): Rename our internal fields to
4626         <XXX>.  
4627         Create a <THIS> field if we are an instance method, so we can
4628         reference our parent container variables.
4629         (MapVariable): Called back from the EmitContext code to enter a
4630         new variable to field mapping into the proxy class (we just create
4631         a FieldBuilder).
4632
4633         * expression.cs
4634         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
4635         for using the remapped locals to fields.
4636
4637         I placed the code here, because that gives the same semantics to
4638         local variables, and only changes the Emit code.
4639
4640         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
4641         statements inside iterators.
4642         (VariableInfo): Add a FieldBuilder for the cases when we are
4643         remapping local variables to fields in a proxy class
4644
4645         * ecore.cs (SimpleNameResolve): Avoid testing two times for
4646         current_block != null.
4647
4648         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
4649         not cope with strings, as it has been moved to the
4650         TableSwitchEmit.  Fixed bug in switch generation.
4651
4652         * expression.cs (New.DoResolve): Provide more context for the user
4653         when reporting an error.
4654
4655         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
4656         pointers. 
4657
4658         * expression.cs (MemberAccess.DoResolve): When we get a type back,
4659         check the permissions for it.  Note than in a type-resolution
4660         context the check was already present in DeclSpace.ResolveType,
4661         but was missing from the MemberAccess.
4662
4663         (ArrayCreation.CheckIndices): warn if the user has
4664         more nested levels of expressions, but there are no more
4665         dimensions specified.  Avoids crash on bug 41906.
4666
4667 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
4668
4669         * statement.cs (Block): replace Implicit bool, for a generic
4670         flags.   
4671         New flag: `Unchecked'.  This is used during the EmitMeta phase
4672         (which is out-of-line with the regular Resolve/Emit process for a
4673         statement, as this is done ahead of time, but still gets a chance
4674         to call constant resolve).
4675
4676         (Block.Flags): new enum for adding a new flag.
4677
4678         (Block.EmitMeta): track the state of unchecked.
4679
4680         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
4681         to enable constant resolution to work there as well.
4682
4683 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
4684
4685         * typemanager.cs (ienumerable_type): Also look up
4686         System.Collections.IEnumerable. 
4687
4688 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
4689
4690         TODO: Test more than one conditional per method.
4691
4692         * class.cs (Indexer.Define): Report the location where the user is
4693         referencing the unsupported feature.
4694
4695         (MethodData): Overload the use of `conditionals' to
4696         minimize the creation of needless ArrayLists.   This saves roughly
4697         212kb on my machine.
4698
4699         (Method): Implement the new IIteratorContainer interface.
4700         (Method.SetYields): Implement the method by setting the ModFlags
4701         to contain METHOD_YIELDS.
4702
4703         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
4704         which just got set to null.
4705
4706         * iterators.cs: New file.
4707
4708         (Yield, YieldBreak): New statements.
4709
4710         * statement.cs (Return.Resolve): Flag an error if we are used in
4711         an iterator method.
4712
4713         * codegen.cs (InIterator): New flag set if the code is being
4714         compiled in an iterator method.
4715
4716         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
4717         internal modifier, and we just use it to avoid adding extra
4718         fields, as this is seldom used.  
4719
4720         * cs-parser.jay: Add yield_statement (yield and yield break).
4721
4722         * driver.cs: New flag -v2 to turn on version 2 features. 
4723
4724         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
4725         hashtable when v2 is enabled.
4726
4727 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
4728
4729         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
4730         there is already a namespace defined with this name.
4731
4732         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
4733         people upgraded their corlibs.
4734
4735         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
4736         always use fully qualified types, no need to use the compiler
4737         front end.
4738
4739         (TypeManager.IsNamespace): Use binarysearch.
4740
4741         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
4742         AddDelegate): I did not quite use the new IsValid API properly: I
4743         have to pass the short-name and the fullname.  I was passing only
4744         the basename instead of the fullname sometimes. 
4745
4746         (TypeContainer.DefineType): call NamespaceClash.
4747
4748         * interface.cs (Interface.DefineType): use NamespaceClash before
4749         defining the type.
4750
4751         * delegate.cs (Delegate.DefineType): use NamespaceClash before
4752         defining the type.
4753
4754         * enum.cs: (Enum.DefineType): use NamespaceClash before
4755         defining the type.
4756
4757         * typemanager.cs (: 3-line patch that gives us some tasty 11%
4758         speed increase.  First, use the negative_hits cache when we get a
4759         negative.  Second, add the type with its full original name
4760         instead of the new . and + encoded name (reflection uses + to
4761         separate type from a nested type).  Use LookupTypeReflection
4762         directly which bypasses the type->name hashtable (that we already
4763         know does not contain the type.
4764
4765         * decl.cs (DeclSpace.ResolveTypeExpr): track the
4766         location/container type. 
4767
4768         * driver.cs: When passing utf8, use directly the UTF8Encoding.
4769
4770 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
4771
4772         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
4773
4774         * delegate.cs (NewDelegate.Resolve): Test whether an instance
4775         method is being referenced in the method group from a static
4776         context, and report error 120 if so.
4777
4778         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
4779         Error118. 
4780
4781         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
4782         is created, we create the A namespace).
4783
4784         * cs-parser.jay: A namespace also introduces a DeclarationFound.
4785         Fixes #41591
4786
4787 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
4788
4789         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
4790         invocation to ModuleBuilder.GetType with the same values will
4791         return a new type instance, so we need to cache its return
4792         values. 
4793
4794         * expression.cs (Binary.ResolveOperator): Only allow the compare
4795         operators on enums if they are of the same type.
4796
4797         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
4798         types of ValueType on their own case.  Before we were giving them
4799         the same treatment as objects.
4800
4801         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
4802         fullname.  Short name is used to compare against container name.
4803         Fullname is used to check against defined namespace names.
4804
4805         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
4806         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
4807
4808         (Method.CheckBase): Call parent.
4809         (MemberBase.CheckBase): Check for protected members on sealed
4810         classes.
4811         (PropertyBase.CheckBase): Call parent.
4812         (Field.Define): Call parent.
4813
4814         * report.cs: Negative error codes are now mapped to 8000 - code,
4815         so that the display is render more nicely.
4816
4817         * typemanager.cs: Do not use try/catch, instead report a regular
4818         error. 
4819
4820         (GetPointerType, GetReferenceType): These methods provide
4821         mechanisms to obtain the T* and T& from a T.  We had the code
4822         previously scattered around the code base, and it also used
4823         TypeManager.LookupType that would go through plenty of caches.
4824         This one goes directly to the type source.
4825
4826         In some places we did the Type.GetType followed by
4827         ModuleBuilder.GetType, but not in others, so this unifies the
4828         processing as well.
4829
4830         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
4831         statements now that we have namespace information.
4832
4833         * typemanager.cs (IsNamespace): New method, returns whether the
4834         string presented is a namespace or not.
4835
4836         (ComputeNamespaces): New public entry point, computes the list of
4837         available namespaces, using the GetNamespaces API call in Mono, or
4838         the slower version in MS.NET.   
4839
4840         Now before we start the semantic analysis phase, we have a
4841         complete list of namespaces including everything that the user has
4842         provided.
4843
4844         Deleted old code to cache namespaces in .nsc files.
4845
4846 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
4847
4848         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
4849         class/struct location definition Location for the implicit
4850         constructor location.
4851
4852         (Operator.Define): Use the location of the operator for the
4853         implicit Method definition.
4854
4855         (Constructor.Emit): use the constructor location for the implicit
4856         base initializer constructor.
4857
4858         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
4859         and the Expression class now contains two new methods:
4860
4861         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
4862         isolate type lookup from the rest of the resolution process.
4863
4864         Since we use Expressions to hold type definitions due to the way
4865         we parse the input we have historically overloaded Resolve to
4866         perform the Type lookups if a special flag is passed.  Now this is
4867         eliminated and two methods take their place. 
4868
4869         The differences in the two methods between xStep and xTerminal is
4870         that xStep is involved in our current lookup system that uses
4871         SimpleNames to compose a name, while xTerminal is used just to
4872         catch the case where the simplename lookup failed.
4873
4874 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
4875
4876         * expression.cs (ResolveMemberAccess): Remove redundant code.
4877         TypeExpr expressions are always born fully resolved.
4878
4879         * interface.cs (PopulateMethod): Do not lookup the types twice.
4880         We were doing it once during SemanticAnalysis and once during
4881         PopulateMethod.
4882
4883         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
4884         in local variable type definitions, were being returned as a
4885         SimpleName (we decomposed everything into a string), that is
4886         because primary_expression was being used instead of a type in the
4887         grammar (reduce/reduce conflicts).
4888
4889         The part that was wrong is that we converted the expression into a
4890         string (an oversimplification in one hand, compounded with primary
4891         expressions doing string concatenation).
4892
4893         So things like:
4894
4895         A.B.C [] x;
4896
4897         Would return "A.B.C[]" as a SimpleName.  This stopped things like
4898         using clauses from working on this particular context.  And a type
4899         was being matched directly against "A.B.C[]".
4900
4901         We now use the correct approach, and allow for ComposedCast to be
4902         part of the unary expression.  So the "A.B.C []" become a composed
4903         cast of "A.B.C" (as a nested group of MemberAccess with a
4904         SimpleName at the end) plus the rank composition "[]". 
4905
4906         Also fixes 35567
4907
4908 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
4909
4910         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
4911         for the access level checking.
4912
4913         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
4914         `TypeContainer container', because I kept getting confused when I
4915         was debugging this code.
4916
4917         * expression.cs (Indexers): Instead of tracking getters/setters,
4918         we now track them in parallel.  We create one arraylist less, but
4919         most importantly it is possible now for the LValue code to find a
4920         matching get for a set.
4921
4922         (IndexerAccess.DoResolveLValue): Update the code.
4923         GetIndexersForType has been modified already to extract all the
4924         indexers from a type.  The code assumed it did not.
4925
4926         Also make the code set the correct return type for the indexer.
4927         This was fixed a long time ago for properties, but was missing for
4928         indexers.  It used to be void_type.
4929
4930         (Binary.Emit): Test first for doubles instead of
4931         floats, as they are more common.
4932
4933         (Binary.EmitBranchable): Use the .un version of the branch opcodes
4934         when dealing with floats and the <=, >= operators.  This fixes bug
4935         #39314 
4936
4937         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
4938         to load the array value by emitting a load on the foreach variable
4939         type.  This was incorrect.  
4940
4941         We now emit the code to load an element using the the array
4942         variable type, and then we emit the conversion operator.
4943
4944         Fixed #40176
4945
4946 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
4947
4948         * attribute.cs: Avoid allocation of ArrayLists in the common case.
4949
4950 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
4951
4952         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
4953         test for protection before we test for signatures. 
4954
4955         (MethodSignature.ToString): implement.
4956
4957         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
4958         to the case where we reduced into a LongConstant.
4959
4960         * decl.cs (CheckAccessLevel): If the type is an array, we can not
4961         depend on whether the information is acurrate, because the
4962         Microsoft runtime will always claim that the array type is public,
4963         regardless of the real state.
4964
4965         If the type is a pointer, another problem happens: the type is
4966         reported as non-public in Microsoft.  
4967
4968         In both cases we have to call CheckAccessLevel recursively with
4969         the underlying type as the argument to be tested.
4970
4971 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
4972
4973         * assign.cs (Assign.Emit): If we are dealing with a compound
4974         assignment expression, we should use the code path that stores the
4975         intermediate result in a temporary value.  This fixes #40903.
4976
4977         *expression.cs (Indirection.ToString): Provide ToString method for
4978         debugging. 
4979
4980 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
4981
4982         * class.cs: Null out fields holding references to Block objects so
4983         they can be garbage collected.
4984
4985         * expression.cs (OverloadResolve): Remove unused local.
4986
4987 2003-04-07  Martin Baulig  <martin@ximian.com>
4988
4989         * codegen.cs (EmitContext.CurrentFile): New public field.
4990         (EmitContext.Mark): Use the CurrentFile to check whether the
4991         location is in the correct file.
4992         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
4993
4994 2003-04-07  Martin Baulig  <martin@ximian.com>
4995
4996         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
4997
4998         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
4999         location.  [FIXME: The location argument which gets passed to this
5000         method is sometimes wrong!]
5001
5002 2003-04-07  Nick Drochak <ndrochak@gol.com>
5003
5004         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
5005
5006 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
5007
5008         * expression.cs (Indirection.EmitAssign): We were using the
5009         temporary, but returning immediately instead of continuing the
5010         EmitAssing flow.
5011
5012 2003-04-06  Martin Baulig  <martin@ximian.com>
5013
5014         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
5015         if it's a nested child, but also deriving from the outer class.
5016         See test 190.cs.
5017
5018         * typemanager.cs (IsNestedChildOf): Make this work if it's a
5019         nested child, but also deriving from the outer class.  See
5020         test-190.cs.
5021         (FilterWithClosure): We may access private members of the outer
5022         class if we're a nested child and deriving from the outer class.
5023         (RealMemberLookup): Only set `closure_private_ok' if the
5024         `original_bf' contained BindingFlags.NonPublic.
5025
5026 2003-04-05  Martin Baulig  <martin@ximian.com>
5027
5028         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
5029         probe if its a type parameter, and if so, flag an error.
5030
5031         * decl.cs: Move here the SetParameterInfo code from class.cs.
5032         Handle IsGeneric here.
5033
5034         Handle a variety of errors in the parameter info definition.
5035
5036         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
5037         type parameters here.
5038
5039         * cs-parser.jay (class_declaration): report errors for parameters
5040         here as well.
5041
5042 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
5043
5044         * generic.cs: New file, contains support code for generics.
5045
5046         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
5047         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
5048
5049         Update parser for the above removals.
5050
5051         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
5052         now taken care of in the parser.
5053
5054 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
5055
5056         * class.cs (Event.Define): Do not allow abstract events to have
5057         initializers. 
5058
5059 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
5060
5061         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
5062         block in event declarations.
5063
5064         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
5065         value type, get its address.
5066
5067         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
5068         leaving a class on the stack instead of a boolean value (int
5069         0/1).  Change the code so we compare against null, and then the
5070         result against zero.
5071
5072         * class.cs (TypeContainer.GetClassBases): We were checking for the
5073         parent class being sealed too late.
5074
5075         * expression.cs (Binary.Emit): For <= and >= when dealing with
5076         floating point values, use cgt.un and clt.un instead of cgt and
5077         clt alone.
5078
5079 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
5080
5081         * statement.cs: Apply the same optimization as MS: skip the 
5082         GetEnumerator returning an IEnumerator, and use the one returning a 
5083         CharEnumerator instead. This allows us to avoid the try-finally block 
5084         and the boxing.
5085
5086 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
5087
5088         * cs-parser.jay: Attributes cannot be applied to
5089                          namespaces. Fixes #40473
5090
5091 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5092
5093         * class.cs:
5094         (Add*): check if the name is valid using the full name for constants,
5095         fields, properties and events.
5096
5097 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
5098
5099         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
5100         char constants to be part of the enumeration.
5101
5102         * expression.cs (Conditional.DoResolve): Add support for operator
5103         true. Implements the missing functionality from 14.12
5104
5105         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
5106         operator true/false as required by the spec.
5107
5108         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
5109         implicit conversion to boolean.
5110
5111         * statement.cs (Statement.ResolveBoolean): A boolean expression is
5112         also one where the type implements `operator true'. 
5113
5114         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
5115         get an expression that will invoke operator true based on an
5116         expression.  
5117
5118         (GetConversionOperators): Removed the hack that called op_True
5119         here.  
5120
5121         (Expression.ResolveBoolean): Move this from Statement.
5122
5123 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
5124
5125         * ecore.cs (FieldExpr): do not allow initialization of initonly
5126         fields on derived classes
5127
5128 2003-03-13  Martin Baulig  <martin@ximian.com>
5129
5130         * statement.cs (Block.Emit): Call ig.BeginScope() and
5131         ig.EndScope() when compiling with debugging info; call
5132         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
5133
5134 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
5135
5136         * expression.cs (Indexers): Do not construct immediately, allow
5137         for new members to be appended as we go.  Fixes 38143
5138
5139 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5140
5141         * expression.cs: save/restore context when resolving an unchecked
5142         expression.
5143
5144 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
5145
5146         * cfold.cs: Catch division by zero in modulus operator during
5147         constant folding.
5148
5149 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
5150
5151         * interface.cs (Interface.DefineMembers): Avoid defining members
5152         twice. 
5153
5154 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
5155
5156         * driver.cs: handle the +/- options for -noconfig
5157
5158         * statement.cs (Unckeched.Resolve): Also track the state of
5159         unchecked in the Resolve phase.
5160
5161 2003-02-27  Martin Baulig  <martin@ximian.com>
5162
5163         * ecore.cs (Expression.MemberLookup): Don't create a
5164         MethodGroupExpr for something which is not a method.  Fixes #38291.
5165
5166 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
5167
5168         * class.cs (MemberBase.CheckParameters): Also check that the type
5169         is unmanaged if it is a pointer.
5170
5171         * expression.cs (SizeOf.Resolve): Add location information.
5172
5173         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
5174         a managed type is declared.
5175
5176         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
5177         parameter modifiers as well.  Fixes bug 38606
5178
5179         * class.cs: Very sad.  Am backing out the speed up changes
5180         introduced by the ArrayList -> Array in the TypeContainer, as they
5181         were not actually that much faster, and introduced a bug (no error
5182         reports on duplicated methods).
5183
5184         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
5185         source first, this will guarantee that we have a valid expression
5186         before calling in lower levels functions that will require a
5187         resolved object.  Then use this original_source in the
5188         target.ResolveLValue instead of the original source that was
5189         passed to us.
5190
5191         Another change.  Use target.Resolve instead of LValueResolve.
5192         Although we are resolving for LValues, we will let the Assign code
5193         take care of that (it will be called again from Resolve).  This
5194         basically allows code like this:
5195
5196         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
5197         class Y { void A (X x) { x [0] += o; }
5198
5199         The problem was that the indexer was trying to resolve for
5200         set_Item (idx, object o) and never finding one.  The real set_Item
5201         was set_Item (idx, X).  By delaying the process we get the right
5202         semantics. 
5203
5204         Fixes bug 36505
5205
5206 2003-02-23  Martin Baulig  <martin@ximian.com>
5207
5208         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
5209         while calling DoEmit ().
5210
5211         * codegen.cs (EmitContext.Mark): Don't mark locations in other
5212         source files; if you use the #line directive inside a method, the
5213         compiler stops emitting line numbers for the debugger until it
5214         reaches the end of the method or another #line directive which
5215         restores the original file.
5216
5217 2003-02-23  Martin Baulig  <martin@ximian.com>
5218
5219         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
5220
5221 2003-02-23  Martin Baulig  <martin@ximian.com>
5222
5223         * statement.cs (Block.AddChildVariableNames): We need to call this
5224         recursively, not just for our immediate children.
5225
5226 2003-02-23  Martin Baulig  <martin@ximian.com>
5227
5228         * class.cs (Event.Define): Always make the field private, like csc does.
5229
5230         * typemanager.cs (TypeManager.RealMemberLookup): Make events
5231         actually work, fixes bug #37521.
5232
5233 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
5234
5235         * delegate.cs: When creating the various temporary "Parameters"
5236         classes, make sure that we call the ComputeAndDefineParameterTypes
5237         on those new parameters (just like we do with the formal ones), to
5238         allow them to be resolved in the context of the DeclSpace.
5239
5240         This fixes the bug that Dick observed in Bugzilla #38530.
5241
5242 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
5243
5244         * expression.cs (ResolveMemberAccess): When resolving a constant,
5245         do not attempt to pull a constant if the value was not able to
5246         generate a valid constant.
5247
5248         * const.cs (LookupConstantValue): Do not report more errors than required.
5249
5250 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5251
5252         * expression.cs: fixes bug #38328.
5253
5254 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
5255
5256         * class.cs: Changed all the various members that can be part of a
5257         class from being an ArrayList to be an Array of the right type.
5258         During the DefineType type_list, interface_list, delegate_list and
5259         enum_list are turned into types, interfaces, delegates and enums
5260         arrays.  
5261
5262         And during the member population, indexer_list, event_list,
5263         constant_list, field_list, instance_constructor_list, method_list,
5264         operator_list and property_list are turned into their real arrays.
5265
5266         Although we could probably perform this operation earlier, for
5267         good error reporting we need to keep the lists and remove the
5268         lists for longer than required.
5269
5270         This optimization was triggered by Paolo profiling the compiler
5271         speed on the output of `gen-sample-program.pl' perl script. 
5272
5273         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
5274         not crash in methods like MemberLookupFailed that use this field.  
5275
5276         This problem arises when the compiler fails to resolve a type
5277         during interface type definition for example.
5278
5279 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
5280
5281         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
5282         inherit from System.Object, so we have to stop at null, not only
5283         when reaching System.Object.
5284
5285 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
5286
5287         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
5288         DeclaredOnly because the parent indexer might have had a different
5289         name, but did not loop until the top of the hierarchy was reached.
5290
5291         The problem this one fixes is 35492: when a class implemented an
5292         indexer from an interface, we were getting the interface method
5293         (which was abstract) and we were flagging an error (can not invoke
5294         abstract method).
5295
5296         This also keeps bug 33089 functioning, and test-148 functioning.
5297
5298         * typemanager.cs (IsSpecialMethod): The correct way of figuring
5299         out if a method is special is to see if it is declared in a
5300         property or event, or whether it is one of the predefined operator
5301         names.   This should fix correctly #36804.
5302
5303 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
5304
5305         The goal here is to remove the dependency on EmptyCast.Peel ().
5306         Killing it completely.
5307
5308         The problem is that currently in a number of places where
5309         constants are expected, we have to "probe" for an EmptyCast, and
5310         Peel, which is not the correct thing to do, as this will be
5311         repetitive and will likely lead to errors. 
5312
5313         The idea is to remove any EmptyCasts that are used in casts that
5314         can be reduced to constants, so we only have to cope with
5315         constants. 
5316
5317         This bug hunt was triggered by Bug 37363 and the desire to remove
5318         the duplicate pattern where we were "peeling" emptycasts to check
5319         whether they were constants.  Now constants will always be
5320         constants.
5321
5322         * ecore.cs: Use an enumconstant here instead of wrapping with
5323         EmptyCast.  
5324
5325         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
5326         throwing me off.  By handling this we can get rid of a few hacks.
5327
5328         * statement.cs (Switch): Removed Peel() code.
5329
5330 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
5331
5332         * class.cs: Location information for error 508
5333
5334         * expression.cs (New.DoResolve): Add a guard against double
5335         resolution of an expression.  
5336
5337         The New DoResolve might be called twice when initializing field
5338         expressions (see EmitFieldInitializers, the call to
5339         GetInitializerExpression will perform a resolve on the expression,
5340         and later the assign will trigger another resolution
5341
5342         This leads to bugs (#37014)
5343
5344         * delegate.cs: The signature for EndInvoke should contain any ref
5345         or out parameters as well.  We were not doing this in the past. 
5346
5347         * class.cs (Field.Define): Do not overwrite the type definition
5348         inside the `volatile' group.  Turns out that volatile enumerations
5349         were changing the type here to perform a validity test, which
5350         broke conversions. 
5351
5352 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
5353
5354         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
5355         and structs, we do not want to load the instance variable
5356
5357         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
5358         enum_type has to be handled like an object reference (implicit
5359         conversions exists from this to object), but the regular IsClass
5360         and IsValueType tests will never return true for this one.
5361
5362         Also we use TypeManager.IsValueType instead of type.IsValueType,
5363         just for consistency with the rest of the code (this is only
5364         needed if we ever use the construct exposed by test-180.cs inside
5365         corlib, which we dont today).
5366
5367 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
5368
5369         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
5370         just InternalCall.
5371
5372 2003-02-09  Martin Baulig  <martin@ximian.com>
5373
5374         * namespace.cs (Namespace..ctor): Added SourceFile argument.
5375         (Namespace.DefineNamespaces): New static public method; this is
5376         called when we're compiling with debugging to add all namespaces
5377         to the symbol file.
5378
5379         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
5380         pass it to the Namespace's .ctor.
5381
5382         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
5383         and MethodBase arguments; pass the namespace ID to the symwriter;
5384         pass the MethodBase instead of the token to the symwriter.
5385         (SymbolWriter.DefineNamespace): New method to add a namespace to
5386         the symbol file.
5387
5388 2003-02-09  Martin Baulig  <martin@ximian.com>
5389
5390         * symbolwriter.cs: New file.  This is a wrapper around
5391         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
5392         methods here in near future.
5393
5394 2003-02-09  Martin Baulig  <martin@ximian.com>
5395
5396         * codegen.cs (EmitContext.Mark): Just pass the arguments to
5397         ILGenerator.MarkSequencePoint() which are actually used by the
5398         symbol writer.
5399
5400 2003-02-09  Martin Baulig  <martin@ximian.com>
5401
5402         * location.cs (SourceFile): New public sealed class.  This
5403         contains the name and an index which is used in the location's token.
5404         (Location): Reserve an appropriate number of bits in the token for
5405         the source file instead of walking over that list, this gives us a
5406         really huge performance improvement when compiling with debugging.
5407
5408         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
5409         `SourceFile' argument instead of a string.
5410         (Driver.ProcessFile): Add all the files via Location.AddFile(),
5411         but don't parse/tokenize here, we need to generate the list of all
5412         source files before we do that.
5413         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
5414         the files.
5415
5416         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
5417         instead of a string.
5418
5419         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
5420         of a string.
5421
5422 2003-02-09  Martin Baulig  <martin@ximian.com>
5423
5424         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
5425         filename on `#line default'.
5426
5427 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
5428
5429         * statement.cs: don't clear the pinned var when the fixed statement
5430         returns from the method (fixes bug#37752).
5431
5432 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
5433
5434         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
5435         to IsValueType.
5436
5437 2003-02-07  Martin Baulig  <martin@ximian.com>
5438
5439         * driver.cs: Removed the `--debug-args' command line argument.
5440
5441         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
5442         automatically by the AsssemblyBuilder.
5443         (CodeGen.InitializeSymbolWriter): We don't need to call any
5444         initialization function on the symbol writer anymore.  This method
5445         doesn't take any arguments.
5446
5447 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
5448
5449         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
5450         from referenced assemblies as well.
5451
5452 2003-02-02  Martin Baulig  <martin@ximian.com>
5453
5454         * class.cs (MethodData.Emit): Generate debugging info for external methods.
5455
5456 2003-02-02  Martin Baulig  <martin@ximian.com>
5457
5458         * class.cs (Constructor.Emit): Open the symbol writer before
5459         emitting the constructor initializer.
5460         (ConstructorInitializer.Emit): Call ec.Mark() to allow
5461         single-stepping through constructor initializers.
5462
5463 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
5464
5465         * class.cs: Handle error 549: do not allow virtual methods in
5466         sealed classes. 
5467
5468 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
5469
5470         * decl.cs: Check access levels when resolving types
5471
5472 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
5473
5474         * statement.cs: Add parameters and locals set in catch blocks that might 
5475         return to set vector
5476
5477 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
5478
5479         * class.cs (Operator): Set the SpecialName flags for operators.
5480
5481         * expression.cs (Invocation.DoResolve): Only block calls to
5482         accessors and operators on SpecialName methods.
5483
5484         (Cast.TryReduce): Handle conversions from char constants.
5485
5486
5487 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
5488
5489         * statement.cs: small memory and time optimization in FlowBranching.
5490
5491 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
5492
5493         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
5494         problem that the last fix but in the other sid (Set).
5495
5496         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
5497         access when there is no indexer in the hierarchy.
5498
5499 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
5500
5501         * class.cs: Combine some if statements.
5502
5503 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5504
5505         * driver.cs: fixed bug #37187.
5506
5507 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
5508
5509         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
5510         any indexer, it's needed to build a list with all the indexers in the
5511         hierarchy (AllGetters), else we have problems. Fixes #35653.
5512
5513 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
5514
5515         * class.cs (MethodData.Define): It is wrong for an interface
5516         implementation to be static in both cases: explicit and implicit.
5517         We were only handling this in one case.
5518
5519         Improve the if situation there to not have negations.
5520
5521         * class.cs (Field.Define): Turns out that we do not need to check
5522         the unsafe bit on field definition, only on usage.  Remove the test.
5523
5524 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5525
5526         * driver.cs: use assembly.Location instead of Codebase (the latest
5527         patch made mcs fail when using MS assemblies).
5528
5529 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
5530
5531         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
5532         get the path to *corlib.dll.
5533
5534 2003-01-21  Nick Drochak <ndrochak@gol.com>
5535
5536         * cs-tokenizer.cs:
5537         * pending.cs:
5538         * typemanager.cs: Remove compiler warnings
5539
5540 2003-01-20  Duncan Mak  <duncan@ximian.com>
5541
5542         * AssemblyInfo.cs: Bump the version number to 0.19.
5543
5544 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5545
5546         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
5547
5548 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
5549
5550         * class.cs (Constructor::Emit): Emit debugging info for constructors.
5551
5552 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
5553
5554         * cs-parser.jay: Small fix: we were not comparing the constructor
5555         name correctly.   Thanks to Zoltan for the initial pointer.
5556
5557 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
5558
5559         * cs-tokenizer.cs: Set file name when specified with #line
5560
5561 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
5562
5563         * cs-parser.jay: Only perform the constructor checks here if we
5564         are named like the class;  This will help provider a better
5565         error.  The constructor path is taken when a type definition is
5566         not found, but most likely the user forgot to add the type, so
5567         report that rather than the constructor error.
5568
5569 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
5570
5571         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
5572         allocations.
5573
5574 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
5575
5576         * cs-parser.jay: Add cleanup call.
5577
5578 2003-01-13  Duncan Mak  <duncan@ximian.com>
5579
5580         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
5581         consistent with other methods.
5582
5583 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
5584
5585         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
5586
5587 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
5588
5589         * attribute.cs: only set GuidAttr to true when we have a
5590         GuidAttribute.
5591
5592 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5593
5594         * ecore.cs:
5595         * expression.cs:
5596         * typemanager.cs: fixes to allow mcs compile corlib with the new
5597         Type.IsSubclassOf fix.
5598
5599 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
5600
5601         * expression.cs (LocalVariableReference.DoResolve): Classify a
5602         constant as a value, not as a variable.   Also, set the type for
5603         the variable.
5604
5605         * cs-parser.jay (fixed_statement): take a type instead of a
5606         pointer_type, so we can produce a better error message later.
5607
5608         * statement.cs (Fixed.Resolve): Flag types that are not pointers
5609         as an error.  
5610
5611         (For.DoEmit): Make inifinite loops have a
5612         non-conditional branch back.
5613
5614         (Fixed.DoEmit): First populate the pinned variables, then emit the
5615         statement, then clear the variables.  Before I was emitting the
5616         code once for each fixed piece.
5617
5618
5619 2003-01-08  Martin Baulig  <martin@ximian.com>
5620
5621         * statement.cs (FlowBranching.MergeChild): A break in a
5622         SWITCH_SECTION does not leave a loop.  Fixes #36155.
5623
5624 2003-01-08  Martin Baulig  <martin@ximian.com>
5625
5626         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
5627         lives in the same number space than `param_map'.  Fixes #36154.
5628
5629 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
5630
5631         * cs-parser.jay (constructor_declaration): Set the
5632         Constructor.ModFlags before probing for it.  This makes the
5633         compiler report 514, 515 and 132 (the code was there, but got
5634         broken). 
5635
5636         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
5637         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
5638         (GotoCase.Resolve): Set `Returns' to ALWAYS.
5639
5640 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
5641
5642         * enum.cs: create the enum static fields using the enum type.
5643
5644 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
5645
5646         * class.cs: don't try to create the ParamBuilder for the return
5647         type if it's not needed (and handle it breaking for the ms runtime
5648         anyway).
5649
5650 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
5651
5652         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
5653
5654 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
5655
5656         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
5657         the command.   This showed up while compiling the JANET source
5658         code, which used \r as its only newline separator.
5659
5660 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
5661
5662         * class.cs (Method.Define): If we are an operator (because it
5663         reuses our code), then set the SpecialName and HideBySig.  #36128
5664
5665 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
5666
5667         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
5668         exception, report error 120 `object reference required'.
5669
5670         * driver.cs: Add --pause option, used during to measure the size
5671         of the process as it goes with --timestamp.
5672
5673         * expression.cs (Invocation.DoResolve): Do not allow methods with
5674         SpecialName to be invoked.
5675
5676 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
5679         number before adding it.
5680
5681 2002-12-21  Ravi Pratap  <ravi@ximian.com>
5682
5683         * ecore.cs (StandardImplicitConversion): When in an unsafe
5684         context, we allow conversion between void * to any other pointer
5685         type. This fixes bug #35973.
5686
5687 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
5688
5689         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
5690         is not thrown when extensionless outputs are used 
5691
5692 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5693
5694         * rootcontext.cs: fixed compilation of corlib.
5695
5696 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
5697
5698         * attribute.cs (Attributes.Contains): Add new method.
5699
5700         * class.cs (MethodCore.LabelParameters): if the parameter is an
5701         `out' parameter, check that no attribute `[In]' has been passed.
5702
5703         * enum.cs: Handle the `value__' name in an enumeration.
5704
5705 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
5706
5707         * decl.cs: Added special case to allow overrides on "protected
5708         internal" methods
5709
5710 2002-12-18  Ravi Pratap  <ravi@ximian.com>
5711
5712         * attribute.cs (Attributes.AddAttributeSection): Rename to this
5713         since it makes much more sense.
5714
5715         (Attributes.ctor): Don't require a Location parameter.
5716
5717         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
5718
5719         * attribute.cs (ApplyAttributes): Remove extra Location parameters
5720         since we already have that information per attribute.
5721
5722         * everywhere : make appropriate changes.
5723
5724         * class.cs (LabelParameters): Write the code which actually
5725         applies attributes to the return type. We can't do this on the MS
5726         .NET runtime so we flag a warning in the case an exception is
5727         thrown.
5728
5729 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
5730
5731         * const.cs: Handle implicit null conversions here too.
5732
5733 2002-12-17  Ravi Pratap  <ravi@ximian.com>
5734
5735         * class.cs (MethodCore.LabelParameters): Remove the extra
5736         Type [] parameter since it is completely unnecessary. Instead
5737         pass in the method's attributes so that we can extract
5738         the "return" attribute.
5739
5740 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
5741
5742         * cs-parser.jay (parse): Use Report.Error to flag errors instead
5743         of ignoring it and letting the compile continue.
5744
5745         * typemanager.cs (ChangeType): use an extra argument to return an
5746         error condition instead of throwing an exception.
5747
5748 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
5749
5750         * expression.cs (Unary.TryReduce): mimic the code for the regular
5751         code path.  Perform an implicit cast in the cases where we can
5752         implicitly convert to one of the integral types, and then reduce
5753         based on that constant.   This fixes bug #35483.
5754
5755 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5756
5757         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
5758
5759 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5760
5761         * namespace.cs: fixed bug #35489.
5762
5763 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
5764
5765         * class.cs: Remove some dead code.
5766
5767         * cs-parser.jay: Estimate the number of methods needed
5768         (RootContext.MethodCount);
5769
5770         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
5771         numbers instead of StringBuilders.
5772
5773         * support.cs (PtrHashtable): Add constructor with initial size;
5774         We can now reduce reallocations of the method table.
5775
5776 2002-12-10  Ravi Pratap  <ravi@ximian.com>
5777
5778         * attribute.cs (ApplyAttributes): Keep track of the emitted
5779         attributes on a per-target basis. This fixes bug #35413.
5780
5781 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
5782
5783         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
5784         default to the Windows 1252 encoding.
5785
5786         (UnixParseOption): Support version, thanks to Alp for the missing
5787         pointer. 
5788
5789         * AssemblyInfo.cs: Add nice assembly information.
5790
5791         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
5792         (bug 35169).
5793
5794         * cs-parser.jay: Allow a trailing comma before the close bracked
5795         in the attribute_section production.
5796
5797         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
5798         address of the instance was being taken, I will take this out,
5799         because we take the address of the object immediately here.
5800
5801 2002-12-09  Ravi Pratap  <ravi@ximian.com>
5802
5803         * typemanager.cs (AreMultipleAllowed): Take care of the most
5804         obvious case where attribute type is not in the current assembly -
5805         stupid me ;-)
5806
5807 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
5808
5809         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
5810         definitions, instead of doing that afterwards.  
5811
5812         Also we use a nice little hack, depending on the constructor, we
5813         know if we are a "composed" name or a simple name.  Hence, we
5814         avoid the IndexOf test, and we avoid 
5815
5816         * codegen.cs: Add code to assist in a bug reporter to track down
5817         the source of a compiler crash. 
5818
5819 2002-12-07  Ravi Pratap  <ravi@ximian.com>
5820
5821         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
5822         types have been emitted for a given element and flag an error
5823         if something which does not have AllowMultiple set is used more
5824         than once.
5825
5826         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
5827         attribute types and their corresponding AllowMultiple properties
5828
5829         (AreMultipleAllowed): Check the property for a given type.
5830
5831         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
5832         property in the case we have a TypeContainer.
5833
5834         (Attributes.AddAttribute): Detect duplicates and just skip on
5835         adding them. This trivial fix catches a pretty gross error in our
5836         attribute emission - global attributes were being emitted twice!
5837
5838         Bugzilla bug #33187 is now fixed.
5839
5840 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
5841
5842         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
5843         instead of pp_and).
5844
5845         * expression.cs (Binary.ResolveOperator): I can only use the
5846         Concat (string, string, string) and Concat (string, string,
5847         string, string) if the child is actually a concatenation of
5848         strings. 
5849
5850 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
5851
5852         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
5853         context where we need a 2-character lookahead.
5854
5855         * pending.cs (PendingImplementation): Rework so we can keep track
5856         of interface types all the time, and flag those which were
5857         implemented by parents as optional.
5858
5859 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
5860
5861         * expression.cs (Binary.ResolveOperator): Use
5862         String.Concat(string,string,string) or
5863         String.Concat(string,string,string,string) when possible. 
5864
5865         * typemanager: More helper methods.
5866
5867
5868 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
5869
5870         * pending.cs: remove the bogus return from GetMissingInterfaces()
5871         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
5872
5873 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5874
5875         * namespace.cs: avoid duplicated 'using xxx' being added to
5876         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
5877         when we get more than one 'using' statement for the same namespace.
5878         Report a CS0105 warning for it.
5879
5880 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
5881
5882         * cs-tokenizer.cs (consume_identifier): use read directly, instead
5883         of calling getChar/putback, uses internal knowledge of it.    
5884
5885         (xtoken): Reorder tokenizer so most common patterns are checked
5886         first.  This reduces the compilation time in another 5% (from 8.11s
5887         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
5888
5889         The parsing time is 22% of the compilation in mcs, and from that
5890         64% is spent on the tokenization process.  
5891
5892         I tried using a binary search for keywords, but this is slower
5893         than the hashtable.  Another option would be to do a couple of
5894         things:
5895
5896                 * Not use a StringBuilder, instead use an array of chars,
5897                   with a set value.  Notice that this way we could catch
5898                   the 645 error without having to do it *afterwards*.
5899
5900                 * We could write a hand-parser to avoid the hashtable
5901                   compares altogether.
5902
5903         The identifier consumption process takes 37% of the tokenization
5904         time.  Another 15% is spent on is_number.  56% of the time spent
5905         on is_number is spent on Int64.Parse:
5906
5907                 * We could probably choose based on the string length to
5908                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
5909                   computations. 
5910
5911         Another 3% is spend on wrapping `xtoken' in the `token' function.
5912
5913         Handle 0xa0 as whitespace (#34752)
5914
5915 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
5916
5917         * typemanager.cs (IsCLRType): New routine to tell whether a type
5918         is one of the builtin types.  
5919
5920         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
5921         typecode in more places instead of doing pointer comparissions.
5922         We could leverage some knowledge about the way the typecodes are
5923         laid out.
5924
5925         New code to cache namespaces in assemblies, it is currently not
5926         invoked, to be used soon.
5927
5928         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
5929
5930         * expression.cs (Binary.ResolveOperator): specially handle
5931         strings, and do not perform user-defined operator overloading for
5932         built-in types.
5933
5934 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
5935
5936         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
5937         internalcall as it is a pretty simple operation;  Avoid whenever
5938         possible to call Char.IsLetter.
5939
5940         (consume_identifier): Cut by half the number of
5941         hashtable calls by merging the is_keyword and GetKeyword behavior.
5942
5943         Do not short-circuit, because if we do, we
5944         report errors (ie, #if false && true would produce an invalid
5945         directive error);
5946
5947
5948 2002-11-24  Martin Baulig  <martin@ximian.com>
5949
5950         * expression.cs (Cast.TryReduce): If we're in checked syntax,
5951         check constant ranges and report a CS0221.  Fixes #33186.
5952
5953 2002-11-24  Martin Baulig  <martin@ximian.com>
5954
5955         * cs-parser.jay: Make this work for uninitialized variable
5956         declarations in the `for' initializer.  Fixes #32416.
5957
5958 2002-11-24  Martin Baulig  <martin@ximian.com>
5959
5960         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
5961         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
5962
5963 2002-11-24  Martin Baulig  <martin@ximian.com>
5964
5965         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
5966         argument; if true, we also check for user-defined conversions.
5967         This is only needed if both arguments are of a user-defined type.
5968         Fixes #30443, added test-175.cs.
5969         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
5970
5971         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
5972
5973 2002-11-24  Martin Baulig  <martin@ximian.com>
5974
5975         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
5976         function to get the store opcode.
5977         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
5978         only emit the Ldelema if the store opcode is Stobj.  You must run
5979         both test-34 and test-167 to test this.  Fixes #34529.
5980
5981 2002-11-23  Martin Baulig  <martin@ximian.com>
5982
5983         * ecore.cs (Expression.MemberLookup): Added additional
5984         `qualifier_type' argument which is used when we're being called
5985         from MemberAccess.DoResolve() and null if we're called from a
5986         SimpleName lookup.
5987         (Expression.MemberLookupFailed): New method to report errors; this
5988         does the CS1540 check and reports the correct error message.
5989
5990         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
5991         argument for the CS1540 check and redone the way how we're dealing
5992         with private members.  See the comment in the source code for details.
5993         (FilterWithClosure): Reverted this back to revision 1.197; renamed
5994         `closure_start_type' to `closure_qualifier_type' and check whether
5995         it's not null.  It was not this filter being broken, it was just
5996         being called with the wrong arguments.
5997
5998         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
5999         and pass it the correct `qualifier_type'; this also does the error
6000         handling for us.
6001
6002 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
6003
6004         * expression.cs (Invocation.EmitParams): If the we are dealing
6005         with a non-built-in value type, load its address as well.
6006
6007         (ArrayCreation): Use a a pretty constant instead
6008         of the hardcoded value 2.   Use 6 instead of 2 for the number of
6009         static initializers.  
6010
6011         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
6012         because they are not really value types, just glorified integers. 
6013
6014         * driver.cs: Do not append .exe, the CSC compiler does not do it.
6015
6016         * ecore.cs: Remove redundant code for enumerations, make them use
6017         the same code path as everything else, fixes the casting issue
6018         with enumerations in Windows.Forms.
6019
6020         * attribute.cs: Do only cast to string if it is a string, the
6021         validation happens later.
6022
6023         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
6024         people upgrade their corlibs.
6025
6026         * ecore.cs: Oops, enumerations were not following the entire code path
6027
6028 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
6029
6030         * typemanager.cs (FilterWithClosure): Commented out the test for
6031         1540 in typemanager.cs, as it has problems when accessing
6032         protected methods from a parent class (see test-174.cs). 
6033
6034         * attribute.cs (Attribute.ValidateGuid): new method.
6035         (Attribute.Resolve): Use above.
6036
6037 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
6038
6039         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
6040
6041         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
6042         handling for enumerations, as we only needed the TypeContainer
6043         functionality to begin with (this is required for the fix below to
6044         work for enums that reference constants in a container class for
6045         example). 
6046
6047         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
6048
6049         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
6050         a valid TypeBuilder to perform lookups on.o
6051
6052         * class.cs (InheritableMemberSignatureCompare): Use true in the
6053         call to GetGetMethod and GetSetMethod, because we are comparing
6054         the signature, and we need to get the methods *even* if they are
6055         private. 
6056
6057         (PropertyBase.CheckBase): ditto.
6058
6059         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
6060         GotoCase.Resolve): Use Peel on EmpytCasts.
6061
6062         * ecore.cs (EmptyCast): drop child, add Peel method.
6063
6064 2002-11-17  Martin Baulig  <martin@ximian.com>
6065
6066         * ecore.cs (EmptyCast.Child): New public property.
6067
6068         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
6069         label resolved to an EmptyCast.  Fixes #34162.
6070         (GotoCase.Resolve): Likewise.
6071         (Block.EmitMeta): Likewise.
6072
6073 2002-11-17  Martin Baulig  <martin@ximian.com>
6074
6075         * expression.cs (Invocation.BetterConversion): Prefer int over
6076         uint; short over ushort; long over ulong for integer literals.
6077         Use ImplicitConversionExists instead of StandardConversionExists
6078         since we also need to check for user-defined implicit conversions.
6079         Fixes #34165.  Added test-173.cs.
6080
6081 2002-11-16  Martin Baulig  <martin@ximian.com>
6082
6083         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
6084         with the `true' and `false' literals.  Fixes #33151.
6085
6086 2002-11-16  Martin Baulig  <martin@ximian.com>
6087
6088         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
6089         October 22nd; don't do the cs1540 check for static members.
6090
6091         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
6092         now using our own filter here and doing the cs1540 check again.
6093
6094 2002-11-16  Martin Baulig  <martin@ximian.com>
6095
6096         * support.cs (InternalParameters): Don't crash if we don't have
6097         any fixed parameters.  Fixes #33532.
6098
6099 2002-11-16  Martin Baulig  <martin@ximian.com>
6100
6101         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
6102         when looking up static methods to make this work on Windows.
6103         Fixes #33773.
6104
6105 2002-11-16  Martin Baulig  <martin@ximian.com>
6106
6107         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
6108         a setter rather than using PropertyInfo.CanWrite.
6109
6110 2002-11-15  Nick Drochak  <ndrochak@gol.com>
6111
6112         * class.cs: Allow acces to block member by subclasses. Fixes build
6113         breaker.
6114
6115 2002-11-14  Martin Baulig  <martin@ximian.com>
6116
6117         * class.cs (Constructor.Emit): Added the extern/block check.
6118         Fixes bug #33678.
6119
6120 2002-11-14  Martin Baulig  <martin@ximian.com>
6121
6122         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
6123         iteration while looking for indexers, this is needed because the
6124         indexer may have a different name in our base classes.  Fixed the
6125         error reporting (no indexers at all, not get accessor, no
6126         overloaded match).  Fixes bug #33089.
6127         (IndexerAccess.DoResolveLValue): Likewise.
6128
6129 2002-11-14  Martin Baulig  <martin@ximian.com>
6130
6131         * class.cs (PropertyBase.CheckBase): Make this work for multiple
6132         indexers.  Fixes the first part of bug #33089.
6133         (MethodSignature.InheritableMemberSignatureCompare): Added support
6134         for properties.
6135
6136 2002-11-13  Ravi Pratap  <ravi@ximian.com>
6137
6138         * attribute.cs (Attribute.Resolve): Catch the
6139         NullReferenceException and report it since it isn't supposed to
6140         happen. 
6141
6142 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
6143
6144         * expression.cs (Binary.EmitBranchable): Also handle the cases for
6145         LogicalOr and LogicalAnd that can benefit from recursively
6146         handling EmitBranchable.  The code now should be nice for Paolo.
6147
6148 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
6149
6150         * typemanager.cs (LookupType): Added a negative-hit hashtable for
6151         the Type lookups, as we perform quite a number of lookups on
6152         non-Types.  This can be removed once we can deterministically tell
6153         whether we have a type or a namespace in advance.
6154
6155         But this might require special hacks from our corlib.
6156
6157         * TODO: updated.
6158
6159         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
6160         and double which avoids a conversion from an integer to a double.
6161
6162         * expression.cs: tiny optimization, avoid calling IsConstant,
6163         because it effectively performs the lookup twice.
6164
6165 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
6166
6167         But a bogus return here to keep the semantics of the old code
6168         until the Mono runtime is fixed.
6169
6170         * pending.cs (GetMissingInterfaces): New method used to remove all
6171         the interfaces that are already implemented by our parent
6172         classes from the list of pending methods. 
6173
6174         * interface.cs: Add checks for calls after ResolveTypeExpr.
6175
6176 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
6177
6178         * class.cs (Class.Emit): Report warning 67: event not used if the
6179         warning level is beyond 3.
6180
6181         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
6182         being a NullLiteral.
6183
6184         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
6185         specifiers. 
6186
6187         * class.cs (TypeContainer.GetClassBases): Cover a missing code
6188         path that might fail if a type can not be resolved.
6189
6190         * expression.cs (Binary.Emit): Emit unsigned versions of the
6191         operators. 
6192
6193         * driver.cs: use error 5.
6194
6195 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
6196
6197         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
6198
6199 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
6200
6201         * cs-parser.jay (switch_section): A beautiful patch from Martin
6202         Baulig that fixed 33094.
6203
6204 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
6205
6206         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
6207         Check whether the base is abstract and report an error if so.
6208
6209         * expression.cs (IndexerAccess.DoResolveLValue,
6210         IndexerAccess.DoResolve): ditto. 
6211
6212         (Invocation.DoResolve): ditto.
6213
6214         (Invocation.FullMethodDesc): Improve the report string.
6215
6216         * statement.cs (Block): Eliminate IsVariableDefined as it is
6217         basically just a wrapper for GetVariableInfo.
6218
6219         * ecore.cs (SimpleName): Use new 
6220
6221         * support.cs (ReflectionParamter.ParameterType): We unwrap the
6222         type, as we return the actual parameter ref/unref state on a
6223         different call.
6224
6225 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
6226
6227         * support.cs: Return proper flags REF/OUT fixing the previous
6228         commit.  
6229
6230         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
6231         not used to mean `ref' but `ref or out' in ParameterReference
6232
6233         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
6234         full type signature instead of calling TypeManger.CSharpName
6235         ourselves. 
6236
6237         * support.cs (InternalParameters.ParameterDesc): Do not compare
6238         directly to the modflags, because REF/OUT will actually be bitsets
6239         if set. 
6240
6241         * delegate.cs (VerifyMethod): Check also the modifiers.
6242
6243         * cs-tokenizer.cs: Fix bug where floating point values with an
6244         exponent where a sign was missing was ignored.
6245
6246         * driver.cs: Allow multiple assemblies to be specified in a single
6247         /r: argument
6248
6249 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
6250
6251         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
6252         because identifiers after a parenthesis would end up in this kind
6253         of production, and we needed to desamiguate it for having casts
6254         like:
6255
6256                 (UserDefinedType *) xxx
6257
6258 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
6259
6260         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
6261         we should set on the Bindingflags.NonPublic, but not turn on
6262         private_ok.  private_ok controls whether a Private member is
6263         returned (this is chekced on the filter routine), while the
6264         BindingFlags.NonPublic just controls whether private/protected
6265         will be allowed.   This fixes the problem part of the problem of
6266         private properties being allowed to be used in derived classes.
6267
6268         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
6269         so we can call the children DoResolveLValue method (this will
6270         properly signal errors on lvalue assignments to base properties)
6271
6272         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
6273         getter are null, and we have a property info, we know that this
6274         happened because the lookup failed, so we report an error 122 for
6275         protection level violation.
6276
6277         We also silently return if setter and getter are null in the
6278         resolve functions, this condition only happens if we have flagged
6279         the error before.  This is the other half of the problem. 
6280
6281         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
6282         not have accessibility information, that is why we were returning
6283         true in the filter function in typemanager.cs.
6284
6285         To properly report 122 (property is inaccessible because of its
6286         protection level) correctly, we report this error in ResolveAccess
6287         by failing if both the setter and the getter are lacking (ie, the
6288         lookup failed). 
6289
6290         DoResolve and DoLResolve have been modified to check for both
6291         setter/getter being null and returning silently, the reason being
6292         that I did not want to put the knowledge about this error in upper
6293         layers, like:
6294
6295         int old = Report.Errors;
6296         x = new PropertyExpr (...);
6297         if (old != Report.Errors)
6298                 return null;
6299         else
6300                 return x;
6301
6302         So the property expr is returned, but it is invalid, so the error
6303         will be flagged during the resolve process. 
6304
6305         * class.cs: Remove InheritablePropertySignatureCompare from the
6306         class, as we no longer depend on the property signature to compute
6307         whether it is possible to implement a method or not.
6308
6309         The reason is that calling PropertyInfo.GetGetMethod will return
6310         null (in .NET, in Mono it works, and we should change this), in
6311         cases where the Get Method does not exist in that particular
6312         class.
6313
6314         So this code:
6315
6316         class X { public virtual int A { get { return 1; } } }
6317         class Y : X { }
6318         class Z : Y { public override int A { get { return 2; } } }
6319
6320         Would fail in Z because the parent (Y) would not have the property
6321         defined.  So we avoid this completely now (because the alternative
6322         fix was ugly and slow), and we now depend exclusively on the
6323         method names.
6324
6325         (PropertyBase.CheckBase): Use a method-base mechanism to find our
6326         reference method, instead of using the property.
6327
6328         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
6329         routines are gone now.
6330
6331         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
6332         names, they were incorrectly named.
6333
6334         * cs-tokenizer.cs: Return are more gentle token on failure. 
6335
6336         * pending.cs (PendingImplementation.InterfaceMethod): This routine
6337         had an out-of-sync index variable, which caused it to remove from
6338         the list of pending methods the wrong method sometimes.
6339
6340 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
6341
6342         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
6343         CanWrite, because those refer to this particular instance of the
6344         property, and do not take into account the fact that we can
6345         override single members of a property.
6346
6347         Constructor requires an EmitContext.  The resolution process does
6348         not happen here, but we need to compute the accessors before,
6349         because the resolution does not always happen for properties.
6350
6351         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
6352         subclass, before we did not update this flag, but we did update
6353         bindingflags. 
6354
6355         (GetAccessors): Drop this routine, as it did not work in the
6356         presence of partially overwritten set/get methods. 
6357
6358         Notice that this broke the cs1540 detection, but that will require
6359         more thinking. 
6360
6361 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6362
6363         * class.cs:
6364         * codegen.cs:
6365         * driver.cs: issue a warning instead of an error if we don't support
6366         debugging for the platform. Also ignore a couple of errors that may
6367         arise when trying to write the symbols. Undo my previous patch.
6368
6369 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6370
6371         * driver.cs: ignore /debug switch except for Unix platforms.
6372
6373 2002-10-23  Nick Drochak  <ndrochak@gol.com>
6374
6375         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
6376
6377 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
6378
6379         * driver.cs: Do not make mcs-debug conditional, so we do not break
6380         builds that use it.
6381
6382         * statement.cs (UsageVector.MergeChildren): I would like Martin to
6383         review this patch.  But basically after all the children variables
6384         have been merged, the value of "Breaks" was not being set to
6385         new_breaks for Switch blocks.  I think that it should be set after
6386         it has executed.  Currently I set this to the value of new_breaks,
6387         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
6388         conservative, but I do not understand this code very well.
6389
6390         I did not break anything in the build, so that is good ;-)
6391
6392         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
6393
6394 2002-10-20  Mark Crichton  <crichton@gimp.org>
6395
6396         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
6397
6398 2002-10-20  Nick Drochak  <ndrochak@gol.com>
6399
6400         * cfold.cs: Fixed compile blocker.
6401
6402 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
6403
6404         * driver.cs: I was chekcing the key, not the file.
6405
6406 2002-10-19  Ravi Pratap  <ravi@ximian.com>
6407
6408         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
6409         message that we were generating - we just need to silently return
6410         a null.
6411
6412 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
6413
6414         * class.cs (Event.Define): Change my previous commit, as this
6415         breaks the debugger.  This is a temporary hack, as it seems like
6416         the compiler is generating events incorrectly to begin with.
6417
6418         * expression.cs (Binary.ResolveOperator): Added support for 
6419         "U operator - (E x, E y)"
6420
6421         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
6422         y)".
6423
6424         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
6425         init-only variables, but this path did not take into account that
6426         there might be also instance readonly variables.  Correct this
6427         problem. 
6428
6429         This fixes bug 32253
6430
6431         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
6432         delegates as well.
6433
6434         * driver.cs: Change the extension for modules to `netmodule'
6435
6436         * cs-parser.jay: Improved slightly the location tracking for
6437         the debugger symbols.
6438
6439         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
6440         modifiers that were specified instead of the hardcoded value
6441         (FamAndAssem).  This was basically ignoring the static modifier,
6442         and others.  Fixes 32429.
6443
6444         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
6445         fixed a bug in the process (32476)
6446
6447         * expression.cs (ArrayAccess.EmitAssign): Patch from
6448         hwang_rob@yahoo.ca that fixes bug 31834.3
6449
6450 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
6451
6452         * driver.cs: Make the module extension .netmodule.
6453
6454 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
6455
6456         * driver.cs: Report an error if the resource file is not found
6457         instead of crashing.
6458
6459         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
6460         false, like Emit does.
6461
6462 2002-10-16  Nick Drochak  <ndrochak@gol.com>
6463
6464         * typemanager.cs: Remove unused private member.  Also reported mcs
6465         bug to report this as a warning like csc.
6466
6467 2002-10-15  Martin Baulig  <martin@gnome.org>
6468
6469         * statement.cs (Statement.Emit): Made this a virtual method; emits
6470         the line number info and calls DoEmit().
6471         (Statement.DoEmit): New protected abstract method, formerly knows
6472         as Statement.Emit().
6473
6474         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
6475
6476 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
6477
6478         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
6479         have fixed a remaining problem: not every AddXXXX was adding a
6480         fully qualified name.  
6481
6482         Now everyone registers a fully qualified name in the DeclSpace as
6483         being defined instead of the partial name.  
6484
6485         Downsides: we are slower than we need to be due to the excess
6486         copies and the names being registered this way.  
6487
6488         The reason for this is that we currently depend (on the corlib
6489         bootstrap for instance) that types are fully qualified, because
6490         we dump all the types in the namespace, and we should really have
6491         types inserted into the proper namespace, so we can only store the
6492         basenames in the defined_names array.
6493
6494 2002-10-10  Martin Baulig  <martin@gnome.org>
6495
6496         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
6497         from bug #31834, see the bug report for a testcase which is
6498         miscompiled.
6499
6500 2002-10-10  Martin Baulig  <martin@gnome.org>
6501
6502         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
6503         flow analysis code for this.
6504
6505         * statement.cs (Do, While, For): Tell the flow analysis code about
6506         infinite loops.
6507         (FlowBranching.UsageVector): Added support for infinite loops.
6508         (Block.Resolve): Moved the dead code elimination here and use flow
6509         analysis to do it.
6510
6511 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
6512
6513         * class.cs (Field.Define): Catch cycles on struct type
6514         definitions. 
6515
6516         * typemanager.cs (IsUnmanagedtype): Do not recursively check
6517         fields if the fields are static.  We only need to check instance
6518         fields. 
6519
6520         * expression.cs (As.DoResolve): Test for reference type.
6521
6522         * statement.cs (Using.ResolveExpression): Use
6523         ConvertImplicitRequired, not ConvertImplicit which reports an
6524         error on failture
6525         (Using.ResolveLocalVariableDecls): ditto.
6526
6527         * expression.cs (Binary.ResolveOperator): Report errors in a few
6528         places where we had to.
6529
6530         * typemanager.cs (IsUnmanagedtype): Finish implementation.
6531
6532 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
6533
6534         * expression.cs: Use StoreFromPtr instead of extracting the type
6535         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
6536
6537         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
6538         an enumeration value to a System.Enum, but System.Enum is not a
6539         value type, but an class type, so we need to box.
6540
6541         (Expression.ConvertExplicit): One codepath could return
6542         errors but not flag them.  Fix this.  Fixes #31853
6543
6544         * parameter.cs (Resolve): Do not allow void as a parameter type.
6545
6546 2002-10-06  Martin Baulig  <martin@gnome.org>
6547
6548         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
6549         if it's a class type and not a struct.  Fixes #31815.
6550
6551 2002-10-06  Martin Baulig  <martin@gnome.org>
6552
6553         * statement.cs: Reworked the flow analysis code a bit to make it
6554         usable for dead code elimination.
6555
6556 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6557
6558         * cs-parser.jay: allow empty source files. Fixes bug #31781.
6559
6560 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
6561
6562         * expression.cs (ComposedCast.DoResolveType): A quick workaround
6563         to fix the test 165, will investigate deeper.
6564
6565 2002-10-04  Martin Baulig  <martin@gnome.org>
6566
6567         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
6568         finally blocks actually work.
6569         (Try.Resolve): We don't need to create a sibling for `finally' if
6570         there is no finally block.
6571
6572 2002-10-04  Martin Baulig  <martin@gnome.org>
6573
6574         * class.cs (Constructor.Define): The default accessibility for a
6575         non-default constructor is private, not public.
6576
6577 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
6578
6579         * class.cs (Constructor): Make AllowedModifiers public, add
6580         EXTERN.
6581
6582         * cs-parser.jay: Perform the modifiers test here, as the
6583         constructor for the Constructor class usually receives a zero
6584         because of the way we create it (first we create, later we
6585         customize, and we were never checking the modifiers).
6586
6587         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
6588         is a version of LookupTypeReflection that includes the type-name
6589         cache.  This can be used as a fast path for functions that know
6590         the fully qualified name and are only calling into *.GetType() to
6591         obtain a composed type.
6592
6593         This is also used by TypeManager.LookupType during its type
6594         composition.
6595
6596         (LookupType): We now also track the real type name, as sometimes
6597         we can get a quey for the real type name from things like
6598         ComposedCast.  This fixes bug 31422.
6599
6600         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
6601         complete type fullname, it does not have to go through the type
6602         resolution system to obtain the composed version of the type (for
6603         obtaining arrays or pointers).
6604
6605         (Conditional.Emit): Use the EmitBoolExpression to
6606         generate nicer code, as requested by Paolo.
6607
6608         (ArrayCreation.CheckIndices): Use the patch from
6609         hwang_rob@yahoo.ca to validate the array initializers. 
6610
6611 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * class.cs (ConstructorInitializer.Emit): simplify code by using
6614         Invocation.EmitCall, and at the same time, fix the bugs in calling
6615         parent constructors that took variable arguments. 
6616
6617         * ecore.cs (Expression.ConvertNumericExplicit,
6618         Expression.ImplicitNumericConversion): Remove the code that
6619         manually wrapped decimal (InternalTypeConstructor call is now gone
6620         as well).
6621
6622         * expression.cs (Cast.TryReduce): Also handle decimal types when
6623         trying to perform a constant fold on the type.
6624
6625         * typemanager.cs (IsUnmanagedtype): Partially implemented.
6626
6627         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
6628         that only turned off an error report, and did nothing else. 
6629
6630 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
6631
6632         * driver.cs: Handle and ignore /fullpaths
6633
6634 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
6635
6636         * expression.cs (Binary.ResolveOperator): Catch the case where
6637         DoNumericPromotions returns true, 
6638
6639         (Binary.DoNumericPromotions): Simplify the code, and the tests.
6640
6641 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
6642
6643         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
6644         report error 70.
6645
6646 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
6647
6648         * ecore.cs (ConvertNumericExplicit): It is not enough that the
6649         conversion exists, but it is also required that the conversion be
6650         performed.  This manifested in "(Type64Enum) 2".  
6651
6652         * class.cs (TypeManager.AddMethod): The fix is not to change
6653         AddEnum, because that one was using a fully qualified name (every
6654         DeclSpace derivative does), but to change the AddMethod routine
6655         that was using an un-namespaced name.  This now correctly reports
6656         the duplicated name.
6657
6658         Revert patch until I can properly fix it.  The issue
6659         is that we have a shared Type space across all namespaces
6660         currently, which is wrong.
6661
6662         Options include making the Namespace a DeclSpace, and merge
6663         current_namespace/current_container in the parser.
6664
6665 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
6666
6667         * cs-parser.jay: Improve error reporting when we get a different
6668         kind of expression in local_variable_type and
6669         local_variable_pointer_type. 
6670
6671         Propagate this to avoid missleading errors being reported.
6672
6673         * ecore.cs (ImplicitReferenceConversion): treat
6674         TypeManager.value_type as a target just like object_type.   As
6675         code like this:
6676
6677         ValueType v = 1;
6678
6679         Is valid, and needs to result in the int 1 being boxed before it
6680         is assigned to the value type v.
6681
6682         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
6683         to validate the enumeration name.
6684
6685         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
6686         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
6687         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
6688
6689         * ecore.cs (TryImplicitIntConversion): When doing an
6690         implicit-enumeration-conversion, check if the type is 64-bits and
6691         perform a conversion before passing to EnumConstant.
6692
6693 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
6694
6695         * decl.cs (Error_AmbiguousTypeReference); New routine used to
6696         report ambiguous type references.  Unlike the MS version, we
6697         report what the ambiguity is.   Innovation at work ;-)
6698
6699         (DeclSpace.FindType): Require a location argument to
6700         display when we display an ambiguous error.
6701
6702         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
6703
6704         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
6705
6706         * expression.cs (EmitDynamicInitializers): Apply patch from
6707         hwang_rob@yahoo.ca that fixes the order in which we emit our
6708         initializers. 
6709
6710 2002-09-21  Martin Baulig  <martin@gnome.org>
6711
6712         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
6713         delegate takes no arguments.
6714
6715 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
6716
6717         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
6718         from integers.
6719
6720         * expression.cs: Extract the underlying type.
6721
6722         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
6723
6724         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
6725
6726 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
6727
6728         * class.cs (TypeContainer.DefineType): We can not use the nice
6729         PackingSize with the size set to 1 DefineType method, because it
6730         will not allow us to define the interfaces that the struct
6731         implements.
6732
6733         This completes the fixing of bug 27287
6734
6735         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
6736         means also structs.  This fixes part of the problem. 
6737         (Expresion.ImplicitReferenceConversionExists): ditto.
6738
6739         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
6740         error if there were no errors reported during the type lookup
6741         process, to avoid duplicates or redundant errors.  Without this
6742         you would get an ambiguous errors plus a type not found.  We have
6743         beaten the user enough with the first error.  
6744
6745         (DeclSparce.FindType): Emit a warning if we have an ambiguous
6746         reference. 
6747
6748         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
6749         during the resolution process, stop the lookup, this avoids
6750         repeated error reports (same error twice).
6751
6752         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
6753
6754         * typemanager.cs (LookupType): Redo the type lookup code to match
6755         the needs of System.Reflection.  
6756
6757         The issue is that System.Reflection requires references to nested
6758         types to begin with a "+" sign instead of a dot.  So toplevel
6759         types look like: "NameSpace.TopLevelClass", and nested ones look
6760         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
6761         levels. 
6762
6763 2002-09-19  Martin Baulig  <martin@gnome.org>
6764
6765         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
6766         says that a method always returns or always throws an exception,
6767         don't report the CS0161.
6768
6769         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
6770         set `Returns = new_returns'.
6771
6772 2002-09-19  Martin Baulig  <martin@gnome.org>
6773
6774         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
6775         to an enum constant, check for a CS0176.
6776
6777 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
6778
6779         * class.cs (TypeContainer.CheckPairedOperators): Now we check
6780         for operators that must be in pairs and report errors.
6781
6782         * ecore.cs (SimpleName.DoResolveType): During the initial type
6783         resolution process, when we define types recursively, we must
6784         check first for types in our current scope before we perform
6785         lookups in the enclosing scopes.
6786
6787         * expression.cs (MakeByteBlob): Handle Decimal blobs.
6788
6789         (Invocation.VerifyArgumentsCompat): Call
6790         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
6791         I thought we were supposed to always call this, but there are a
6792         few places in the code where we dont do it.
6793
6794 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
6795
6796         * driver.cs: Add support in -linkres and -resource to specify the
6797         name of the identifier.
6798
6799 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
6800
6801         * ecore.cs (StandardConversionExists): Sync with the conversion
6802         code: allow anything-* to void* conversions.
6803
6804         (FindMostSpecificSource): Use an Expression argument
6805         instead of a Type, because we might be handed over a Literal which
6806         gets a few more implicit conversions that plain types do not.  So
6807         this information was being lost.
6808
6809         Also, we drop the temporary type-holder expression when not
6810         required.
6811
6812 2002-09-17  Martin Baulig  <martin@gnome.org>
6813
6814         * class.cs (PropertyBase.CheckBase): Don't check the base class if
6815         this is an explicit interface implementation.
6816
6817 2002-09-17  Martin Baulig  <martin@gnome.org>
6818
6819         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
6820         different `IndexerName' attributes.
6821
6822         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
6823         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
6824         virtual CommonResolve().
6825
6826 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
6827
6828         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
6829         and convert that to the UnderlyingType.
6830
6831         * statement.cs (Foreach.Resolve): Indexers are just like variables
6832         or PropertyAccesses.
6833
6834         * cs-tokenizer.cs (consume_string): Track line numbers and columns
6835         inside quoted strings, we were not doing this before.
6836
6837 2002-09-16  Martin Baulig  <martin@gnome.org>
6838
6839         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
6840         resolve it.  This is needed for the definite assignment check of the
6841         instance expression, fixes bug #29846.
6842         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
6843
6844 2002-09-16  Nick Drochak  <ndrochak@gol.com>
6845
6846         * parameter.cs: Fix compile error.  Cannot reference static member
6847         from an instance object.  Is this an mcs bug?
6848
6849 2002-09-14  Martin Baulig  <martin@gnome.org>
6850
6851         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
6852         multiple times.  Fixes bug #30295, added test-166.cs.
6853
6854 2002-09-14  Martin Baulig  <martin@gnome.org>
6855
6856         * statement.cs (Block.Emit): Don't emit unreachable code.
6857         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
6858         `break' statements.
6859         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
6860
6861 2002-09-14  Martin Baulig  <martin@gnome.org>
6862
6863         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
6864         is set.
6865
6866 2002-09-14  Martin Baulig  <martin@gnome.org>
6867
6868         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
6869         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
6870         be false on the ms runtime.
6871
6872 2002-09-13  Martin Baulig  <martin@gnome.org>
6873
6874         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
6875         the CS0038 error message.
6876
6877 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
6878
6879         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
6880         constant inside, return it.
6881
6882 2002-09-12  Martin Baulig  <martin@gnome.org>
6883
6884         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
6885         implicit conversion can be done between enum types.
6886
6887         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
6888         check whether an implicit conversion to the current enum's UnderlyingType
6889         exists and report an error if not.
6890
6891         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
6892         without debugging support.
6893
6894         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
6895         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
6896
6897 2002-09-12  Martin Baulig  <martin@gnome.org>
6898
6899         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
6900
6901         * ecore.cs (IMemberExpr.DeclaringType): New property.
6902         (SimpleName.SimpleNameResolve): Check whether we're accessing a
6903         nonstatic member of an outer type (CS0038).
6904
6905 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
6906
6907         * driver.cs: Activate the using-error detector at warning level
6908         4 (at least for MS-compatible APIs).
6909
6910         * namespace.cs (VerifyUsing): Small buglett fix.
6911
6912         * pending.cs (PendingImplementation): pass the container pointer. 
6913
6914         * interface.cs (GetMethods): Allow for recursive definition.  Long
6915         term, I would like to move every type to support recursive
6916         definitions, not the current ordering mechanism that we have right
6917         now.
6918
6919         The situation is this: Attributes are handled before interfaces,
6920         so we can apply attributes to interfaces.  But some attributes
6921         implement interfaces, we will now handle the simple cases
6922         (recursive definitions will just get an error).  
6923
6924         * parameter.cs: Only invalidate types at the end if we fail to
6925         lookup all types.  
6926
6927 2002-09-09  Martin Baulig  <martin@gnome.org>
6928
6929         * ecore.cs (PropertyExpr.Emit): Also check for
6930         TypeManager.system_int_array_get_length so this'll also work when
6931         compiling corlib.  Fixes #30003.
6932
6933 2002-09-09  Martin Baulig  <martin@gnome.org>
6934
6935         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
6936         and throw an exception if we can't get the type's size.  Fixed #30040,
6937         added test-165.cs.
6938
6939 2002-09-09  Martin Baulig  <martin@gnome.org>
6940
6941         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
6942
6943         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
6944         context.  Fixes bug #30027.
6945
6946         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
6947         virtual functions.  Fixes bug #30043, added test-164.cs.
6948
6949 2002-09-08  Ravi Pratap  <ravi@ximian.com>
6950
6951         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
6952
6953 2002-09-08  Nick Drochak  <ndrochak@gol.com>
6954
6955         * driver.cs: Use an object to get the windows codepage since it's not a
6956         static property.
6957
6958 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
6959
6960         * statement.cs (For.Emit): for infinite loops (test == null)
6961         return whether there is a break inside, not always "true".
6962
6963         * namespace.cs (UsingEntry): New struct to hold the name of the
6964         using definition, the location where it is defined, and whether it
6965         has been used in a successful type lookup.
6966
6967         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
6968         strings.
6969
6970         * decl.cs: ditto.
6971
6972 2002-09-06  Ravi Pratap  <ravi@ximian.com>
6973
6974         * attribute.cs : Fix incorrect code which relied on catching
6975         a NullReferenceException to detect a null being passed in
6976         where an object was expected.
6977
6978 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
6979
6980         * statement.cs (Try): flag the catch variable as assigned
6981
6982         * expression.cs (Cast): Simplified by using ResolveType instead of
6983         manually resolving.
6984
6985         * statement.cs (Catch): Fix bug by using ResolveType.
6986
6987 2002-09-06  Ravi Pratap  <ravi@ximian.com>
6988
6989         * expression.cs (BetterConversion): Special case for when we have
6990         a NullLiteral as the argument and we have to choose between string
6991         and object types - we choose string the way csc does.
6992
6993         * attribute.cs (Attribute.Resolve): Catch the
6994         NullReferenceException and report error #182 since the Mono
6995         runtime no more has the bug and having this exception raised means
6996         we tried to select a constructor which takes an object and is
6997         passed a null.
6998
6999 2002-09-05  Ravi Pratap  <ravi@ximian.com>
7000
7001         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
7002         message (1502, 1503) when we can't locate a method after overload
7003         resolution. This is much more informative and closes the bug
7004         Miguel reported.
7005
7006         * interface.cs (PopulateMethod): Return if there are no argument
7007         types. Fixes a NullReferenceException bug.
7008
7009         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
7010         expressions too. Previously we were checking only in one place for
7011         positional arguments leaving out named arguments.
7012
7013         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
7014         type to the enum type is not allowed. Remove code corresponding to
7015         that.
7016
7017         (ConvertNumericExplicit): Allow explicit conversions from
7018         the underlying type to enum type. This precisely follows the spec
7019         and closes a bug filed by Gonzalo.
7020
7021 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7022
7023         * compiler.csproj:
7024         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
7025
7026 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
7027
7028         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
7029         it was important that we stored the right value after the
7030         reduction in `converted'.
7031
7032 2002-09-04  Martin Baulig  <martin@gnome.org>
7033
7034         * location.cs (Location.SymbolDocument): Use full pathnames for the
7035         source files.
7036
7037 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
7038
7039         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
7040         of the expression resolve mechanism, because that will catch the
7041         SimpleName error failures.
7042
7043         (Conditional): If we can not resolve the
7044         expression, return, do not crash.
7045
7046 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7047
7048         * cs-tokenizer.cs:
7049         (location): display token name instead of its number.
7050
7051 2002-08-28  Martin Baulig  <martin@gnome.org>
7052
7053         * expression.cs (Binary.ResolveOperator): Don't silently return
7054         but return an error if an operator cannot be applied between two
7055         enum types.
7056
7057 2002-08-28  Martin Baulig  <martin@gnome.org>
7058
7059         * class.cs (Constructor.Define): Set the permission attributes
7060         correctly instead of making all constructors public.
7061
7062 2002-08-28  Martin Baulig  <martin@gnome.org>
7063
7064         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
7065         for private members before reporting a CS0103; if we find anything,
7066         it's a CS0122.
7067
7068 2002-08-28  Martin Baulig  <martin@gnome.org>
7069
7070         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
7071         to check whether `closure_start_type == closure_invocation_type',
7072         we also need to check whether `m.DeclaringType == closure_invocation_type'
7073         before bypassing the permission checks.  We might be accessing
7074         protected/private members from the base class.
7075         (TypeManager.RealMemberLookup): Only set private_ok if private
7076         members were requested via BindingFlags.NonPublic.
7077
7078         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
7079
7080         * expression.cs (MemberAccess.ResolveMemberAccess): Set
7081         MethodGroupExpr.IsExplicitImpl if appropriate.
7082         (Invocation.DoResolve): Don't report the CS0120 for explicit
7083         interface implementations.
7084
7085 2002-08-27  Martin Baulig  <martin@gnome.org>
7086
7087         * expression.cs (Invocation.DoResolve): If this is a static
7088         method and we don't have an InstanceExpression, we must report
7089         a CS0120.
7090
7091 2002-08-25  Martin Baulig  <martin@gnome.org>
7092
7093         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
7094         `==' between a valuetype and an object.
7095
7096 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
7097
7098         * ecore.cs (TypeExpr): Provide a ToString method.
7099
7100 2002-08-24  Martin Baulig  <martin@gnome.org>
7101
7102         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
7103         now called proggie.dbg and it's a binary file.
7104
7105 2002-08-23  Martin Baulig  <martin@gnome.org>
7106
7107         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
7108
7109 2002-08-23  Martin Baulig  <martin@gnome.org>
7110
7111         * struct.cs (MyStructInfo.ctor): Make this work with empty
7112         structs; it's not allowed to use foreach() on null.
7113
7114 2002-08-23  Martin Baulig  <martin@gnome.org>
7115
7116         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
7117         writer the full pathname of the generated assembly.
7118
7119 2002-08-23  Martin Baulig  <martin@gnome.org>
7120
7121         * statements.cs (FlowBranching.UsageVector.MergeChildren):
7122         A `finally' block never returns or breaks; improved handling of
7123         unreachable code.
7124
7125 2002-08-23  Martin Baulig  <martin@gnome.org>
7126
7127         * statement.cs (Throw.Resolve): Allow `throw null'.
7128
7129 2002-08-23  Martin Baulig  <martin@gnome.org>
7130
7131         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
7132         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
7133         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
7134         MemberLookup would return a wrong event if this is an explicit
7135         interface implementation and the class has an event with the same
7136         name.
7137
7138 2002-08-23  Martin Baulig  <martin@gnome.org>
7139
7140         * statement.cs (Block.AddChildVariableNames): New public method.
7141         (Block.AddChildVariableName): Likewise.
7142         (Block.IsVariableNameUsedInChildBlock): Likewise.
7143         (Block.AddVariable): Check whether a variable name has already
7144         been used in a child block.
7145
7146         * cs-parser.jay (declare_local_variables): Mark all variable names
7147         from the current block as being used in a child block in the
7148         implicit block.
7149
7150 2002-08-23  Martin Baulig  <martin@gnome.org>
7151
7152         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
7153         find the symbol writer.
7154
7155         * driver.cs: csc also allows the arguments to /define being
7156         separated by commas, not only by semicolons.
7157
7158 2002-08-23  Martin Baulig  <martin@gnome.org>
7159
7160         * interface.cs (Interface.GetMembers): Added static check for events.
7161
7162 2002-08-15  Martin Baulig  <martin@gnome.org>
7163
7164         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
7165         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
7166
7167         * ecore.cs (Expression.MemberLookup): Added documentation and explained
7168         why the MethodData.EmitDestructor() change was necessary.
7169
7170 2002-08-20  Martin Baulig  <martin@gnome.org>
7171
7172         * class.cs (TypeContainer.FindMembers): Added static check for events.
7173
7174         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
7175
7176         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
7177         use Type.GetEvents(), not Type.FindMembers().
7178
7179 2002-08-20  Martin Baulig  <martin@gnome.org>
7180
7181         * decl.cs (MemberCache): Added a special method cache which will
7182         be used for method-only searched.  This ensures that a method
7183         search will return a MethodInfo with the correct ReflectedType for
7184         inherited methods.      
7185
7186 2002-08-20  Martin Baulig  <martin@gnome.org>
7187
7188         * decl.cs (DeclSpace.FindMembers): Made this public.
7189
7190 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7191
7192         * delegate.cs: fixed build on windows.
7193         [FIXME:  Filed as bug #29150: MCS must report these errors.]
7194
7195 2002-08-19  Ravi Pratap  <ravi@ximian.com>
7196
7197         * ecore.cs (StandardConversionExists): Return a false
7198         if we are trying to convert the void type to anything else
7199         since that is not allowed.
7200
7201         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
7202         we flag error 70 in the event an event is trying to be accessed
7203         directly from outside the declaring type.
7204
7205 2002-08-20  Martin Baulig  <martin@gnome.org>
7206
7207         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
7208         MemberCache from typemanager.cs to decl.cs.
7209
7210 2002-08-19  Martin Baulig  <martin@gnome.org>
7211
7212         * class.cs (TypeContainer): Implement IMemberContainer.
7213         (TypeContainer.DefineMembers): Create the MemberCache.
7214         (TypeContainer.FindMembers): Do better BindingFlags checking; only
7215         return public members if BindingFlags.Public was given, check
7216         whether members are static.
7217
7218 2002-08-16  Martin Baulig  <martin@gnome.org>
7219
7220         * decl.cs (DeclSpace.Define): Splitted this in Define and
7221         DefineMembers.  DefineMembers is called first and initializes the
7222         MemberCache.
7223
7224         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
7225         DefineMembers() on all our DeclSpaces.
7226
7227         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
7228         but call DefineMembers() on all nested interfaces.  We call their
7229         Define() in our new Define() function.
7230
7231         * interface.cs (Interface): Implement IMemberContainer.
7232         (Interface.Define): Moved all code except the attribute stuf to
7233         DefineMembers().
7234         (Interface.DefineMembers): Initialize the member cache.
7235
7236         * typemanager.cs (IMemberFinder): Removed this interface, we don't
7237         need this anymore since we can use MemberCache.FindMembers directly.
7238
7239 2002-08-19  Martin Baulig  <martin@gnome.org>
7240
7241         * typemanager.cs (MemberCache): When creating the cache for an
7242         interface type, add all inherited members.
7243         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
7244         to `out bool used_cache' and documented it.
7245         (TypeManager.MemberLookup): If we already used the cache in the first
7246         iteration, we don't need to do the interfaces check.
7247
7248 2002-08-19  Martin Baulig  <martin@gnome.org>
7249
7250         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
7251         here from IMemberFinder and don't implement this interface anymore.
7252         (DeclSpace.MemberCache): Moved here from IMemberFinder.
7253
7254         * typemanager.cs (IMemberFinder): This interface is now only used by
7255         classes which actually support the member cache.
7256         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
7257         since we only put DeclSpaces into this Hashtable.
7258         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
7259         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
7260
7261 2002-08-16  Martin Baulig  <martin@gnome.org>
7262
7263         * typemanager.cs (ICachingMemberFinder): Removed.
7264         (IMemberFinder.MemberCache): New property.
7265         (TypeManager.FindMembers): Merged this with RealFindMembers().
7266         This function will never be called from TypeManager.MemberLookup()
7267         so we can't use the cache here, just the IMemberFinder.
7268         (TypeManager.MemberLookup_FindMembers): Check whether the
7269         IMemberFinder has a MemberCache and call the cache's FindMembers
7270         function.
7271         (MemberCache): Rewrote larger parts of this yet another time and
7272         cleaned it up a bit.
7273
7274 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
7275
7276         * driver.cs (LoadArgs): Support quoting.
7277
7278         (Usage): Show the CSC-like command line arguments.
7279
7280         Improved a few error messages.
7281
7282 2002-08-15  Martin Baulig  <martin@gnome.org>
7283
7284         * typemanager.cs (IMemberContainer.Type): New property.
7285         (IMemberContainer.IsInterface): New property.
7286
7287         The following changes are conditional to BROKEN_RUNTIME, which is
7288         defined at the top of the file.
7289
7290         * typemanager.cs (MemberCache.MemberCache): Don't add the base
7291         class'es members, but add all members from TypeHandle.ObjectType
7292         if we're an interface.
7293         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
7294         is the current type.
7295         (MemberCache.CacheEntry.Container): Removed this field.
7296         (TypeHandle.GetMembers): Include inherited members.
7297
7298 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7299
7300         * typemanager.cs: fixed compilation and added a comment on a field that
7301         is never used.
7302
7303 2002-08-15  Martin Baulig  <martin@gnome.org>
7304
7305         * class.cs (ConstructorInitializer.Resolve): In the
7306         Expression.MemberLookup call, use the queried_type as
7307         invocation_type.
7308
7309         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
7310         declared' attribute, it's always true.
7311         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
7312         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
7313         temporary wrapper for FindMembers which tells MemberLookup whether
7314         members from the base classes are included in the return value.
7315         This will go away soon.
7316         (TypeManager.MemberLookup): Use this temporary hack here; once the
7317         new MemberCache is completed, we don't need to do the DeclaredOnly
7318         looping here anymore since the MemberCache will take care of this.
7319         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
7320         (MemberCache): When creating the MemberCache for a class, get
7321         members from the current class and all its base classes.
7322         (MemberCache.CacheEntry.Container): New field.  This is a
7323         temporary hack until the Mono runtime is fixed to distinguish
7324         between ReflectedType and DeclaringType.  It allows us to use MCS
7325         with both the MS runtime and the unfixed Mono runtime without
7326         problems and without accecting performance.
7327         (MemberCache.SearchMembers): The DeclaredOnly looping from
7328         TypeManager.MemberLookup is now done here.      
7329
7330 2002-08-14  Martin Baulig  <martin@gnome.org>
7331
7332         * statement.cs (MyStructInfo.MyStructInfo): Don't call
7333         Type.GetFields on dynamic types but get the fields from the
7334         corresponding TypeContainer.
7335         (MyStructInfo.GetStructInfo): Added check for enum types.
7336
7337         * typemanager.cs (MemberList.IsSynchronized): Implemented.
7338         (MemberList.SyncRoot): Implemented.
7339         (TypeManager.FilterWithClosure): No need to check permissions if
7340         closure_start_type == closure_invocation_type, don't crash if
7341         closure_invocation_type is null.
7342
7343 2002-08-13  Martin Baulig  <martin@gnome.org>
7344
7345         Rewrote TypeContainer.FindMembers to use a member cache.  This
7346         gives us a speed increase of about 35% for the self-hosting MCS
7347         build and of about 15-20% for the class libs (both on GNU/Linux).
7348
7349         * report.cs (Timer): New class to get enhanced profiling.  This
7350         whole class is "TIMER" conditional since it remarkably slows down
7351         compilation speed.
7352
7353         * class.cs (MemberList): New class.  This is an IList wrapper
7354         which we're now using instead of passing MemberInfo[]'s around to
7355         avoid copying this array unnecessarily.
7356         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
7357         (ICachingMemberFinder, IMemberContainer): New interface.
7358         (TypeManager.FilterWithClosure): If `criteria' is null, the name
7359         has already been checked, otherwise use it for the name comparision.
7360         (TypeManager.FindMembers): Renamed to RealMemberFinder and
7361         provided wrapper which tries to use ICachingMemberFinder.FindMembers
7362         if possible.  Returns a MemberList, not a MemberInfo [].
7363         (TypeHandle): New class, implements IMemberContainer.  We create
7364         one instance of this class per type, it contains a MemberCache
7365         which is used to do the member lookups.
7366         (MemberCache): New class.  Each instance of this class contains
7367         all members of a type and a name-based hash table.
7368         (MemberCache.FindMembers): This is our new member lookup
7369         function.  First, it looks up all members of the requested name in
7370         the hash table.  Then, it walks this list and sorts out all
7371         applicable members and returns them.
7372
7373 2002-08-13  Martin Baulig  <martin@gnome.org>
7374
7375         In addition to a nice code cleanup, this gives us a performance
7376         increase of about 1.4% on GNU/Linux - not much, but it's already
7377         half a second for the self-hosting MCS compilation.
7378
7379         * typemanager.cs (IMemberFinder): New interface.  It is used by
7380         TypeManager.FindMembers to call FindMembers on a TypeContainer,
7381         Enum, Delegate or Interface.
7382         (TypeManager.finder_to_member_finder): New PtrHashtable.
7383         (TypeManager.finder_to_container): Removed.
7384         (TypeManager.finder_to_delegate): Removed.
7385         (TypeManager.finder_to_interface): Removed.
7386         (TypeManager.finder_to_enum): Removed.
7387
7388         * interface.cs (Interface): Implement IMemberFinder.
7389
7390         * delegate.cs (Delegate): Implement IMemberFinder.
7391
7392         * enum.cs (Enum): Implement IMemberFinder.
7393
7394         * class.cs (TypeContainer): Implement IMemberFinder.
7395
7396 2002-08-12  Martin Baulig  <martin@gnome.org>
7397
7398         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
7399
7400 2002-08-12  Martin Baulig  <martin@gnome.org>
7401
7402         * ecore.cs (ITypeExpression): New interface for expressions which
7403         resolve to a type.
7404         (TypeExpression): Renamed to TypeLookupExpression.
7405         (Expression.DoResolve): If we're doing a types-only lookup, the
7406         expression must implement the ITypeExpression interface and we
7407         call DoResolveType() on it.
7408         (SimpleName): Implement the new ITypeExpression interface.
7409         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
7410         hack, the situation that we're only looking up types can't happen
7411         anymore when this method is called.  Moved the type lookup code to
7412         DoResolveType() and call it.
7413         (SimpleName.DoResolveType): This ITypeExpression interface method
7414         is now doing the types-only lookup.
7415         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
7416         (ResolveFlags): Added MaskExprClass.
7417
7418         * expression.cs (MemberAccess): Implement the ITypeExpression
7419         interface.
7420         (MemberAccess.DoResolve): Added support for a types-only lookup
7421         when we're called via ITypeExpression.DoResolveType().
7422         (ComposedCast): Implement the ITypeExpression interface.
7423
7424         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
7425         Expression.Resolve() with ResolveFlags.Type instead.
7426
7427 2002-08-12  Martin Baulig  <martin@gnome.org>
7428
7429         * interface.cs (Interface.Define): Apply attributes.
7430
7431         * attribute.cs (Attribute.ApplyAttributes): Added support for
7432         interface attributes.
7433
7434 2002-08-11  Martin Baulig  <martin@gnome.org>
7435
7436         * statement.cs (Block.Emit): Only check the "this" variable if we
7437         do not always throw an exception.
7438
7439         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
7440         whether the property has a set accessor.
7441
7442 2002-08-11  Martin Baulig  <martin@gnome.org>
7443
7444         Added control flow analysis support for structs.
7445
7446         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
7447         with control flow analysis turned off.
7448         (IVariable): New interface.
7449         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
7450         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
7451         (FieldExpr.DoResolve): Resolve the instance expression with flow
7452         analysis turned off and do the definite assignment check after the
7453         resolving when we know what the expression will resolve to.
7454
7455         * expression.cs (LocalVariableReference, ParameterReference):
7456         Implement the new IVariable interface, only call the flow analysis
7457         code if ec.DoFlowAnalysis is true.
7458         (This): Added constructor which takes a Block argument.  Implement
7459         the new IVariable interface.
7460         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
7461         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
7462         This does the definite assignment checks for struct members.
7463
7464         * class.cs (Constructor.Emit): If this is a non-static `struct'
7465         constructor which doesn't have any initializer, call
7466         Block.AddThisVariable() to tell the flow analysis code that all
7467         struct elements must be initialized before control returns from
7468         the constructor.
7469
7470         * statement.cs (MyStructInfo): New public class.
7471         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
7472         argument to this indexer.  If non-zero, check an individual struct
7473         member, not the whole struct.
7474         (FlowBranching.CheckOutParameters): Check struct members.
7475         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
7476         overloaded versions of these methods which take an additional
7477         `int field_idx' argument to check struct members.
7478         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
7479         overloaded versions of these methods which take an additional
7480         `string field_name' argument to check struct member.s
7481         (VariableInfo): Implement the IVariable interface.
7482         (VariableInfo.StructInfo): New public property.  Returns the
7483         MyStructInfo instance of the variable if it's a struct or null.
7484         (Block.AddThisVariable): New public method.  This is called from
7485         Constructor.Emit() for non-static `struct' constructor which do
7486         not have any initializer.  It creates a special variable for the
7487         "this" instance variable which will be checked by the flow
7488         analysis code to ensure that all of the struct's fields are
7489         initialized before control returns from the constructor.
7490         (UsageVector): Added support for struct members.  If a
7491         variable/parameter is a struct with N members, we reserve a slot
7492         in the usage vector for each member.  A struct is considered fully
7493         initialized if either the struct itself (slot 0) or all its
7494         members are initialized.
7495
7496 2002-08-08  Martin Baulig  <martin@gnome.org>
7497
7498         * driver.cs (Driver.MainDriver): Only report an error CS5001
7499         if there were no compilation errors.
7500
7501         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
7502         `UnsafeContext' property to determine whether the parent is in
7503         unsafe context rather than checking the parent's ModFlags:
7504         classes nested in an unsafe class are unsafe as well.
7505
7506 2002-08-08  Martin Baulig  <martin@gnome.org>
7507
7508         * statement.cs (UsageVector.MergeChildren): Distinguish between
7509         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
7510         we return.  Added test17() and test18() to test-154.cs.
7511
7512 2002-08-08  Martin Baulig  <martin@gnome.org>
7513
7514         * typemanager.cs (TypeManager.FilterWithClosure): If we have
7515         Family access, make sure the invoking type isn't a subclass of the
7516         queried type (that'd be a CS1540).
7517
7518         * ecore.cs (Expression.MemberLookup): Added overloaded version of
7519         this method which takes an additional `Type invocation_type'.
7520
7521         * expression.cs (BaseAccess.DoResolve): Use the base type as
7522         invocation and query type.
7523         (MemberAccess.DoResolve): If the lookup failed and we're about to
7524         report a CS0122, try a lookup with the ec.ContainerType - if this
7525         succeeds, we must report a CS1540.
7526
7527 2002-08-08  Martin Baulig  <martin@gnome.org>
7528
7529         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
7530         (MethodGroupExpr): Implement the IMemberExpr interface.
7531
7532         * expression (MemberAccess.ResolveMemberAccess): No need to have
7533         any special code for MethodGroupExprs anymore, they're now
7534         IMemberExprs.   
7535
7536 2002-08-08  Martin Baulig  <martin@gnome.org>
7537
7538         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
7539         Family, FamANDAssem and FamORAssem permissions.
7540         (TypeManager.IsSubclassOrNestedChildOf): New public method.
7541
7542 2002-08-08  Martin Baulig  <martin@gnome.org>
7543
7544         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
7545         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
7546         or loop block.
7547
7548 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
7549
7550         * driver.cs: implemented /resource option to embed managed resources.
7551
7552 2002-08-07  Martin Baulig  <martin@gnome.org>
7553
7554         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
7555         (FieldBase.HasFieldInitializer): New public property.
7556         (FieldBase.GetInitializerExpression): New public method.  Resolves and
7557         returns the field initializer and makes sure it is only resolved once.
7558         (TypeContainer.EmitFieldInitializers): Call
7559         FieldBase.GetInitializerExpression to get the initializer, this ensures
7560         that it isn't resolved multiple times.
7561
7562         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
7563         the resolving process (SimpleName/MemberLookup) that we're currently
7564         emitting a field initializer (which must not access any instance members,
7565         this is an error CS0236).
7566
7567         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
7568         argument, if the `IsFieldInitializer' flag is set, we must report and
7569         error CS0236 and not an error CS0120.   
7570
7571 2002-08-07  Martin Baulig  <martin@gnome.org>
7572
7573         * ecore.cs (IMemberExpr): New public interface.
7574         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
7575         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
7576         if the expression is an IMemberExpr.
7577
7578         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
7579         to be null, implicitly default to `this' if we're non-static in
7580         this case.  Simplified the code a lot by using the new IMemberExpr
7581         interface.  Also fixed bug #28176 here.
7582
7583 2002-08-06  Martin Baulig  <martin@gnome.org>
7584
7585         * cs-parser.jay (SimpleLookup): Removed.  We need to create
7586         ParameterReferences during semantic analysis so that we can do a
7587         type-only search when resolving Cast, TypeOf and SizeOf.
7588         (block): Pass the `current_local_parameters' to the Block's
7589         constructor.
7590
7591         * class.cs (ConstructorInitializer): Added `Parameters parameters'
7592         argument to the constructor.
7593         (ConstructorInitializer.Resolve): Create a temporary implicit
7594         block with the parameters.
7595
7596         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
7597         references here if we aren't doing a type-only search.
7598
7599         * statement.cs (Block): Added constructor which takes a
7600         `Parameters parameters' argument.
7601         (Block.Parameters): New public property.
7602
7603         * support.cs (InternalParameters.Parameters): Renamed `parameters'
7604         to `Parameters' and made it public readonly.
7605
7606 2002-08-06  Martin Baulig  <martin@gnome.org>
7607
7608         * ecore.cs (Expression.Warning): Made this public as well.
7609
7610         * report.cs (Report.Debug): Print the contents of collections.
7611
7612 2002-08-06  Martin Baulig  <martin@gnome.org>
7613
7614         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
7615         used to tell Resolve() which kinds of expressions it may return.
7616         (Expression.Resolve): Added overloaded version of this method which
7617         takes a `ResolveFlags flags' argument.  This can be used to tell
7618         Resolve() which kinds of expressions it may return.  Reports a
7619         CS0118 on error.
7620         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
7621         ResolveFlags.SimpleName.
7622         (Expression.Error118): Added overloaded version of this method which
7623         takes a `ResolveFlags flags' argument.  It uses the flags to determine
7624         which kinds of expressions are allowed.
7625
7626         * expression.cs (Argument.ResolveMethodGroup): New public method.
7627         Resolves an argument, but allows a MethodGroup to be returned.
7628         This is used when invoking a delegate.
7629
7630         * TODO: Updated a bit.
7631
7632 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7633
7634         Fixed compilation with csc.
7635
7636         * ecore.cs: Expression.Error made public. Is this correct? Should
7637         Warning be made public too?
7638
7639         * expression.cs: use ea.Location instead of ea.loc.
7640         [FIXME:  Filed as bug #28607: MCS must report these errors.]
7641
7642 2002-08-06  Martin Baulig  <martin@gnome.org>
7643
7644         * ecore.cs (Expression.loc): Moved the location here instead of
7645         duplicating it in all derived classes.
7646         (Expression.Location): New public property.
7647         (Expression.Error, Expression.Warning): Made them non-static and
7648         removed the location argument.
7649         (Expression.Warning): Added overloaded version which takes an
7650         `int level' argument.
7651         (Expression.Error118): Make this non-static and removed the
7652         expression and location arguments.
7653         (TypeExpr): Added location argument to the constructor.
7654
7655         * expression.cs (StaticCallExpr): Added location argument to
7656         the constructor.
7657         (Indirection, PointerArithmetic): Likewise.
7658         (CheckedExpr, UnCheckedExpr): Likewise.
7659         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
7660         (StringPtr): Likewise.
7661
7662
7663 2002-08-05  Martin Baulig  <martin@gnome.org>
7664
7665         * expression.cs (BaseAccess.DoResolve): Actually report errors.
7666
7667         * assign.cs (Assign.DoResolve): Check whether the source
7668         expression is a value or variable.
7669
7670         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
7671         while resolving the corresponding blocks.
7672
7673         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
7674         an error, don't silently return null.
7675
7676         * statement.cs (Block.AddVariable): Do the error reporting here
7677         and distinguish between CS0128 and CS0136.
7678         (Block.DoResolve): Report all unused labels (warning CS0164).
7679         (LabeledStatement): Pass the location to the constructor.
7680         (LabeledStatement.HasBeenReferenced): New property.
7681         (LabeledStatement.Resolve): Set it to true here.
7682
7683         * statement.cs (Return.Emit): Return success even after reporting
7684         a type mismatch error (CS0126 or CS0127), this is what csc does and
7685         it avoids confusing the users with any consecutive errors.
7686
7687 2002-08-05  Martin Baulig  <martin@gnome.org>
7688
7689         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
7690
7691         * const.cs (Const.LookupConstantValue): Catch circular definitions.
7692
7693         * expression.cs (MemberAccess.DoResolve): Silently return if an
7694         error has already been reported.
7695
7696         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
7697         error has already been reported.
7698
7699 2002-08-05  Martin Baulig  <martin@gnome.org>
7700
7701         * statement.cs (UsageVector): Only initialize the `parameters'
7702         vector if we actually have any "out" parameters.
7703
7704 2002-08-05  Martin Baulig  <martin@gnome.org>
7705
7706         * expression.cs (Binary.ResolveOperator): When combining delegates,
7707         they must have the same type.
7708
7709 2002-08-05  Martin Baulig  <martin@gnome.org>
7710
7711         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
7712         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
7713         work with the ms runtime and we also don't need it: if we're a
7714         PropertyBuilder and not in the `indexer_arguments' hash, then we
7715         are a property and not an indexer.
7716
7717         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
7718         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
7719         since the latter one doesn't work with the ms runtime.
7720
7721 2002-08-03  Martin Baulig  <martin@gnome.org>
7722
7723         Fixed bugs #27998 and #22735.
7724
7725         * class.cs (Method.IsOperator): New public field.
7726         (Method.CheckBase): Report CS0111 if there's already a method
7727         with the same parameters in the current class.  Report CS0508 when
7728         attempting to change the return type of an inherited method.
7729         (MethodData.Emit): Report CS0179 if a method doesn't have a body
7730         and it's not marked abstract or extern.
7731         (PropertyBase): New abstract base class for Property and Indexer.
7732         (PropertyBase.CheckBase): Moved here from Property and made it work
7733         for indexers.
7734         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
7735         the same so we can reuse it there.
7736         (Property, Indexer): Derive from PropertyBase.
7737         (MethodSignature.inheritable_property_signature_filter): New delegate
7738         to find properties and indexers.
7739
7740         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
7741         argument and improved error reporting.
7742
7743         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
7744         EmptyReadOnlyParameters and made it a property.
7745
7746         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
7747         version of this method which takes a `PropertyInfo indexer'.
7748         (TypeManager.RegisterIndexer): New method.
7749
7750         * class.cs: Added myself as author of this file :-)
7751
7752 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7753
7754         * class.cs: fixed compilation on windoze.
7755
7756 2002-08-03  Martin Baulig  <martin@gnome.org>
7757
7758         * interface.cs (Interface.GetInterfaceBases): Check whether all
7759         base interfaces are at least as accessible than the current one.
7760
7761         * class.cs (TypeContainer.GetClassBases): Check whether base types
7762         are at least as accessible than the current type.
7763         (TypeContainer.AsAccessible): Implemented and made non-static.
7764         (MemberBase.CheckParameters): Report errors if the accessibility
7765         checks fail.
7766
7767         * delegate.cs (Delegate.Delegate): The default visibility is
7768         internal for top-level types and private for nested types.
7769         (Delegate.Define): Report errors if the accessibility checks fail.
7770
7771         * enum.cs (Enum.Enum): The default visibility is internal for
7772         top-level types and private for nested types.
7773         (Enum.DefineType): Compute the correct visibility.
7774
7775         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
7776         function which takes a `bool is_toplevel' instead of a TypeContainer.
7777
7778         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
7779         builtin type.
7780
7781 2002-08-02  Martin Baulig  <martin@gnome.org>
7782
7783         * expression.cs (LocalVariableReferenc): Added constructor which
7784         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
7785         (LocalVariableReference.IsReadOnly): New property.
7786         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
7787         variable is readonly, use our own readonly flag to do this; you can
7788         use the new constructor to get a writable reference to a read-only
7789         variable.
7790
7791         * cs-parser.jay (foreach_statement, using_statement): Get a writable
7792         reference to the local variable.
7793
7794 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
7795
7796         * rootcontext.cs (ResolveCore): Also include System.Exception
7797
7798         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
7799         we reach an EmptyStatement.
7800
7801         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
7802         is also fine.
7803
7804         * expression.cs (Binary.ResolveOperator): Check error result in
7805         two places.
7806
7807         use brtrue/brfalse directly and avoid compares to null.
7808
7809 2002-08-02  Martin Baulig  <martin@gnome.org>
7810
7811         * class.cs (TypeContainer.Define): Define all nested interfaces here.
7812         Fixes bug #28407, added test-155.cs.
7813
7814 2002-08-01  Martin Baulig  <martin@gnome.org>
7815
7816         * class.cs (Event.EmitDefaultMethod): Make this work with static
7817         events.  Fixes #28311, added verify-3.cs.
7818
7819 2002-08-01  Martin Baulig  <martin@gnome.org>
7820
7821         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
7822         `is_disposable' fields.
7823         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
7824         `hm.is_disposable' if we're using the collection pattern.
7825         (Foreach.EmitCollectionForeach): Use the correct type for the
7826         enumerator's local variable, only emit the try/finally block if
7827         necessary (fixes #27713).
7828
7829 2002-08-01  Martin Baulig  <martin@gnome.org>
7830
7831         * ecore.cs (Expression.report118): Renamed to Error118 and made
7832         it public static.
7833
7834         * statement.cs (Throw.Resolve): Check whether the expression is of
7835         the correct type (CS0118) and whether the type derives from
7836         System.Exception (CS0155).
7837         (Catch.Resolve): New method.  Do the type lookup here and check
7838         whether it derives from System.Exception (CS0155).
7839         (Catch.CatchType, Catch.IsGeneral): New public properties.
7840
7841         * typemanager.cs (TypeManager.exception_type): Added.
7842
7843 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
7844
7845         * driver.cs: Updated About function.
7846
7847 2002-07-31  Martin Baulig  <martin@gnome.org>
7848
7849         Implemented Control Flow Analysis.
7850
7851         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
7852         (EmitContext.CurrentBranching): Added.
7853         (EmitContext.StartFlowBranching): Added.
7854         (EmitContext.EndFlowBranching): Added.
7855         (EmitContext.KillFlowBranching): Added.
7856         (EmitContext.IsVariableAssigned): Added.
7857         (EmitContext.SetVariableAssigned): Added.
7858         (EmitContext.IsParameterAssigned): Added.
7859         (EmitContext.SetParameterAssigned): Added.
7860         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
7861         Added control flow analysis stuff here.
7862
7863         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
7864         resolve the expression as lvalue.
7865         (LocalVariableReference.DoResolve): Check whether the variable has
7866         already been assigned.
7867         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
7868         the parameter as assigned here.
7869         (ParameterReference.DoResolve): Check whether the parameter has already
7870         been assigned.
7871         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
7872         expression as lvalue.
7873
7874         * statement.cs (FlowBranching): New class for the flow analysis code.
7875         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
7876         (LabeledStatement.IsDefined): New public property.
7877         (LabeledStatement.AddUsageVector): New public method to tell flow
7878         analyis that the label may be reached via a forward jump.
7879         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
7880         flow analysis.
7881         (VariableInfo.Number): New public field.  This is used by flow analysis
7882         to number all locals of a block.
7883         (Block.CountVariables): New public property.  This is the number of
7884         local variables in this block (including the locals from all parent
7885         blocks).
7886         (Block.EmitMeta): Number all the variables.
7887
7888         * statement.cs: Added flow analysis support to all classes.
7889
7890 2002-07-31  Martin Baulig  <martin@gnome.org>
7891
7892         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
7893         To get debugging messages, compile mcs with /define:MCS_DEBUG and
7894         then use this argument.
7895
7896         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
7897
7898         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
7899         use this to specify /define options.
7900
7901 2002-07-29  Martin Baulig  <martin@gnome.org>
7902
7903         * statement.cs (Fixed): Moved all code that does variable lookups
7904         and resolvings from Emit to Resolve.
7905
7906         * statement.cs (For): Moved all code that does variable lookups
7907         and resolvings from Emit to Resolve.
7908
7909         * statement.cs (Using): Moved all code that does variable lookups
7910         and resolvings from Emit to Resolve.
7911
7912 2002-07-29  Martin Baulig  <martin@gnome.org>
7913
7914         * attribute.cs (Attribute.Resolve): Explicitly catch a
7915         System.NullReferenceException when creating the
7916         CustromAttributeBuilder and report a different warning message.
7917
7918 2002-07-29  Martin Baulig  <martin@gnome.org>
7919
7920         * support.cs (ParameterData.ParameterName): Added method to
7921         get the name of a parameter.
7922
7923         * typemanager.cs (TypeManager.IsValueType): New public method.
7924
7925 2002-07-29  Martin Baulig  <martin@gnome.org>
7926
7927         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
7928         is a flag which specifies that it's either ref or out.
7929         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
7930         the out parameter to `out Parameter.Modifier mod', also set the
7931         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
7932
7933         * support.cs (InternalParameters.ParameterModifier): Distinguish
7934         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
7935         Parameter.Modifier.ISBYREF flag if it's either ref or out.
7936
7937         * expression.cs (Argument.GetParameterModifier): Distinguish
7938         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
7939         Parameter.Modifier.ISBYREF flag if it's either ref or out.
7940
7941 2002-07-29  Martin Baulig  <martin@gnome.org>
7942
7943         * expression.cs (ParameterReference.ParameterReference): Added
7944         `Location loc' argument to the constructor.
7945
7946         * cs-parser.jay: Pass location to ParameterReference.
7947
7948 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
7949
7950         * statement.cs (Try): Initialize the location.
7951
7952         * cs-parser.jay: pass location to Try.
7953
7954         * expression.cs (Unary.Reduce): Change the prototype to return
7955         whether a constant fold could be performed or not.  The result is
7956         returned in an out parameters.  In the case of Indirection and
7957         AddressOf, we want to perform the full tests.
7958
7959 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
7960
7961         * statement.cs (Statement.Emit): Flag dead code.
7962
7963 2002-07-27  Andrew Birkett  <andy@nobugs.org>
7964
7965         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
7966
7967 2002-07-27  Martin Baulig  <martin@gnome.org>
7968
7969         * class.cs (MethodData.Define): Put back call to
7970         TypeManager.AddMethod(), accidentally commented this out.
7971
7972         * report.cs (Debug): New public method to print debugging information,
7973         this is `[Conditional ("DEBUG")]'.
7974
7975 2002-07-26  Martin Baulig  <martin@gnome.org>
7976
7977         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
7978         (switch_statement): Push the current_block to the switch_stack and
7979         pop it again when we're done with the switch.
7980         (switch_section): The new block is a child of the current_block.
7981         Fixes bug #24007, added test-152.cs.
7982
7983 2002-07-27  Martin Baulig  <martin@gnome.org>
7984
7985         * expression.cs (Invocation.EmitArguments): When calling a varargs
7986         function with only its fixed arguments, we need to pass an empty
7987         array.
7988
7989 2002-07-27  Martin Baulig  <martin@gnome.org>
7990
7991         Mono 0.13 has been released.
7992
7993 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
7994
7995         * driver.cs: Rename --resource to --linkres, because that is what
7996         we do currently, we dont support --resource yet.
7997
7998         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
7999
8000 2002-07-25  Martin Baulig  <martin@gnome.org>
8001
8002         * class.cs (MethodData): New public class.  This is a `method builder'
8003         class for a method or one accessor of a Property/Indexer/Event.
8004         (MethodData.GetMethodFlags): Moved here from MemberBase.
8005         (MethodData.ApplyAttributes): Likewise.
8006         (MethodData.ApplyObsoleteAttribute): Likewise.
8007         (MethodData.ApplyConditionalAttribute): Likewise.
8008         (MethodData.ApplyDllImportAttribute): Likewise.
8009         (MethodData.CheckAbstractAndExternal): Likewise.
8010         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
8011         (MethodData.Emit): Formerly known as Method.Emit().
8012         (MemberBase): Moved everything which was specific to a single
8013         accessor/method to MethodData.
8014         (Method): Create a new MethodData and call Define() and Emit() on it.
8015         (Property, Indexer, Event): Create a new MethodData objects for each
8016         accessor and call Define() and Emit() on them.
8017
8018 2002-07-25  Martin Baulig  <martin@gnome.org>
8019
8020         Made MethodCore derive from MemberBase to reuse the code from there.
8021         MemberBase now also checks for attributes.
8022
8023         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
8024         (MemberBase.GetMethodFlags): Moved here from class Method and marked
8025         as virtual.
8026         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
8027         `CallingConventions cc' and `Attributes opt_attrs' arguments.
8028         (MemberBase.ApplyAttributes): New virtual method; applies the
8029         attributes to a method or accessor.
8030         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
8031         (MemberBase.ApplyConditionalAttribute): Likewise.
8032         (MemberBase.ApplyDllImportAttribute): Likewise.
8033         (MemberBase.CheckAbstractAndExternal): Likewise.
8034         (MethodCore.ParameterTypes): This is now a property instead of a
8035         method, it's initialized from DoDefineParameters().
8036         (MethodCore.ParameterInfo): Removed the set accessor.
8037         (MethodCore.DoDefineParameters): New protected virtual method to
8038         initialize ParameterTypes and ParameterInfo.
8039         (Method.GetReturnType): We can now simply return the MemberType.
8040         (Method.GetMethodFlags): Override the MemberBase version and add
8041         the conditional flags.
8042         (Method.CheckBase): Moved some code from Define() here, call
8043         DoDefineParameters() here.
8044         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
8045         here to avoid some larger code duplication.
8046         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
8047         ensure that abstract and external accessors don't declare a body.
8048
8049         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
8050         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
8051         lookup in the attribute's parent classes, so we need to abort as soon
8052         as we found the first match.
8053         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
8054         the attribute has no arguments.
8055
8056         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
8057         of a Method.
8058
8059 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8060
8061         * cs-parser.jay: reverted previous patch.
8062
8063 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8064
8065         * cs-parser.jay: fixed bug #22119.
8066
8067 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8068
8069         * attribute.cs: fixed compilation. The error was:
8070         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
8071         be assigned to before control leaves the current method."
8072         [FIXME:  Filed as bug #28186: MCS must report this error.]
8073
8074 2002-07-25  Martin Baulig  <martin@gnome.org>
8075
8076         * attribute.cs (Attribute.Conditional_GetConditionName): New static
8077         method to pull the condition name ouf of a Conditional attribute.
8078         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
8079         the obsolete message and error flag out of an Obsolete attribute.
8080
8081         * class.cs (Method.GetMethodFlags): New public method to get the
8082         TypeManager.MethodFlags for this method.
8083         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
8084         private methods.
8085         (Method.Define): Get and apply the Obsolete and Conditional attributes;
8086         if we're overriding a virtual function, set the new private variable
8087         `parent_method'; call the new TypeManager.AddMethod().
8088
8089         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
8090         the MethodBuilder and the Method in a PtrHashtable.
8091         (TypeManager.builder_to_method): Added for this purpose.
8092         (TypeManager.MethodFlags): Added IsObsoleteError.
8093         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
8094         Obsolete and Conditional arguments in MethodBuilders.  If we discover
8095         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
8096         the message from the attribute.
8097
8098 2002-07-24  Martin Baulig  <martin@gnome.org>
8099
8100         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
8101         preprocessor directives, ensure that the argument to #define/#undef is
8102         exactly one identifier and that it's actually an identifier.
8103
8104         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
8105         did not work ....
8106
8107 2002-07-24  Martin Baulig  <martin@gnome.org>
8108
8109         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
8110         initialize it to TypeManager.object_type in the constructor.
8111         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
8112         of the `hm.get_current' method if we're using the collection pattern.
8113         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
8114         for the explicit conversion to make it work when we're using the collection
8115         pattern and the `Current' property has a different return type than `object'.
8116         Fixes #27713.
8117
8118 2002-07-24  Martin Baulig  <martin@gnome.org>
8119
8120         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
8121         does not match, but don't report any errors.  This method is called in
8122         order for all methods in a MethodGroupExpr until a matching method is
8123         found, so we don't want to bail out if the first method doesn't match.
8124         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
8125         matches, report the 123.  Fixes #28070.
8126
8127 2002-07-24  Martin Baulig  <martin@gnome.org>
8128
8129         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
8130         TypeManager.TypeToCoreType() to the top of the method so the
8131         following equality checks will work.  Fixes #28107.
8132
8133 2002-07-24  Martin Baulig  <martin@gnome.org>
8134
8135         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
8136         operand is of type uint, and the other operand is of type sbyte,
8137         short or int, the operands are converted to type long." -
8138         Actually do what this comment already told us.  Fixes bug #28106,
8139         added test-150.cs.
8140
8141 2002-07-24  Martin Baulig  <martin@gnome.org>
8142
8143         * class.cs (MethodBase): New abstract class.  This is now a base
8144         class for Property, Indexer and Event to avoid some code duplication
8145         in their Define() and DefineMethods() methods.
8146         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
8147         generic methods for Define() and DefineMethods().
8148         (FieldBase): Derive from MemberBase, not MemberCore.
8149         (Property): Derive from MemberBase, not MemberCore.
8150         (Property.DefineMethod): Moved all the code from this method to the
8151         new MethodBase.DefineAccessor(), just call it with appropriate
8152         argumetnts.
8153         (Property.Define): Call the new Property.DoDefine(), this does some
8154         sanity checks and we don't need to duplicate the code everywhere.
8155         (Event): Derive from MemberBase, not MemberCore.
8156         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
8157         accessors, this will also make them work with interface events.
8158         (Indexer): Derive from MemberBase, not MemberCore.
8159         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
8160         (Indexer.Define): Use the new MethodBase functions.
8161
8162         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
8163         argument to the constructor.
8164         (Interface.FindMembers): Added support for interface events.
8165         (Interface.PopluateEvent): Implemented.
8166
8167         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
8168
8169 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
8170
8171         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
8172         but this is required to check for a method name being the same as
8173         the containing class.  
8174
8175         Handle this now.
8176
8177 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8178
8179         * interface.cs: initialize variable.
8180
8181 2002-07-23  Martin Baulig  <martin@gnome.org>
8182
8183         Implemented the IndexerName attribute in interfaces.
8184
8185         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
8186         name if this is an explicit interface implementation.
8187         (Indexer.InterfaceIndexerName): New public variable.  If we're
8188         implementing an interface indexer, this is the IndexerName in that
8189         interface.  Otherwise, it's the IndexerName.
8190         (Indexer.DefineMethod): If we're implementing interface indexer,
8191         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
8192         and Pending.ImplementIndexer methods.
8193         (Indexer.Define): Also define the PropertyBuilder if we're
8194         implementing an interface indexer and this is neither an explicit
8195         interface implementation nor do the IndexerName match the one in
8196         the interface.
8197
8198         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
8199         If a method is defined here, then we always need to create a proxy
8200         for it.  This is used when implementing interface indexers.
8201         (Pending.IsInterfaceIndexer): New public method.
8202         (Pending.ImplementIndexer): New public method.
8203         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
8204         This is used when implementing interface indexers to define a proxy
8205         if necessary.
8206         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
8207         define a proxy if necessary.
8208
8209         * interface.cs (Interface.IndexerName): New public variable.
8210         (Interface.PopulateIndexer): Set the IndexerName.
8211         (Interface.DefineIndexers): New private method.  Populate all the
8212         indexers and make sure their IndexerNames match.
8213
8214         * typemanager.cs (IndexerPropertyName): Added support for interface
8215         indexers.
8216
8217 2002-07-22  Martin Baulig  <martin@gnome.org>
8218
8219         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
8220         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
8221         ret if HasReturnLabel.
8222         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
8223         variables.
8224
8225         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
8226         and set the ec.LoopBeginTryCatchLevel.
8227         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
8228         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
8229         the current ec.TryCatchLevel, the branch goes out of an exception
8230         block.  In this case, we need to use Leave and not Br.
8231
8232 2002-07-22  Martin Baulig  <martin@gnome.org>
8233
8234         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
8235         block unless the block does not always return or it is contained in
8236         another try { ... } catch { ... } block.  Fixes bug #26506.
8237         Added verify-1.cs to the test suite.
8238
8239 2002-07-22  Martin Baulig  <martin@gnome.org>
8240
8241         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
8242         then we do not always return.  Fixes bug #24985.
8243
8244 2002-07-22  Martin Baulig  <martin@gnome.org>
8245
8246         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
8247         lookup on a per-class level; ie. walk up the class hierarchy until we
8248         found at least one applicable method, then choose the best among them.
8249         Fixes bug #24463 and test-29.cs.
8250
8251 2002-07-22  Martin Baulig  <martin@gnome.org>
8252
8253         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
8254         return types of the methods.  The return type is not part of the
8255         signature and we must not check it to make the `new' modifier work.
8256         Fixes bug #27999, also added test-147.cs.
8257         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
8258
8259         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
8260         on the method's return type.
8261
8262 2002-07-21  Martin Baulig  <martin@gnome.org>
8263
8264         * assign.cs: Make this work if the rightmost source is a constant and
8265         we need to do an implicit type conversion.  Also adding a few more tests
8266         to test-38.cs which should have caught this.
8267
8268         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
8269         target in the makefile for this.  The makefile.gnu is primarily intended
8270         for end-users who don't want to debug the compiler.
8271
8272 2002-07-21  Martin Baulig  <martin@gnome.org>
8273
8274         * assign.cs: Improved the Assign class so it can now handle embedded
8275         assignments (X = Y = Z = something).  As a side-effect this'll now also
8276         consume less local variables.  test-38.cs now passes with MCS, added
8277         a few new test cases to that test.
8278
8279 2002-07-20  Martin Baulig  <martin@gnome.org>
8280
8281         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
8282         instructions.  Fixes bug #27977, also added test-146.cs.
8283
8284 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8285
8286         * cs-tokenizer.cs: fixed getHex ().
8287
8288 2002-07-19  Martin Baulig  <martin@gnome.org>
8289
8290         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
8291         not Type.GetType() to lookup the array type.  This is needed when
8292         we're constructing an array of a user-defined type.
8293         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
8294         single-dimensional arrays, but also for single-dimensial arrays of
8295         type decimal.
8296
8297 2002-07-19  Martin Baulig  <martin@gnome.org>
8298
8299         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
8300         this function is called, it's not allowed to share LocalBuilders
8301         among ILGenerators.
8302
8303 2002-07-19  Martin Baulig  <martin@gnome.org>
8304
8305         * expression.cs (Argument.Resolve): Report an error 118 when trying
8306         to pass a type as argument.
8307
8308 2002-07-18  Martin Baulig  <martin@gnome.org>
8309
8310         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
8311         Conv_R_Un for the signed `long' type.
8312
8313 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
8314
8315         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
8316         `expr' for the temporary result, as that will fail if we do
8317         multiple resolves on the same expression.
8318
8319 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
8320
8321         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
8322         ec.TypeContainer for looking up aliases. 
8323
8324         * class.cs (TypeContainer): Remove LookupAlias from here.
8325
8326         * decl.cs (DeclSpace); Move here.
8327
8328 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
8329
8330         * class.cs (FindMembers): Only call filter if the constructor
8331         bulider is not null.
8332
8333         Also handle delegates in `NestedTypes' now.  Now we will perform
8334         type lookups using the standard resolution process.  This also
8335         fixes a bug.
8336
8337         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
8338         This uses Expressions (the limited kind that can be parsed by the
8339         tree) instead of strings.
8340
8341         * expression.cs (ComposedCast.ToString): Implement, used to flag
8342         errors since now we have to render expressions.
8343
8344         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
8345         FormArrayType. 
8346
8347         * ecore.cs (SimpleName.ToString): ditto.
8348
8349         * cs-parser.jay: Instead of using strings to assemble types, use
8350         Expressions to assemble the type (using SimpleName, ComposedCast,
8351         MemberAccess).  This should fix the type lookups in declarations,
8352         because we were using a different code path for this.
8353
8354         * statement.cs (Block.Resolve): Continue processing statements
8355         even when there is an error.
8356
8357 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
8358
8359         * class.cs (Event.Define): Also remove the `remove' method from
8360         the list of pending items.
8361
8362         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
8363         generate more compact code. 
8364
8365 2002-07-17  Martin Baulig  <martin@gnome.org>
8366
8367         * const.cs (Const.LookupConstantValue): Add support for constant
8368         `unchecked' and `checked' expressions.
8369         Also adding test case test-140.cs for this.
8370
8371 2002-07-17  Martin Baulig  <martin@gnome.org>
8372
8373         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
8374         check whether mi.ReturnType implements the IEnumerator interface; the
8375         `==' and the IsAssignableFrom() will fail in this situation.
8376
8377 2002-07-16  Ravi Pratap  <ravi@ximian.com>
8378
8379         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
8380         here too.
8381
8382 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8383
8384         * expression.cs: fixed bug #27811.
8385
8386 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
8387
8388         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
8389         Molaro: when we are a ref, the value already contains a pointer
8390         value, do not take the address of it.
8391
8392 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
8393         * removed mb-parser.jay and mb-tokenizer.cs
8394
8395 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
8396
8397         * expression.cs: check against the building corlib void type.
8398
8399 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
8400
8401         * ecore.cs: fix for valuetype static readonly fields: when 
8402         initializing them, we need their address, not the address of a copy.
8403
8404 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
8405
8406         * typemanager.cs: register also enum_type in corlib.
8407
8408 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
8409
8410         * class.cs: allow calling this (but not base) initializers in structs.
8411
8412 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
8413
8414         * ecore.cs: make sure we compare against the building base types
8415         in GetTypeSize ().
8416
8417 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
8418
8419         * typemanager.cs: fix TypeToCoreType() to handle void and object
8420         (corlib gets no more typerefs after this change).
8421
8422 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
8423
8424         * expression.cs (ArrayCreation.EmitArrayArguments): use
8425         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
8426
8427         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
8428         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
8429         array indexes, the runtime actually forbids them.
8430
8431         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
8432         for array arguments here.
8433
8434         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
8435         instead of the default for ValueTypes.
8436
8437         (New.DoEmit): Use IsValueType instead of
8438         IsSubclassOf (value_type)
8439         (New.DoResolve): ditto.
8440         (Invocation.EmitCall): ditto.
8441
8442         * assign.cs (Assign): ditto.
8443
8444         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
8445         Statements *are* currently doing part of their resolution during
8446         Emit.  
8447
8448         Expressions do always resolve during resolve, but statements are
8449         only required to propagate resolution to their children.
8450
8451 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
8452
8453         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
8454
8455         (LoadAssembly): Do not add the dll if it is already specified
8456
8457         (MainDriver): Add the System directory to the link path at the end,
8458         after all the other -L arguments. 
8459
8460         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
8461         wrong opcode for loading bytes and bools (ldelem.i1 instead of
8462         ldelem.u1) and using the opposite for sbytes.
8463
8464         This fixes Digger, and we can finally run it.
8465
8466         * driver.cs (UnixParseOption): Move the option parsing here.  
8467         (CSCParseOption): Implement CSC-like parsing of options.
8468
8469         We now support both modes of operation, the old Unix way, and the
8470         new CSC-like way.  This should help those who wanted to make cross
8471         platform makefiles.
8472
8473         The only thing broken is that /r:, /reference: and /lib: are not
8474         implemented, because I want to make those have the same semantics
8475         as the CSC compiler has, and kill once and for all the confussion
8476         around this.   Will be doing this tomorrow.
8477
8478         * statement.cs (Unsafe.Resolve): The state is checked during
8479         resolve, not emit, so we have to set the flags for IsUnsfe here.
8480
8481 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
8482
8483         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
8484         not catch the Error_ObjectRefRequired in SimpleName (as it is
8485         possible to have a class/instance variable name that later gets
8486         deambiguated), we have to check this here.      
8487
8488 2002-07-10  Ravi Pratap  <ravi@ximian.com>
8489
8490         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
8491         make static and put into Expression.
8492
8493         (Event.Define): Register the private field of the event with the 
8494         TypeManager so that GetFieldFromEvent can get at it.
8495
8496         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
8497         keep track of the private field associated with an event which
8498         has no accessors.
8499
8500         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
8501         private field.
8502
8503         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
8504
8505 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
8506
8507         * expression.cs (Binary.EmitBranchable): this routine emits the
8508         Binary expression in a branchable context.  This basically means:
8509         we need to branch somewhere, not just get the value on the stack.
8510
8511         This works together with Statement.EmitBoolExpression.
8512
8513         * statement.cs (Statement.EmitBoolExpression): Use
8514         EmitBranchable. 
8515
8516 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
8517
8518         * statement.cs (For): Reduce the number of jumps in loops.
8519
8520         (For): Implement loop inversion for the For statement.
8521
8522         (Break): We can be breaking out of a Try/Catch controlled section
8523         (foreach might have an implicit try/catch clause), so we need to
8524         use Leave instead of Br.
8525
8526         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
8527         now).  If the instace expression supports IMemoryLocation, we use
8528         the AddressOf method from the IMemoryLocation to extract the
8529         address instead of emitting the instance.
8530
8531         This showed up with `This', as we were emitting the instance
8532         always (Emit) instead of the Address of This.  Particularly
8533         interesting when This is a value type, as we dont want the Emit
8534         effect (which was to load the object).
8535
8536 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
8537
8538         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
8539
8540         * statement.cs (Checked): Set the CheckedState during the resolve
8541         process too, as the ConvCast operations track the checked state on
8542         the resolve process, and not emit.
8543
8544         * cs-parser.jay (namespace_member_declaration): Flag that we have
8545         found a declaration when we do.  This is used to flag error 1529
8546
8547         * driver.cs: Report ok when we display the help only.
8548
8549 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
8550
8551         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
8552
8553 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
8554
8555         * cs-tokenizer.cs (define): We also have to track locally the
8556         defines.  AllDefines is just used for the Conditional Attribute,
8557         but we also need the local defines for the current source code. 
8558
8559 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
8560
8561         * statement.cs (While, For, Do): These loops can exit through a
8562         Break statement, use this information to tell whether the
8563         statement is the last piece of code.
8564
8565         (Break): Flag that we break.
8566
8567         * codegen.cs (EmitContexts): New `Breaks' state variable.
8568
8569 2002-07-03  Martin Baulig  <martin@gnome.org>
8570
8571         * class.cs (TypeContainer.MethodModifiersValid): Allow override
8572         modifiers in method declarations in structs.  Otherwise, you won't
8573         be able to override things like Object.Equals().
8574
8575 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
8576
8577         * class.cs (Method, Property, Indexer): Do not allow the public
8578         modifier to be used in explicit interface implementations.
8579
8580         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
8581         override modifiers in method declarations in structs
8582
8583 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
8584
8585         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
8586         integer or real overflow, report an error
8587
8588 2002-07-02  Martin Baulig  <martin@gnome.org>
8589
8590         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
8591         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
8592         to tell the runtime about our newly created System.Object and
8593         System.ValueType types.
8594
8595 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
8596
8597         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
8598         struct instead of Ldarg/Starg.
8599
8600 2002-07-02  Martin Baulig  <martin@gnome.org>
8601
8602         * expression.cs (Indirection.Indirection): Call
8603         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
8604
8605 2002-07-02  Martin Baulig  <martin@gnome.org>
8606
8607         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
8608         ValueType, call TypeManager.TypeToCoreType() on it.
8609         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
8610         the OpCodes.Newarr argument.
8611
8612 2002-07-02  Martin Baulig  <martin@gnome.org>
8613
8614         * expression.cs (Invocation.EmitCall): When compiling corlib,
8615         replace all calls to the system's System.Array type to calls to
8616         the newly created one.
8617
8618         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
8619         System.Array methods.
8620         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
8621         from the system's System.Array type which must be replaced.
8622
8623 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
8624
8625         * typemanager.cs: load unverifiable_code_ctor so we can build
8626         corlib using the correct type. Avoid using GetTypeCode() with
8627         TypeBuilders.
8628         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
8629         TypeManager.object_type to allow building corlib.
8630
8631 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
8632
8633         * ecore.cs: handle System.Enum separately in LoadFromPtr().
8634
8635 2002-07-01  Martin Baulig  <martin@gnome.org>
8636
8637         * class.cs: Make the last change actually work, we need to check
8638         whether `ifaces != null' to avoid a crash.
8639
8640 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
8641
8642         * class.cs: when we build structs without fields that implement
8643         interfaces, we need to add the interfaces separately, since there is
8644         no API to both set the size and add the interfaces at type creation
8645         time.
8646
8647 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
8648
8649         * expression.cs: the dimension arguments to the array constructors
8650         need to be converted if they are a long.
8651
8652 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
8653
8654         * class.cs: don't emit ldarg.0 if there is no parent constructor
8655         (fixes showstopper for corlib).
8656
8657 2002-06-29  Martin Baulig  <martin@gnome.org>
8658
8659         MCS now compiles corlib on GNU/Linux :-)
8660
8661         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
8662         ie. check for MethodImplOptions.InternalCall.
8663
8664         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
8665         and TypeManager.attribute_type are null, so we must explicitly check
8666         whether parent is not null to find out whether it's an attribute type.
8667         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
8668         and SetBuilder, not only if the property is neither abstract nor external.
8669         This is necessary to set the MethodImplOptions on the accessor methods.
8670         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
8671         SetBuilder, see Property.Emit().
8672
8673         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
8674         populate "System.Object", "System.ValueType" and "System.Attribute" since
8675         they've already been populated from BootCorlib_PopulateCoreTypes().
8676
8677 2002-06-29  Martin Baulig  <martin@gnome.org>
8678
8679         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
8680         is the NullLiteral, we also need to make sure that target_type is not
8681         an enum type.   
8682
8683 2002-06-29  Martin Baulig  <martin@gnome.org>
8684
8685         * rootcontext.cs (RootContext.ResolveCore): We must initialize
8686         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
8687         before calling BootstrapCorlib_ResolveDelegate ().
8688
8689 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8690
8691         * statement.cs: fixed build-breaker. All tests passed ok.
8692
8693 2002-06-27  Martin Baulig  <martin@gnome.org>
8694
8695         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
8696         for System.Decimal when compiling corlib.
8697
8698 2002-06-27  Martin Baulig  <martin@gnome.org>
8699
8700         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
8701         switch blocks which contain nothing but a default clause.
8702
8703 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
8704
8705        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
8706
8707 2002-06-27  Martin Baulig  <martin@gnome.org>
8708
8709         * ecore.cs (PropertyExpr.PropertyExpr): Call
8710         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
8711
8712         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
8713         is already a TypeBuilder.
8714
8715 2002-06-27  Martin Baulig  <martin@gnome.org>
8716
8717         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
8718         `target_type == TypeManager.array_type', not IsAssignableFrom() in
8719         the "from an array-type to System.Array" case.  This makes it work
8720         when compiling corlib.
8721
8722 2002-06-27  Martin Baulig  <martin@gnome.org>
8723
8724         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
8725         non-static PropertyExpr, set its InstanceExpression.  This makes
8726         the `ICollection.Count' property work in System/Array.cs.
8727
8728 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
8729
8730         * driver.cs: Made error handling more consistent.  Errors now
8731         tracked by Report class, so many methods which used to return int
8732         now return void.  Main() now prints success/failure and 
8733         errors/warnings message.
8734
8735         Renamed '--probe' compiler argument to '--expect-error'.  Removed
8736         the magic number return values (123 and 124).  Now, if the
8737         expected error occurs, the compiler exits with success (exit value
8738         0).  If the compilation completes without seeing that particular
8739         error, the compiler exits with failure (exit value 1).  The
8740         makefile in mcs/errors has been changed to handle the new behaviour.
8741
8742         * report.cs: Made 'expected error' number a property and renamed
8743         it from 'Probe' to 'ExpectedError'.
8744
8745         * genericparser.cs: Removed error handling support, since it is
8746         now all done by Report class.
8747
8748         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
8749         class, so parse() no longer returns an int.
8750
8751         * namespace.cs: Use Report.Error instead of GenericParser.error
8752
8753 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
8754
8755         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
8756         TypeContainer.AddOperator): At the front of the list put the
8757         explicit implementations, so they get resolved/defined first. 
8758
8759 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
8760
8761         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
8762         interface type is implemented by this TypeContainer.  Used during
8763         explicit interface implementation.
8764
8765         (Property.Define, Indexer.Define, Method.Define): Validate that
8766         the given interface in the explicit implementation is one of the
8767         base classes for the containing type.
8768
8769         Also if we are explicitly implementing an interface, but there is
8770         no match in the pending implementation table, report an error.
8771
8772         (Property.Define): Only define the property if we are
8773         not explicitly implementing a property from an interface.  Use the
8774         correct name also for those properties (the same CSC uses,
8775         although that is really not needed).
8776
8777         (Property.Emit): Do not emit attributes for explicitly implemented
8778         properties, as there is no TypeBuilder.
8779
8780         (Indexer.Emit): ditto.
8781
8782         Hiding then means that we do not really *implement* a pending
8783         implementation, which makes code fail.
8784
8785 2002-06-22  Martin Baulig  <martin@gnome.org>
8786
8787         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
8788         the return value of Object.GetType().  [FIXME: we need to do this whenever
8789         we get a type back from the reflection library].
8790
8791 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
8792
8793         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
8794
8795 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
8796
8797         * attribute.cs: Return null if we can not look up the type.
8798
8799         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
8800         the interface types found.
8801
8802         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
8803         interface types found.
8804
8805         * typemanager.cs (GetInterfaces): Make this routine returns alll
8806         the interfaces and work around the lame differences between
8807         System.Type and System.Reflection.Emit.TypeBuilder in the results
8808         result for GetInterfaces.
8809
8810         (ExpandInterfaces): Given an array of interface types, expand and
8811         eliminate repeated ocurrences of an interface.  This expands in
8812         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
8813         be IA, IB, IC.
8814
8815 2002-06-21  Martin Baulig  <martin@gnome.org>
8816
8817         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
8818         on System.Enum.
8819
8820 2002-06-21  Martin Baulig  <martin@gnome.org>
8821
8822         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
8823         and called with one of the core types, return the corresponding typebuilder for
8824         that type.
8825
8826         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
8827         element type.
8828
8829 2002-06-21  Martin Baulig  <martin@gnome.org>
8830
8831         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
8832         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
8833         (Expression.ConvertReferenceExplicit): Likewise.
8834
8835         * expression.cs (ElementAccess.DoResolve): Likewise.
8836         (ElementAccess.DoResolveLValue): Likewise.
8837
8838 2002-06-10  Martin Baulig  <martin@gnome.org>
8839
8840         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
8841         add the "value" parameter to the parameter list.
8842
8843         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
8844         to our caller.
8845
8846 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
8847
8848         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
8849         the argument to an int, uint, long or ulong, per the spec.  Also
8850         catch negative constants in array creation.
8851
8852 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
8853
8854         * class.cs: do not allow the same interface to appear twice in
8855         the definition list.
8856
8857 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
8858
8859         * ecore.cs: don't use ldlen with System.Array.
8860
8861 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
8862
8863         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
8864
8865 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
8866
8867         * modifiers.cs: produce correct field attributes for protected
8868         internal. Easy fix so miguel can work on ther harder stuff:-)
8869
8870 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
8871
8872         * pending.cs: New file.  Move the code from class.cs here.
8873         Support clearning the pending flag for all methods (when not doing
8874         explicit interface implementation).
8875
8876 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
8877
8878         * rootcontext.cs: added a couple more types needed to bootstrap.
8879
8880 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
8881
8882         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
8883         constructor in the type, instead of any constructor in the type
8884         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
8885         a bug in the Mono runtime when applying the params attribute). 
8886
8887 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
8888         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
8889
8890 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
8891
8892         * expression.cs (Unary.ResolveOperator): Use TypeManager
8893         to resolve the type.
8894
8895 2002-06-13  Ravi Pratap  <ravi@ximian.com>
8896
8897         * cs-parser.jay (enum_member_declaration): Pass in the attributes
8898         attached.
8899
8900         * enum.cs (AddEnumMember): Add support to store the attributes associated 
8901         with each member too.
8902
8903         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
8904         field builders too - this takes care of the enum member case.
8905
8906 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
8907
8908         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
8909         address-of operator on both value types and pointers.
8910
8911 2002-06-10  Martin Baulig  <martin@gnome.org>
8912
8913         * interface.cs (Interface.PopulateIndexer): Add the indexer's
8914         PropertyBuilder to the `property_builders' list.
8915
8916         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
8917         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
8918         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
8919         find any indexers which are inherited from an interface.
8920
8921 2002-06-09  Martin Baulig  <martin@gnome.org>
8922
8923         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
8924         the same type as the constant if necessary.  There's also a test-130.cs
8925         for this.
8926
8927         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
8928
8929         * typemanager.cs (TypeManager.ChangeType): Previously known as
8930         Enum.ChangeEnumType().
8931
8932 2002-06-09  Martin Baulig  <martin@gnome.org>
8933
8934         * expression.cs (Cast.TryReduce): Added support for consts.
8935
8936 2002-06-08  Ravi Pratap  <ravi@ximian.com>
8937
8938         * class.cs (Accessor): Hold attributes information so we can pass
8939         it along.
8940
8941         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
8942         Modify to pass in attributes attached to the methods.
8943
8944         (add_accessor_declaration, remove_accessor_declaration): Ditto.
8945
8946         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
8947         to handle the Accessor kind :-)
8948
8949         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
8950
8951 2002-06-08  Martin Baulig  <martin@gnome.org>
8952
8953         * expression.cs (Unary.TryReduceNegative): Added support for
8954         ULongConstants.
8955
8956 2002-06-08  Martin Baulig  <martin@gnome.org>
8957
8958         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
8959         name can't be found in the `defined_names' - the caller will do a
8960         MemberLookup in this case and thus find methods in System.Enum
8961         such as Enum.IsDefined().
8962
8963 2002-06-08  Martin Baulig  <martin@gnome.org>
8964
8965         * enum.cs (Enum.ChangeEnumType): This is a custom version of
8966         Convert.ChangeType() which works with TypeBuilder created types.
8967         (Enum.LookupEnumValue, Enum.Define): Use it here.
8968
8969         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
8970         `TypeBuilder.BaseType != null' check.
8971         (TypeContainer.FindMembers): Only lookup parent members if we
8972         actually have a parent.
8973         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
8974         (ConstructorInitializer.Resolve): Likewise.
8975
8976         * interface.cs (Interface.FindMembers): Added
8977         `TypeBuilder.BaseType != null' check.
8978
8979         * rootcontext.cs (RootContext.ResolveCore): Added
8980         "System.Runtime.CompilerServices.IndexerNameAttribute" to
8981         classes_second_stage.
8982
8983         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
8984         debug_type and trace_type when compiling with --nostdlib.       
8985
8986 2002-06-07  Martin Baulig  <martin@gnome.org>
8987
8988         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
8989         (AddField): Set it to true when adding a non-static field.
8990         (DefineType): Use `have_nonstatic_fields' to find out whether we
8991         have non-static fields, not `Fields != null'.
8992
8993 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
8994
8995         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
8996         dereferencing a null on the static-field code path)
8997
8998 2002-05-30  Martin Baulig  <martin@gnome.org>
8999
9000         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
9001         to take command line arguments.  Use reflection to call the new
9002         custom `Initialize' function on the symbol writer and pass it the
9003         command line arguments.
9004
9005         * driver.cs (--debug-args): New command line argument to pass command
9006         line arguments to the symbol writer.
9007
9008 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
9009
9010         * assign.cs (DoResolve): Forgot to do the implicit conversion to
9011         the target type for indexers and properties.  Thanks to Joe for
9012         catching this.
9013
9014 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
9015
9016         * typemanager.cs (MethodFlags): returns the method flags
9017         (Obsolete/ShouldIgnore) that control warning emission and whether
9018         the invocation should be made, or ignored. 
9019
9020         * expression.cs (Invocation.Emit): Remove previous hack, we should
9021         not do this on matching a base type, we should do this based on an attribute
9022
9023         Only emit calls to System.Diagnostics.Debug and
9024         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
9025         on the command line.
9026
9027         * rootcontext.cs: Global settings for tracing and debugging.
9028
9029         * cs-tokenizer.cs (define): New utility function to track
9030         defines.   Set the global settings for TRACE and DEBUG if found.
9031
9032 2002-05-25  Ravi Pratap  <ravi@ximian.com>
9033
9034         * interface.cs (Populate*): Pass in the TypeContainer as well as
9035         the DeclSpace as parameters so that we can create EmitContexts and
9036         then use that to apply attributes etc.
9037
9038         (PopulateMethod, PopulateEvent, PopulateProperty)
9039         (PopulateIndexer): Apply attributes everywhere.
9040
9041         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
9042         etc.
9043
9044         (ApplyAttributes): Update accordingly.
9045
9046         We now apply interface attributes for all members too.
9047
9048 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
9049
9050         * class.cs (Indexer.Define); Correctly check if we are explicit
9051         implementation (instead of checking the Name for a ".", we
9052         directly look up if the InterfaceType was specified).
9053
9054         Delay the creation of the PropertyBuilder.
9055
9056         Only create the PropertyBuilder if we are not an explicit
9057         interface implementation.   This means that explicit interface
9058         implementation members do not participate in regular function
9059         lookups, and hence fixes another major ambiguity problem in
9060         overload resolution (that was the visible effect).
9061
9062         (DefineMethod): Return whether we are doing an interface
9063         implementation. 
9064
9065         * typemanager.cs: Temporary hack until we get attributes in
9066         interfaces (Ravi is working on that) and we get IndexerName
9067         support in interfaces.
9068
9069         * interface.cs: Register the indexers as properties.
9070
9071         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
9072         warning, I have verified that this is a bug in the .NET runtime
9073         (JavaScript suffers of the same problem).
9074
9075         * typemanager.cs (MemberLookup): When looking up members for
9076         interfaces, the parent of an interface is the implicit
9077         System.Object (so we succeed in searches of Object methods in an
9078         interface method invocation.  Example:  IEnumerable x;  x.ToString
9079         ()) 
9080
9081 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
9082
9083         * class.cs (Event): Events should also register if they do
9084         implement the methods that an interface requires.
9085
9086         * typemanager.cs (MemberLookup); use the new GetInterfaces
9087         method. 
9088
9089         (GetInterfaces): The code used to lookup interfaces for a type is
9090         used in more than one place, factor it here. 
9091
9092         * driver.cs: Track the errors at the bottom of the file, we kept
9093         on going.
9094
9095         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
9096         instance if the method we are calling is static!
9097
9098 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * attribute.cs (ApplyAttributes): Make this function filter out
9101         the IndexerName attribute (as that attribute in reality is never
9102         applied) and return the string constant for the IndexerName
9103         attribute. 
9104
9105         * class.cs (TypeContainer.Emit): Validate that all the indexers
9106         have the same IndexerName attribute, and if so, set the
9107         DefaultName attribute on the class. 
9108
9109         * typemanager.cs: The return value might contain other stuff (not
9110         only methods).  For instance, consider a method with an "Item"
9111         property and an Item method.
9112
9113         * class.cs: If there is a problem with the parameter types,
9114         return. 
9115
9116 2002-05-24  Ravi Pratap  <ravi@ximian.com>
9117
9118         * ecore.cs (ImplicitConversionExists): Wrapper function which also
9119         looks at user defined conversion after making a call to 
9120         StandardConversionExists - we need this for overload resolution.
9121
9122         * expression.cs : Update accordingly the various method calls.
9123
9124         This fixes 2 bugs filed against implicit user defined conversions 
9125
9126 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
9127
9128         * statement.cs: Track the result of the assignment.
9129
9130 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
9131
9132         * expression.cs (MemberAccess): Improved error reporting for
9133         inaccessible members.
9134
9135 2002-05-22  Martin Baulig  <martin@gnome.org>
9136
9137         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
9138         itself with debugging support.
9139
9140 2002-05-22  Martin Baulig  <martin@gnome.org>
9141
9142         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
9143         Removed, this isn't needed anymore.
9144
9145 2002-05-20  Martin Baulig  <martin@gnome.org>
9146
9147         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
9148         be underlying type for an enum.
9149
9150 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
9151
9152         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
9153         that splits out the loading of just the core types.
9154
9155         * rootcontext.cs (ResolveCore): Split the struct resolution in
9156         two, so we can load the enumeration underlying types before any
9157         enums are used.
9158
9159         * expression.cs (Is): Bandaid until we fix properly Switch (see
9160         bug #24985 for details).
9161
9162         * typemanager.cs (ImplementsInterface): The hashtable will contain
9163         a null if there are no interfaces implemented.
9164
9165 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
9166
9167         * cs-parser.jay (indexer_declarator): It is fine to have array
9168         parameters
9169
9170 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
9171
9172         * typemanager.cs: (RegisterBuilder): New function used to register
9173         TypeBuilders that implement interfaces.  Since
9174         TypeBuilder.GetInterfaces (as usual) does not work with lame
9175         Reflection.Emit. 
9176         (AddUserType): register interfaces.
9177
9178         (ImplementsInterface): Use the builder_to_ifaces hash if we are
9179         dealing with TypeBuilder.  Also, arrays are showing up as
9180         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
9181         methods can not be invoked on them!
9182
9183         * ecore.cs (ExplicitReferenceConversionExists): Made public.
9184         (ImplicitReferenceConversionExists): Split out from
9185         StandardConversionExists. 
9186
9187         * expression.cs (As): We were only implementing one of the three
9188         cases for the as operator.  We now implement them all.
9189         (Is): Implement the various other cases for Is as well.
9190
9191         * typemanager.cs (CACHE): New define used to control if we want or
9192         not the FindMembers cache.  Seems to have a negative impact on
9193         performance currently
9194
9195         (MemberLookup): Nested types have full acess to
9196         enclosing type members
9197
9198         Remove code that coped with instance/static returns for events, we
9199         now catch this in RealFindMembers.
9200
9201         (RealFindMembers): only perform static lookup if the instance
9202         lookup did not return a type or an event.  
9203
9204 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * assign.cs (CompoundAssign): We pass more semantic information
9207         now to Compound Assignments than we did before: now we have all
9208         the information at hand, and now we resolve the target *before* we
9209         do the expression expansion, which allows the "CacheValue" method
9210         to have the effect we intended (before, a [x] += 1 would generate
9211         two differen ArrayAccess expressions from the ElementAccess,
9212         during the resolution process).
9213
9214         (CompoundAssign.DoResolve): Resolve target and original_source here.
9215
9216 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
9217
9218         * expression.cs (ArrayAccess): dropped debugging information. 
9219
9220         * typemanager.cs: Small bug fix: I was always returning i_members,
9221         instead of one of i_members or s_members (depending on which had
9222         the content).
9223
9224         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
9225         method is invoked before any code generation takes place, and it
9226         is a mechanism to inform that the expression will be invoked more
9227         than once, and that the method should use temporary values to
9228         avoid having side effects
9229
9230         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
9231
9232         * ecore.cs (Expression.CacheTemporaries): Provide empty default
9233         implementation.
9234
9235         * expression.cs (Indirection, ArrayAccess): Add support for
9236         CacheTemporaries in these two bad boys. 
9237
9238         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
9239         ldobj or ldind_ref.  
9240         (StoreFromPtr): Handle stobj as well.
9241
9242         * expression.cs (UnaryMutator): Share more code.
9243
9244         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
9245         down: I was not tracking the Filter function as well, which
9246         was affecting the results of the cache.
9247
9248 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
9249
9250         * attribute.cs: Remove the hack to handle the CharSet property on
9251         StructLayouts. 
9252
9253 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
9254
9255         * attribute.cs (DoResolve): More uglyness, we now only try to
9256         resolve the attribute partially, to extract the CharSet
9257         information (only if we are a StructLayout attribute).  Otherwise 
9258
9259         (GetExtraTypeInfo): Add some code to conditionally kill in the
9260         future this.   I am more and more convinced that the .NET
9261         framework has special code to handle the attribute setting on
9262         certain elements.
9263
9264         * expression.cs (IsParamsMethodApplicable): Revert my previous
9265         foreach change here, it was wrong.
9266
9267 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
9268
9269         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
9270         (pp_expr): do not abort on unknown input, just return.
9271         (eval): abort if there are pending chars.
9272
9273         * attribute.cs (Attribute.Resolve): Positional parameters are
9274         optional.  Deal with that case.
9275
9276         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
9277         the Ansi/Unicode/Auto information for the type.
9278
9279         (TypeContainer.DefineType): instantiate the EmitContext here, as
9280         we will be using it during the type definition (to resolve
9281         attributes) and during the emit phase.
9282
9283         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
9284         to pull type information out of the attributes
9285
9286         (Attribute.Resolve): track the constructor builder, and allow for
9287         multiple invocations (structs and classes will use this).
9288
9289         * ecore.cs (MemberLookupFinal): new version with all the
9290         parameters customizable.
9291
9292         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
9293         constructors.  Return if the result value is null (as the error
9294         would have been flagged already by MemberLookupFinal)
9295
9296         Do not allow instances of abstract classes or interfaces to be
9297         created.
9298
9299         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
9300         We have to compare the assembly property here when dealing with
9301         FamANDAssem and Assembly access modifiers, because we might be
9302         creating an assembly from *modules* (that means that we are not
9303         getting TypeBuilders for types defined in other modules that are
9304         part of this assembly).
9305
9306         (Method.Emit): If the method is marked abstract and has a body,
9307         emit an error. 
9308
9309         (TypeContainer.DefineMembers): If both the defined member and the
9310         parent name match are methods, then do not emit any warnings: let
9311         the Method.Define routine take care of flagging warnings.  But if
9312         there is a mismatch (method overrides something else, or method is
9313         overriwritten by something, then emit warning).
9314
9315         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
9316         set to null, this means `do not check for the return type on the
9317         signature'. 
9318
9319         (Method.Define): set the return type for the method signature to
9320         null, so that we get methods with the same name and parameters and
9321         different return types.  This is used to flag warning 114 (you are
9322         hiding a method, and you probably want to use the new/override
9323         keywords instead).
9324
9325         * typemanager.cs (MemberLookup): Implemented proper access
9326         control, closing a long standing set of bug reports.  The problem
9327         was that the Framework only has two bits: Public and NonPublic,
9328         and NonPublic includes private and protected methods, but we need
9329         to enforce the FamANDAssem, FamOrAssem and Family. 
9330
9331 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
9332
9333         * statement.cs (GotoCase): Return true: Ammounts to giving up
9334         knowledge on whether we return or not, and letting the other case
9335         be responsible for it.
9336
9337 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * driver.cs: Do not load directories for each file processed, only
9340         do it if there is a pattern.
9341
9342         * ecore.cs: Report readonly assigns here as well, as we might have
9343         been resolved only by MemberAccess.
9344
9345         (SimpleName.SimpleNameResolve): Also be useful for LValue
9346         resolution.   We need this to propagate assign to local readonly variables
9347
9348         * typemanager.cs: Use a ptrhashtable for the criteria, because we
9349         do not want to reuse potential criteria memory.
9350
9351         * class.cs (MyEventBuilder): Set reflected_type;
9352
9353         * ecore.cs (Constantify): Added support for constifying bools.
9354
9355         (RootContext.LookupType): Added a cache for values looked up in
9356         the declaration space.
9357
9358         * typemanager.cs (FindMembers): Now is a front-end to
9359         RealFindMembers, and provides a two-level hashtable-based cache to
9360         the request.  
9361
9362         15% performance improvement: from 22.5 to 19.2 seconds.
9363
9364         * expression.cs (IsParamsMethodApplicable): use foreach.
9365         (Invocation.DoResolve): ditto.
9366         (New.DoResolve): ditto.
9367         (ArrayCreation.DoResolve): ditto.
9368
9369         * ecore.cs (FindMostEncompassingType): use foreach.
9370
9371         * delegate.cs (NewDelegate.DoResolve): Use foreach
9372
9373         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
9374         (RemoveMethods): use foreach.
9375
9376         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
9377         nested foreach statements instead of for, and also break out of
9378         the inner loop once a match is found.
9379
9380         (Invocation.OverloadResolve): Use foreach, simplify the code. 
9381
9382 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
9383
9384         * cfold.cs (BinaryFold): During an enumeration evaluation context,
9385         we actually unwrap the expression to allow for extra information
9386         to be extracted. 
9387
9388         * expression.cs: Use Shr_Un on unsigned operations. 
9389
9390 2002-05-08  Ravi Pratap  <ravi@ximian.com>
9391
9392         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
9393         applicable operators was not being considered correctly. This closes
9394         the bug Miguel reported.
9395
9396 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
9397
9398         * attribute.cs: check that the type derives from System.Attribute
9399         and report the correct error in that case (moved the duplicate code to
9400         its own method, too).
9401
9402 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
9403
9404         * attribute.cs: lookup attribute type name as the spec says: first the
9405         bare attribute name and then name + "Attribute" (nant compiles with
9406         mcs after this fix).
9407
9408 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
9409
9410         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
9411         Because of the way we parse things, we should try to see if a
9412         UIntConstant can fit in an integer.
9413
9414 2002-05-07  Ravi Pratap  <ravi@ximian.com>
9415
9416         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
9417         when we are in an explicit context.
9418
9419         (ConvertReferenceExplicit): When converting from Iface type S to Class
9420         T make sure the rules are implemented as an OR.
9421
9422         * parameter.cs (ParameterType): Make it a property for now although the
9423         purpose really isn't anything immediate.
9424
9425         * expression.cs (Is*Applicable): Do better checking on the parameter type
9426         of a ref/out parameter. The ones from the system assemblies are already 
9427         marked with the correct type so we don't need to do any correction.
9428
9429         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
9430         the object type is standard too so include that.
9431
9432 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
9433
9434         * ecore.cs (StandardConversionExists): Augment with missing code:
9435         deal with IntConstant, LongConstants and Enumerations.
9436
9437         * assign.cs: Report the error, instead of failing silently
9438
9439         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
9440         typecontainer that they are declared, because the
9441         typecontainer/namespace will have the list of using clauses that
9442         need to be applied.
9443
9444         Assembly Attributes were escaping the normal registration
9445         mechanism. 
9446
9447         (EmitCode): Apply attributes within an EmitContext that represents
9448         the container they were declared on.
9449
9450         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
9451
9452 2002-05-06  Ravi Pratap  <ravi@ximian.com>
9453
9454         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
9455         Revamp completely - make much cleaner as we now operate only
9456         on a set of Types.
9457
9458         (FindMostSpecificSource, FindMostSpecificTarget): New methods
9459         to implement the logic detailed in the spec more correctly.
9460
9461         (UserDefinedConversion): Update accordingly.
9462
9463 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
9464
9465         * statement.cs: Return flow analysis information up.
9466
9467         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
9468         and the default.
9469
9470         (token): Do not consume an extra character before calling
9471         decimal_digits.
9472
9473 2002-05-06  Piers Haken <piersh@friskit.com>
9474
9475         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
9476
9477 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
9478
9479         * class.cs (Constructor.Emit): Set the IsStatic flag in the
9480         EmitContext during the instance constructor initializer
9481         resolution, to stop access to instance variables.
9482
9483         This is mandated by the spec, last paragraph of the `constructor
9484         initializers' section. 
9485
9486 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
9487
9488         * cs-parser.jay, class.cs (Accessor): new class used to represent
9489         an accessor (get or set).  In the past we used `null' to represent
9490         a missing accessor.  But this is ambiguous because there was no
9491         way to tell in abstract indexers/properties if one of them was
9492         specified.
9493
9494         Now there is a way of addressing that.
9495
9496         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
9497         instead of FindMembers.
9498
9499         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
9500         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
9501
9502         * attribute.cs: Treat indexers and properties as the same in terms
9503         of applying attributes
9504
9505         * ecore.cs (FindMostEncompassedType): Use statically initialized
9506         EmptyExpressions()s like we do elsewhere to avoid creating useless
9507         objects (and we take this out of the tight loop).
9508
9509         (GetConversionOperators): Move the code to extract the actual
9510         operators to a separate routine to clean things up.
9511
9512 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
9513
9514         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
9515         events are always registered FieldBuilders.
9516
9517         * class.cs (FieldBase): New class shared by Fields 
9518
9519         * delegate.cs: If we are a toplevel delegate, use our full name.
9520         If we are a nested delegate, then only use our tail name.
9521
9522 2002-05-02  Ravi Pratap  <ravi@ximian.com>
9523
9524         * expression.cs (IsApplicable): Ensure that we add the "&" to
9525         ref/out types before comparing it with the type of the argument.
9526
9527         (IsParamsMethodApplicable): Ditto.
9528
9529         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
9530         silly me ;-)
9531
9532         * delegate.cs : Handle the case when we have more than one applicable
9533         method. Flag an error only when we finish checking all.
9534
9535 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
9536
9537         * expression.cs: Add support for boolean static initializers.
9538
9539 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
9540
9541         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
9542
9543         * parameter.cs (ComputeParameterTypes,
9544         ComputeAndDefineParameterTypes): Better error handling: now we
9545         clear the `types' cache if we fail during any of the type lookups.
9546         We also return the status code correctly to our caller
9547
9548         * delegate.cs: If we fail to define a delegate, abort the extra
9549         steps. 
9550
9551         * expression.cs (Binary.ResolveOperator): for
9552         operator==(object,object) and operator !=(object, object) we also
9553         have to verify that there is an implicit conversion from one to
9554         the other.
9555
9556         (ArrayAccess.DoResolve): Array Access can operate on
9557         non-variables. 
9558
9559 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
9560
9561         * assign.cs (CompoundAssign): A new class used as a "flag" that
9562         the assignment actually is happening as part of a compound
9563         assignment operator.
9564
9565         During compound assignment, a few new rules exist to enable things
9566         like:
9567
9568         byte b |= 1 + 2
9569
9570         From the spec:
9571
9572         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
9573         to the type of x) if y is implicitly convertible to the type of x,
9574         and the operator is a builtin operator and the return type of the
9575         operator is explicitly convertible to the type of x. 
9576
9577         * rootcontext.cs: Reset warning level to 2.  4 catches various
9578         "interesting" features in mcs, we must clean this up at some
9579         point, but currently am trying to kill other bugs ;-)
9580
9581         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
9582         in container classes as well.  
9583
9584         * expression.cs (Binary.ResolveOperator): Handle string case
9585         before anything else (as operator overloading does emit an error
9586         before doing anything else).
9587
9588         This code could go away when we move to a table driven model, but
9589         i could not come up with a good plan last night.
9590
9591 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
9592
9593         * typemanager.cs (CSharpName): reimplementation using regex.
9594         * class.cs: added null check for fields in Emit
9595         * rootcontext.cs: set warninglevel to 4
9596
9597 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * typemanager.cs (CSharpName): reimplemented with Lupus
9600         suggestion.
9601
9602 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
9603
9604         * statement.cs (If): correclty implement Resolve, because we were
9605         not catching sem errors in there.  The same process is needed
9606         everywhere else. 
9607         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
9608
9609
9610         (Statement.Warning_DeadCodeFound): Factorize code.
9611         (While): Report dead code here too.
9612
9613         (Statement): Added Resolve virtual method to allow
9614         for resolution split from the emit code.
9615
9616 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
9617
9618         * statement.cs (EmitBoolExpression): No longer try to resolve the
9619         expression here.    
9620         (MakeBoolean): New utility function that resolve, implicitly
9621         converts to boolean and tags the expression. 
9622
9623
9624         (If, Do): Implement dead code elimination.
9625         (While): Implement loop inversion
9626
9627         (Do, While, For, If): Resolve the expression prior to calling our
9628         code generation.
9629
9630 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
9631
9632         * class.cs:
9633           - added method Report28 (warning: program has more than one entry point)
9634           - added method IsEntryPoint, implements paragraph 10.1 of the spec
9635           - modified method Method.Define, the part at the end of the method
9636
9637         * rootcontext.cs: added static public Location EntryPointLocation;
9638           
9639         * ../errors/cs0028.cs : Add test case for the above warning.              
9640
9641         * typemanager.cs:
9642           - modified method CSharpName to allow arrays of primitive type to
9643             be printed nicely (e.g. instead of System.Int32[][] it now prints
9644             int[][])
9645           - added method CSharpSignature: returns the signature of a method
9646             in string format to be used in reporting errors, warnings, etc.
9647
9648         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
9649         with String.Empty.
9650
9651 2002-04-26  Ravi Pratap  <ravi@ximian.com>
9652
9653         * delegate.cs (Define): Fix extremely silly bug where I was
9654         setting the type of the 'object' parameter of the BeginInvoke
9655         method to System.IAsyncResult instead of System.Object ;-)
9656
9657 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
9658
9659         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
9660         here. 
9661
9662         (Constructor.Emit): return if we fail to initialize the
9663         constructor.  Another door closed!  
9664
9665         * expression.cs (New.DoResolve): Improve error message (from -6 to
9666         1501).  Use DeclaredOnly lookup to find the exact constructor.
9667
9668         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
9669         loop.  This is useful.
9670
9671         * cs-parser.jay: Adjust the default parameters so that destructors
9672         have the proper signature.
9673
9674 2002-04-26  Martin Baulig  <martin@gnome.org>
9675
9676         * driver.cs (LoadAssembly): If `assembly' contains any characters
9677         which are only valid in path names and not in assembly names
9678         (currently slash, backslash and point), use Assembly.LoadFrom ()
9679         instead of Assembly.Load () on the `assembly' (before iteration
9680         over the link_paths).
9681
9682 2002-04-26  Martin Baulig  <martin@gnome.org>
9683
9684         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
9685
9686 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
9687
9688         * class.cs (Property): use the new typemanager.MemberLookup
9689
9690         (TypeContainer.MemberLookup): Implement using the
9691         TypeManager.MemberLookup now. 
9692
9693         * typemanager.cs: Make MemberLookup a function of the TypeManager,
9694         and return MemberInfos, so that these can be used without an
9695         EmitContext (what we had before).
9696
9697 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
9698
9699         * expression.cs: Fix the case where the argument to params if the
9700         type of the params.  I omitted handling this before.   Fixed
9701
9702 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
9703
9704         * driver.cs: Call BootCorlib_PopulateCoreType
9705
9706         * class.cs (Property.CheckBase): Check for properties only, not
9707         for all members. 
9708
9709         * interface.cs: Temporary hack: try/catch around the
9710         CustomAttributeBuilder, because I am getting an exception that I
9711         do not understand.
9712
9713         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
9714         types whose definitions are required to be there (attributes are
9715         defined before standard types).
9716
9717         Compute definitions as we boot the various types, as they are used
9718         immediately (value_type class will need object_type, but if we do
9719         not initialize object_type, we will pass a null, which will let
9720         the runtime pick the System.Object from the existing corlib, which
9721         is not what we want).
9722
9723 2002-04-22  Patrik Torstensson <totte@labs2.com>
9724
9725         * cs-tokenizer.cs: fixed a number of trim() issues.
9726
9727 2002-04-22  Ravi Pratap  <ravi@ximian.com>
9728
9729         * expression.cs (Argument.Type): Ensure that we return the correct
9730         type when we have out or ref parameters [in which case we 
9731         append a "&"].
9732
9733 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
9734
9735         * class.cs (Property, Indexer): Allow extern modifier in there. 
9736
9737         * typemanager.cs (InitBaseTypes): Initializes object_type and
9738         value_type, since those will be used early on during the bootstrap
9739         process to compile corlib.
9740
9741         (InitCoreTypes): Move code from here to InitBaseTypes.
9742
9743 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
9744
9745         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
9746         single-dimension arrays as using the ldlen opcode.  
9747
9748         Daniel Lewis discovered this optimization.  
9749
9750         * typemanager.cs: Add signature for System.Array::get_Length
9751
9752 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9753
9754         * statement.cs: report the error when the foreach does not apply to an
9755         array nor a collection.
9756
9757 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
9758
9759         * expression.cs: Add implicit conversions to the operator ~.
9760
9761         * constant.cs (DecimalConstant.Emit): Emit decimal value.
9762
9763         * typemanager.cs: Locate the decimal constructor.
9764
9765 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9766
9767         * attribute.cs: use the new property of TypeOf.
9768         * expression.cs: added 'get' property around typearg.
9769
9770         These changes fix a build breaker reported by NickD. Is this the
9771         correct way to fix?  If not, please, revert my changes and make it
9772         work :-).
9773
9774 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
9775
9776         * attribute.cs: Add support for typeof in attribute invocations.
9777         I am not sure that this is right though.
9778
9779 2002-04-14  Duncan Mak  <duncan@ximian.com>
9780
9781         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
9782         Binary.Operator.Division case.
9783
9784 2002-04-13  Ravi Pratap  <ravi@ximian.com>
9785
9786         * class.cs (DefineType): Ensure that we do a proper check on
9787         attribute types and also register it with the TypeManager.
9788
9789         (TypeContainer.Targets): The default for attribute types is
9790         AttributeTargets.All.
9791
9792         * attribute.cs (ApplyAttributes): Registering the attribute type
9793         is done elsewhere, not when we discover we have a Usage attribute.
9794
9795 2002-04-12  Ravi Pratap  <ravi@ximian.com>
9796
9797         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
9798         and get rid of is_delegate parameter.
9799
9800         * everywhere : update.
9801
9802 2002-04-12  Ravi Pratap  <ravi@ximian.com>
9803
9804         * cs-parser.jay (compilation_unit): Revamp completely to use
9805         some new ideas that I got from Rhys' grammar to solve the problems
9806         with assembly level attributes.
9807
9808         (outer_declaration): New grammar production.
9809
9810         (attribute_sections): Add.
9811
9812         (opt_attributes): Base on attribute_sections
9813
9814         (namespace_declaration): Allow opt_attributes to tackle the case
9815         when we have assembly level attributes - we are clever in this
9816         regard now ;-)
9817
9818         * attribute.cs (ApplyAttributes): Do not worry about assembly 
9819         attributes in the non-global context.
9820
9821         * rootcontext.cs (AddGlobalAttributes): Go back to using this
9822         instead of SetGlobalAttributes.
9823
9824         * class.cs, rootcontext.cs : Ensure we define and generate 
9825         attribute types before anything else.
9826
9827         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
9828         and flag the new error -20 for the case when the attribute type
9829         does not have valid targets specified. csc does not catch this.
9830
9831         * ../errors/errors.txt : update for error # -20
9832
9833 2002-04-11  Ravi Pratap  <ravi@ximian.com>
9834
9835         * support.cs (InternalParameters.ParameterModifier): Do some null
9836         checking and return sane values.
9837
9838         * class.cs (Method.Define): If we are a PInvoke method, ensure
9839         that we are static and extern. Report error # 601
9840
9841         * ../errors/cs0601.cs : Add test case for the above error.
9842
9843 2002-04-07  Ravi Pratap  <ravi@ximian.com>
9844
9845         * rootcontext.cs (attribute_types): We need to keep type of
9846         all attribute types separately and emit code for them first.
9847
9848         (RegisterAttribute) : Implement.
9849
9850         * class.cs (DefineType): Check if the current Type is a custom
9851         attribute type and register it accordingly.
9852
9853         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
9854         adding the first attribute twice and rename to
9855
9856         (SetGlobalAttributes): this.
9857
9858         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
9859         lookups.
9860
9861         * attribute.cs (ApplyAttributes): Take an additional argument telling us
9862         if we are processing global arguments. Hmm, I am unsure of this.
9863
9864 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9865
9866         * expression.cs: added static array of strings to avoid calling
9867         Enum.ToString () for Operator in Binary. Significant recover of
9868         performance.
9869
9870 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
9871
9872         * class.cs (FindMembers): Allow the Builders of the various
9873         members to be null.  If they are skip them.  This only happens
9874         during the PInvoke declaration.
9875
9876 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
9877
9878         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
9879         failure, so we do not keep going afterwards.
9880
9881         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
9882         wanted to pass `false' as the `is_delegate' argument.  If this is
9883         the case, why not use delegate_type == null to mean `is_delegate =
9884         false' and anything else as is_delegate = true.
9885
9886 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
9887
9888         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
9889         code for the section, not the beginning of the tests.
9890
9891 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
9892
9893         * cfold.cs: Handle operator + (Enum x, Underlying x) 
9894
9895         * expression.cs (Binary): same.  Warn about errors where we have
9896         Enum/Enum in operator + as well.
9897
9898 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
9899
9900         * statement.cs:
9901                 - added support for switch(bool)
9902                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
9903                 - add TableSwitchEmit() to handle table-based switch statements
9904
9905 2002-04-05  Ravi Pratap  <ravi@ximian.com>
9906
9907         * expression.cs (Invocation.OverloadResolve): Factor out code which
9908         does parameter compatibility checking with arguments so that we can 
9909         re-use the code even from Delegate.VerifyApplicability
9910
9911         (VerifyArgumentsCompat): Move above code here.
9912
9913         * delegate.cs (VerifyApplicability): Get rid of duplicate code
9914         and instead make a call to the above method.
9915
9916 2002-03-31  Ravi Pratap  <ravi@ximian.com>
9917
9918         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
9919         We use it to keep track of classes which are attribute types.
9920
9921 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
9922
9923         * delegate.cs (Delegate.Define): Correctly define the types in the
9924         presence of fixed and array parameters.
9925
9926         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
9927         doing FindMembers.
9928
9929         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
9930         include NonPublic after the first iteration.
9931
9932         * class.cs (Indexer.CheckBase): Only check if both parents are
9933         non-null. 
9934
9935         * cs-parser.jay (accessor_body): If empty, set to null.
9936
9937         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
9938         same code path here to resolve constants names that we did have in
9939         MemberAccess.DoResolve.  There is too much code duplicated here.
9940
9941 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
9942
9943         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
9944
9945         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
9946         to MakeUnionSet.
9947
9948         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
9949         tokens, numbers and strings.
9950
9951         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
9952         parenthesis.
9953
9954         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
9955         asyncronous parameters and the regular parameters.  
9956
9957         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
9958         specify the target directory.
9959
9960         * expression.cs: (This.DoResolve): Simplify
9961         (As.Emit): Optimize, do not generate IsInst if the expression is
9962         always of the given type.
9963
9964         (Is.DoResolve): Bug fix, we were reporting both always/never for
9965         the is expression.
9966
9967         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
9968         creating too many unnecessary arrays.
9969
9970 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
9971
9972         * class.cs (EmitFieldInitializer): Use Assign expression to assign
9973         fields instead of rolling our own initializer.   Takes care of all
9974         implicit conversions, and drops unnecessary static checks/argument.
9975
9976 2002-03-31  Dick Porter  <dick@ximian.com>
9977
9978         * driver.cs: use the GetDirectories() return values properly, and
9979         use "/" as path separator.
9980
9981 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
9982
9983         * expression.cs (Unary): Optimize - - expr into expr.
9984         (Binary): Optimize a + (-b) into a -b.
9985
9986         * codegen.cs (CodeGen): Made all methods static.
9987
9988 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
9989
9990         * rootcontext.cs: 
9991
9992         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
9993         TypeBuilder property.
9994
9995         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
9996         instead. 
9997
9998         * tree.cs: Removed the various RecordXXXX, and replaced with a
9999         single RecordDecl.  Removed all the accessor methods, and just
10000         left a single access point Type 
10001
10002         * enum.cs: Rename DefineEnum to DefineType.
10003
10004         * decl.cs: New abstract method `DefineType' used to unify the
10005         Defines for Enumerations, Interfaces, TypeContainers and
10006         Delegates.
10007
10008         (FindType): Moved LookupInterfaceOrClass here.  Moved the
10009         LookupBaseClasses method that used to live in class.cs and
10010         interface.cs here, and renamed to FindType.
10011
10012         * delegate.cs: Implement DefineType.  Take advantage of the
10013         refactored pattern for locating the parent builder without taking
10014         the parent_builder argument (which we know does not work if we are
10015         nested, and triggering a toplevel definition).
10016
10017 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10018
10019         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
10020         accessibility of a member has changed during override and report
10021         an error if so.
10022
10023         * class.cs (Method.Define, Property.Define): Only complain on
10024         overrides if the method is private, any other accessibility is
10025         fine (and since we just checked the permission is the same, we are
10026         good to go).
10027
10028         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
10029         and elif are processed always.  The other pre-processing
10030         directives are only processed if we are "taking" the path
10031
10032 2002-03-29  Martin Baulig  <martin@gnome.org>
10033
10034         * class.cs (Method.Emit): Only emit symbolic debugging info if the
10035         current location is not Null.
10036
10037         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
10038         a separate method so we can profile it.
10039
10040         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
10041         `span.Seconds' are just seconds, but no minutes or hours.
10042         (MainDriver): Profile the CodeGen.SaveSymbols calls.
10043
10044 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10045
10046         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
10047         Remove the gratuitous set of Final:
10048
10049                                 // If an interface implementation, then we can set Final.
10050                                 if (((flags & MethodAttributes.Abstract) == 0) &&
10051                                     implementing.DeclaringType.IsInterface)
10052                                         flags |= MethodAttributes.Final;
10053
10054         I do not know what I was smoking when I used that.
10055
10056
10057         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
10058         step into fixing the name resolution issues for delegates and
10059         unifying the toplevel name resolution.
10060
10061 2002-03-28  Martin Baulig  <martin@gnome.org>
10062
10063         * class.cs (Method.Emit): If we have a symbol writer, call its
10064         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
10065         tell it about the current method.
10066
10067         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
10068         writer that we're going to emit the first byte of IL code for a new
10069         statement (a new source line).
10070         (EmitContext.EmitTopBlock): If we have a symbol writer, call
10071         EmitContext.Mark() before emitting any code.
10072
10073         * location.cs (SymbolDocument): Return null when we're Null.
10074
10075         * statement.cs (Statement): Moved the `Location loc' variable here.
10076         (Statement.EmitBoolExpression): If we have a symbol writer, call
10077         ec.Mark() before emitting any code to tell it that we're at the
10078         beginning of a new statement.
10079         (StatementExpression): Added `Location' argument to the constructor.
10080         (Block): Added public readonly variable `StartLocation' and public
10081         variable `EndLocation'.  The latter is to be set using SetEndLocation().
10082         (Block): Added constructor which takes a start and end location.
10083         (Block.SetEndLocation): New method. This sets the end location.
10084         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
10085         local variables we create.
10086         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
10087         each statement and do also mark the begin and end of the block.
10088
10089         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
10090         tell it the current lexer.Location, use Location.Null for the end of the
10091         block.
10092         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
10093         current block, set its end location using SetEndLocation().
10094         (statement_expression): StatementExpression constructor now takes the
10095         lexer.Location as additional argument.
10096         (for_statement, declare_local_variables): Likewise.
10097         (declare_local_variables): When creating a new implicit block, use the
10098         new Block constructor and pass it the lexer.Location.
10099
10100 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
10103         members also on the parent interfaces recursively.
10104
10105 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
10106
10107         * report.cs: Use new formats, since Gonzalo finished the missing
10108         bits. 
10109
10110         * expression.cs (Binary.ResolveOperator): added missing operator|
10111         operator& and operator^ for bool/bool.
10112
10113         * cs-parser.jay: CheckDef now takes a Location argument that is
10114         used to report errors more precisly (instead of reporting the end
10115         of a definition, we try to track something which is a lot closer
10116         to the source of the problem).
10117
10118         * cs-tokenizer.cs: Track global token use, so we can properly flag
10119         the use of #define/#undef after the first token has been seen.
10120
10121         Also, rename the reportXXXX to Error_DescriptiveName
10122
10123         * decl.cs (DeclSpace.IsTopLevel): Move property here from
10124         TypeContainer, so that Enum and Interface can use this too.
10125
10126         * class.cs (TypeContainer.LookupInterfaceOrClass,
10127         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
10128         `builder' argument.  Typically this was used to pass the parent
10129         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
10130         the definition).  
10131
10132         The problem is that a nested class could trigger the definition of
10133         a toplevel class, and the builder would be obviously wrong in that
10134         case. 
10135
10136         So we drop this argument, and we compute dynamically the
10137         TypeBuilder/ModuleBuilder (the correct information was available
10138         to us anyways from DeclSpace.Parent)
10139
10140         * interface.cs (Interface.DefineInterface): Drop builder
10141         parameter cleanup like class.cs
10142
10143         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
10144         like class.cs
10145
10146         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
10147         values. 
10148
10149         (Try.Emit): Propagate the returns value from the statement.
10150
10151         (Return.Emit): Even if we are leavning 
10152
10153         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
10154
10155         * modifiers.cs: Fix the computation of MethodAttributes flags.
10156
10157 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
10158
10159         * driver.cs: allow compilation of files that start with '/'.
10160         Add a default case when checking the argument of --target.
10161
10162 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
10163
10164         * interface.cs: Implement the same search algorithm for types in
10165         the interface code.
10166
10167         * delegate.cs: Do not allow multiple definition.
10168
10169         * Recovered ChangeLog that got accidentally amputated
10170
10171         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
10172
10173         * rootcontext.cs: Load manually enum to allow core classes to
10174         contain enumerations.
10175
10176         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
10177         Update to new static methods in TypeManager.
10178
10179         * typemanager.cs (GetMethod, GetConstructor): Use our
10180         implementation of FindMembers to find the members, since during
10181         corlib compilation, the types are TypeBuilders and GetMethod and
10182         GetConstructor do not work.
10183
10184         Make all methods in TypeManager static.
10185
10186         (InitCodeHelpers): Split the functionality from
10187         the InitCodeTypes function.
10188
10189         * driver.cs: Call InitCodeHelpers after we have populated the
10190         types. 
10191
10192         * cs-parser.jay (delegate_declaration): we did not used to compute
10193         the delegate name correctly for void delegates.
10194
10195 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
10196
10197         * rootcontext.cs (RootContext): Init the interface_resolve_order
10198         and type_container_resolve_order always.
10199
10200         (ResolveCore, BootstrapCorlib_ResolveClass,
10201         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
10202         compiler when compiling with --nostdlib
10203
10204         * class.cs (TypeContainer.DefineType): Check that our parent is
10205         not null.  This test is most important when we are bootstraping
10206         the core types.
10207
10208         * codegen.cs: Split out the symbol writing code.
10209
10210 2002-03-25  Martin Baulig  <martin@gnome.org>
10211
10212         * driver.cs (-g): Made -g an alias for --debug.
10213
10214 2002-03-24  Martin Baulig  <martin@gnome.org>
10215
10216         * codegen.cs (SymbolWriter): New public variable. Returns the
10217         current symbol writer.
10218         (CodeGen): Added `bool want_debugging_support' argument to the
10219          constructor. If true, tell the ModuleBuild that we want debugging
10220         support and ask it for the ISymbolWriter.
10221         (Save): If we have a symbol writer, call it's Close() method after
10222         saving the assembly.
10223
10224         * driver.c (--debug): New command line argument to create a
10225         debugger information file.
10226
10227         * location.cs (SymbolDocument): New public property. Returns an
10228         ISymbolDocumentWriter object for the current source file or null
10229         if we don't have a symbol writer.
10230
10231 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
10232
10233         * driver.cs (LoadAssembly): Correctly return when all the paths
10234         have been tried and not before.
10235
10236         * statement.cs (Switch.Emit): return the actual coverage for this
10237         statement (returns/not-returns)
10238
10239         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
10240         switch of the statement if we are the last switch section.  That
10241         kills two problems: try/catch problems (we used to emit an empty
10242         nop at the end) and switch statements where all branches would
10243         return. 
10244
10245 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
10246
10247         * driver.cs: Add default assemblies (the equivalent to the
10248         Microsoft CSC.RSP file)
10249
10250         * cs-tokenizer.cs: When updating `cols and setting it to zero,
10251         also update tokens_seen and set it to false.
10252
10253         * driver.cs: Implement --recurse for Mike.
10254
10255         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
10256         correctly splitting out the paths.
10257
10258 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
10259
10260         * interface.cs (Interface.PopulateProperty): Instead of using
10261         `parent' as the declaration space for the set parameters, use
10262         `this' 
10263
10264         * support.cs (InternalParameters): InternalParameters constructor
10265         takes a DeclSpace instead of a TypeContainer.
10266
10267         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
10268         types are being initialized, load the address of it before calling
10269         the function.  
10270
10271         (New): Provide a mechanism to disable the generation of local
10272         value type temporaries when the caller will be providing us with
10273         an address to store it.
10274
10275         (ArrayCreation.EmitDynamicInitializers): Use it.
10276
10277 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * expression.cs (Invocation.EmitArguments): Only probe for array
10280         property if there is more than one argument.  Sorry about that.
10281
10282         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
10283         empty param arrays.
10284
10285         * class.cs (Method.LabelParameters): Fix incorrect code path that
10286         prevented the `ParamArrayAttribute' from being applied to the
10287         params attribute.
10288
10289 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
10290
10291         * support.cs (ReflectionParameters): Correctly compute whether the
10292         last argument is a params array.  Fixes the problem with
10293         string.Split ('a')
10294
10295         * typemanager.cs: Make the assemblies array always be non-null
10296         (empty, but non-null)
10297
10298         * tree.cs (RecordDecl): New function that abstracts the recording
10299         of names.  This reports error 101, and provides a pointer to the
10300         previous declaration.  Fixes a crash in the compiler.
10301
10302         * cs-parser.jay (constructor_declaration): Update to new grammar,
10303         and provide a constructor_body that can be empty.
10304
10305 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
10306
10307         * driver.cs: Add support for --resources.
10308
10309         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
10310         Make all types for the various array helper methods be integer.
10311
10312         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
10313         CheckState to ConvCast.
10314
10315         (ConvCast): Now it takes a `checked' state argument, to avoid
10316         depending on the emit context for the conversion, and just using
10317         the resolve time setting.
10318
10319         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
10320         instead of Invocation.EmitArguments.  We do not emit the original
10321         arguments, instead we emit those which have been converted to
10322         unsigned int expressions.
10323
10324         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
10325
10326         * codegen.cs: ditto.
10327
10328         * expression.cs (LocalVariableReference): Drop the use of the
10329         Store function that depended on the variable index.
10330
10331         * statement.cs (VariableInfo): Drop the `Idx' property from this
10332         class, as this is not taking into account the indexes for
10333         temporaries tat we generate during the execution, getting the
10334         indexes wrong.
10335
10336         * class.cs: First emit class initializers, then call the parent
10337         constructor. 
10338
10339         * expression.cs (Binary): Fix opcode emision.
10340         (UnaryMutator.EmitCode): Support checked code generation
10341
10342         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
10343         matches for events for both the Static and Instance scans,
10344         pointing to the same element.   Fix that.
10345
10346 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
10347
10348         * rootcontext.cs (ResolveTree): Always set the
10349         interface_resolve_order, because nested interfaces will be calling
10350         into us.
10351
10352         * class.cs (GetInterfaceOrClass): Track the same resolution
10353         process used by TypeManager.LookupType.  This fixes the nested
10354         type lookups in class declarations (separate path from
10355         LookupType). 
10356
10357         (TypeContainer.DefineType): Also define nested interfaces.
10358         (TypeContainer.RegisterOrder): New public function used to
10359         register the order in which child interfaces need to be closed.
10360
10361         Nested interfaces need to be closed after their parents have been
10362         created. 
10363
10364         * interface.cs (InterfaceAttr): Put all the logic for computing
10365         the interface attribute here. 
10366
10367         (DefineInterface): Register our interface order with the
10368         RootContext or with the TypeContainer depending on the case.
10369
10370 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
10371
10372         * cs-parser.jay: rework foreach statement to work with the new
10373         changes to the policy on SimpleNames.
10374
10375         * report.cs: support Stacktrace on warnings as well.
10376
10377         * makefile: drop --unsafe and /unsafe from the compile.
10378
10379 2002-03-13  Ravi Pratap  <ravi@ximian.com>
10380
10381         * ecore.cs (StandardConversionExists): Modify to take an Expression
10382         as the first parameter. Ensure we do null -> reference type conversion
10383         checking.
10384
10385         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
10386         temporary Expression objects.
10387
10388 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
10389
10390         * interface.cs: workaround bug in method overloading resolution
10391         (there is already a bugzilla bug for it).
10392
10393 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
10394
10395         We could also solve this problem by having a separate path for
10396         performing type lookups, instead of DoResolve, we could have a
10397         ResolveType entry point, and only participating pieces of the
10398         production (simplename, deref, array) would implement this. 
10399
10400         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
10401         signal SimpleName to only resolve type names and not attempt to
10402         resolve anything else.
10403
10404         * expression.cs (Cast): Set the flag.
10405
10406         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
10407
10408         * class.cs: Only report 108 if there is no `new' modifier.
10409
10410         * cs-parser.jay: rework foreach statement to work with the new
10411         changes to the policy on SimpleNames.
10412         
10413         * report.cs: support Stacktrace on warnings as well.
10414
10415         * makefile: drop --unsafe and /unsafe from the compile.
10416
10417 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
10418
10419         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
10420         lookups here, instead of doing that at parse time.  This means
10421         that our grammar will not introduce `LocalVariableReferences' as
10422         expressions at this point.  That solves the problem of code like
10423         this:
10424
10425         class X {
10426            static void Main ()
10427            { int X = 1;
10428             { X x = null }}}
10429
10430         This is only half the fix.  The full fix requires parameters to
10431         also be handled in this way.
10432
10433         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
10434         makes the use more obvious of the DeclSpace.  The
10435         ec.TypeContainer.TypeBuilder is now only used to pull the
10436         TypeBuilder for it.
10437
10438         My theory is that I can get rid of the TypeBuilder completely from
10439         the EmitContext, and have typecasts where it is used (from
10440         DeclSpace to where it matters).  
10441
10442         The only pending problem is that the code that implements Aliases
10443         is on TypeContainer, and probably should go in DeclSpace.
10444
10445         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
10446         lookups here, instead of doing that at parse time.  This means
10447         that our grammar will not introduce `LocalVariableReferences' as
10448         expressions at this point.  That solves the problem of code like
10449         this:
10450
10451         class X {
10452            static void Main ()
10453            { int X = 1;
10454             { X x = null }}}
10455
10456         This is only half the fix.  The full fix requires parameters to
10457         also be handled in this way.
10458
10459         * class.cs (Property.DefineMethod): When implementing an interface
10460         method, set newslot, when implementing an abstract method, do not
10461         set the flag (before we tried never setting it, or always setting
10462         it, which is the difference).
10463         (Indexer.DefineMethod): same.
10464         (Method.DefineMethod): same.
10465
10466         * ecore.cs: Only set the status used flag if we get back a Field.
10467
10468         * attribute.cs: Temporary hack, so Paolo can keep working.
10469
10470 2002-03-08  Ravi Pratap  <ravi@ximian.com>
10471
10472         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
10473         the unmanaged type in the case we have a MarshalAs attribute.
10474
10475         (Resolve): Handle the case when we are parsing the special MarshalAs
10476         attribute [we need to store the unmanaged type to use later]
10477
10478         * typemanager.cs (marshal_as_attr_type): Built in type for the 
10479         MarshalAs Attribute.
10480
10481         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
10482         on parameters and accordingly set the marshalling info.
10483
10484 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
10485
10486         * class.cs: Optimizing slightly by removing redundant code after
10487         we switched to the `NoTypes' return value.
10488         (Property.DefineMethod): use NoTypes here too.
10489
10490         This fixes the bug I introduced in my last batch of changes.
10491
10492 2002-03-05  Ravi Pratap  <ravi@ximian.com>
10493
10494         * tree.cs (RecordEnum): Add. We now keep track of enums too.
10495
10496         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
10497         Enums since those are types too. 
10498
10499         * cs-parser.jay (enum_declaration): Record enums as we parse them.
10500
10501         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
10502         thanks to a call during the lookup process.
10503
10504 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
10505
10506         * statement.cs (Foreach): Lots of work to accomodate a particular
10507         kind of foreach statement that I had not kept in mind.  It is
10508         possible to have foreachs on classes that provide a GetEnumerator
10509         method that return objects that implement the "pattern" for using
10510         a foreach, there is no need to support GetEnumerator
10511         specifically. 
10512
10513         This is needed to compile nant.
10514
10515         * decl.cs: Only report 114 if the member is not `Finalize' and if
10516         the warning level is at least 2.
10517
10518         * class.cs: Moved the compare function from Method to
10519         MethodSignature. 
10520
10521         (MethodSignature.InheritableMemberSignatureCompare): Add new
10522         filter function that is used to extract inheritable methods from a
10523         class. 
10524
10525         (Method.Define): Use the new `inheritable_method_signature_filter'
10526         delegate
10527
10528         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
10529         command. 
10530
10531 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
10532
10533         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
10534
10535         * cs-parser.jay: Add opt_semicolon to the interface declaration.
10536
10537         * expression.cs: Pass location information to
10538         ConvertImplicitStandard. 
10539
10540         * class.cs: Added debugging code to track return values from
10541         interfaces. 
10542
10543 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * expression.cs (Is.DoResolve): If either side of the `is' is an
10546         interface, do not flag the warning.
10547
10548         * ecore.cs (ImplicitReferenceConversion): We need a separate test
10549         for interfaces
10550
10551         * report.cs: Allow for --fatal to be used with --probe.
10552
10553         * typemanager.cs (NoTypes): Move the definition for the empty Type
10554         array here. 
10555
10556         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
10557         properties. 
10558         (TypeContainer.DefineProxy): New function used to proxy to parent
10559         implementations when implementing interfaces.
10560         (TypeContainer.ParentImplements): used to lookup if our parent
10561         implements a public function that is required by an interface.
10562         (TypeContainer.VerifyPendingMethods): Hook this up.
10563
10564         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
10565         `modules' and `assemblies' arraylists into arrays.  We only grow
10566         these are the very early start up of the program, so this improves
10567         the speedof LookupType (nicely measured).
10568
10569         * expression.cs (MakeByteBlob): Replaced unsafe code with
10570         BitConverter, as suggested by Paolo.
10571
10572         * cfold.cs (ConstantFold.Binary): Special case: perform constant
10573         folding of string concatenation, but if either side is a string,
10574         and the other is not, then return null, and let the runtime use
10575         the concatenation on the string plus the object (using
10576         `Object.ToString'). 
10577
10578 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
10579
10580         Constant Folding has been implemented now.
10581
10582         * expression.cs (Unary.Reduce): Do not throw an exception, catch
10583         the error instead on types that are not supported in one's
10584         complement. 
10585
10586         * constant.cs (Constant and all children): New set of functions to
10587         perform implict and explicit conversions.
10588
10589         * ecore.cs (EnumConstant): Implement the new functions to perform
10590         conversion by proxying to the child expression.
10591
10592         * codegen.cs: (ConstantCheckState): Constant evaluation has its
10593         own separate setting that can not be turned off from the command
10594         line using --unchecked or --checked and is only controlled using
10595         the checked/unchecked statements and expressions.  This setting is
10596         used by the constant folder to flag errors.
10597
10598         * expression.cs (CheckedExpr, UncheckedExpr): Set the
10599         ConstantCheckState as well.   
10600
10601         During Resolve, they also have to flag the state, because the
10602         constant folder runs completely in the Resolve phase.
10603
10604         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
10605         well.
10606
10607 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
10608
10609         * cfold.cs: New file, this file contains the constant folder.
10610
10611         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
10612         argument to track whether we are using the resulting address to
10613         load or store a value and provide better error messages. 
10614
10615         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
10616         new AddressOf arguments.
10617
10618         * statement.cs (Foreach.EmitCollectionForeach): Update
10619
10620         * expression.cs (Argument.Emit): Call AddressOf with proper
10621         arguments to track usage.
10622
10623         (New.DoEmit): Call AddressOf with new arguments.
10624
10625         (Unary.Emit): Adjust AddressOf call.
10626
10627 2002-03-01  Ravi Pratap  <ravi@ximian.com>
10628
10629         * cs-parser.jay (member_access): Change the case for pre-defined types
10630         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
10631         this suggestion.
10632
10633         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
10634         a method body.
10635
10636         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
10637         essentially like methods and apply attributes like MethodImplOptions to them too.
10638
10639         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
10640         not being null.
10641
10642         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
10643         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
10644         is the DeclSpace.
10645
10646         * Update code everywhere accordingly.
10647
10648         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
10649
10650         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
10651
10652 2002-02-28  Ravi Pratap  <ravi@ximian.com>
10653
10654         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
10655         try performing lookups against those instead of jumping straight into using
10656         the 'using' clauses.
10657
10658         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
10659
10660         (LookupType): Perform lookups in implicit parents too.
10661
10662         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
10663         sequence as RootContext.LookupType. 
10664
10665         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
10666         the various cases of namespace lookups into this method.
10667
10668 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
10669
10670         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
10671         in positional arguments)
10672
10673         * class.cs (Operator): Update the AllowedModifiers to contain
10674         extern. 
10675
10676         * cs-parser.jay: Update operator declaration to allow for the
10677         operator body to be empty.
10678
10679         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
10680         values. 
10681
10682 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * class.cs (Method.Emit): Label parameters.
10685
10686         * driver.cs: Return 1 or 0 as the program exit code.
10687
10688 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
10689
10690         * expression.cs: Special case the `null' object when trying to
10691         auto-compute the type, as anything can be explicitly converted to
10692         that. 
10693
10694         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
10695         spotting this Paolo.
10696
10697         (Expression.ImplicitNumericConversion): Perform comparissions of
10698         the type using the underlying type in the case of an enumeration
10699         rather than using the enumeration type for the compare.
10700
10701         Cope with the underlying == type case, which is not possible to
10702         catch before. 
10703
10704         (Expression.ConvertNumericExplicit): Perform comparissions of
10705         the type using the underlying type in the case of an enumeration
10706         rather than using the enumeration type for the compare.
10707
10708         * driver.cs: If the user does not supply an extension, assume .exe
10709
10710         * cs-parser.jay (if_statement): Rewrote so that we can track the
10711         location for the if statement.
10712
10713         * expression.cs (Binary.ConstantFold): Only concat strings when
10714         the operation is "+", not everything ;-)
10715
10716         * statement.cs (Statement.EmitBoolExpression): Take a location
10717         argument. 
10718         (If, While, Do): Track location.
10719
10720         * expression.cs (Binary.ResolveOperator): In the object + string
10721         case, I was missing a call to ConvertImplicit
10722
10723 2002-02-25  Ravi Pratap  <ravi@ximian.com>
10724
10725         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
10726         Location arguments. Ensure we use RootContext.LookupType to do our work
10727         and not try to do a direct Type.GetType and ModuleBuilder.GetType
10728
10729         * interface.cs (PopulateMethod): Handle the type of the parameter being
10730         null gracefully.
10731
10732         * expression.cs (Invocation.BetterFunction): Handle the case when we 
10733         have a params method with no fixed arguments and a call is made with no
10734         arguments.
10735
10736 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
10737
10738         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
10739         the verbatim-string-literal
10740
10741         * support.cs (InternalParameters.ParameterModifier): handle null
10742         fixed parameters.
10743         (InternalParameters.ParameterType): ditto.
10744
10745         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
10746         duplicating the name of the variable parameter.
10747         (GetParameterByName): Fix bug where we were not looking up array
10748         paramters if they were the only present (thanks Paolo!).
10749         (GetParameterInfo): We only have an empty set of types if both
10750         fixed and array are set to null.
10751         (GetParameterInfo-idx): Handle FixedParameter == null
10752
10753         * cs-parser.jay: Handle the case where there is no catch
10754         statements (missing null test).
10755
10756 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
10757
10758         * driver.cs (MainDriver): Be conservative on our command line
10759         handling.
10760
10761         Catch DirectoryNotFoundException when calling GetFiles.
10762
10763         (SplitPathAndPattern): Used to split the input specification into
10764         a path and a pattern that we can feed to Directory.GetFiles.
10765
10766 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
10767
10768         * statement.cs (Fixed): Implement the last case of the Fixed
10769         statement (string handling).
10770
10771         * expression.cs (StringPtr): New class used to return a char * to
10772         a string;  Used by the Fixed statement.
10773
10774         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
10775
10776         * expression.cs (Binary.ResolveOperator): Remove redundant
10777         MemberLookup pn parent type.
10778         Optimize union call, we do not need a union if the types are the same.
10779         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
10780         type.
10781
10782         Specialize the use of MemberLookup everywhere, instead of using
10783         the default settings. 
10784
10785         (StackAlloc): Implement stackalloc keyword.
10786
10787         * cs-parser.jay: Add rule to parse stackalloc.
10788
10789         * driver.cs: Handle /h, /help, /?
10790
10791         * expression.cs (MakeByteBlob): Removed the hacks we had in place
10792         before we supported unsafe code.
10793
10794         * makefile: add --unsafe to the self compilation of mcs.
10795
10796 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * expression.cs (PointerArithmetic): New class that is used to
10799         perform pointer arithmetic.
10800         (Binary.Resolve): Handle pointer arithmetic
10801         Handle pointer comparission.
10802         (ArrayPtr): Utility expression class that is used to take the
10803         address of an array.
10804
10805         (ElementAccess): Implement array access for pointers
10806
10807         * statement.cs (Fixed): Implement fixed statement for arrays, we
10808         are missing one more case before we are done.
10809
10810         * expression.cs (Indirection): Implement EmitAssign and set the
10811         ExprClass to Variable.  This allows pointer dereferences to be
10812         treated as variables, and to have values assigned to them.
10813
10814         * ecore.cs (Expression.StoreFromPtr): New utility function to
10815         store values dereferencing.
10816
10817 2002-02-20  Ravi Pratap  <ravi@ximian.com>
10818
10819         * expression.cs (Binary.ResolveOperator): Ensure that we are
10820         not trying to operate on a void type - this fixes the reported
10821         bug.
10822
10823         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
10824         the parent implementation is sealed.
10825
10826         * ../errors/cs0239.cs : Add.
10827
10828         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
10829
10830         * typemanager.cs (unverifiable_code_type): Corresponds to 
10831         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
10832         which have unsafe code in them.
10833
10834         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
10835         unsafe context.
10836
10837 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
10838
10839         * cs-tokenizer.cs: Add support for @"litreal strings"
10840
10841         Make tokenizer accept pre-processor directives
10842         on any column (remove the old C-like limitation). 
10843
10844         * rootcontext.cs (EmitCode): Emit any global attributes.
10845         (AddGlobalAttributes): Used to keep track of assembly attributes. 
10846
10847         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
10848
10849         * cs-parser.jay: Add support for global attributes.  
10850
10851 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
10852
10853         * expression.cs (Indirection): New helper class.  Unary will
10854         create Indirection classes to be able to implement the
10855         IMemoryLocation interface on it.
10856
10857 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
10858
10859         * cs-parser.jay (fixed_statement): reference the right statement.
10860
10861         * statement.cs (Fixed.Emit): Finish implementing the fixed
10862         statement for the &x case.
10863
10864 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
10865
10866         * class.cs (Property.Define, Method.Define): Remove newslot when
10867         `implementing'.  
10868
10869         * modifiers.cs: My use of NewSlot when `Abstract' was set was
10870         wrong.  NewSlot should only be used if the `new' keyword is present.
10871
10872         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
10873         locating our system dir.  Sorry about this.
10874
10875 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
10876
10877         * driver.cs (GetSystemDir): Compute correctly the location of our
10878         system assemblies.  I was using the compiler directory instead of
10879         the library directory.
10880
10881 2002-02-13  Ravi Pratap  <ravi@ximian.com>
10882
10883         * expression.cs (BetterFunction): Put back in what Miguel commented out
10884         since it is the correct fix. The problem is elsewhere ;-)
10885
10886         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
10887         parameters of the parms method are themselves compatible or not !
10888
10889         (StandardConversionExists): Fix very dangerous bug where we were forgetting
10890         to check that a class implements an interface before saying that an implicit
10891         conversion was allowed. Use ImplementsInterface to do the checking.
10892
10893 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
10894
10895         * class.cs (Method.Define): Track whether we are an explicit
10896         implementation or not.  And only call DefineMethodOverride if we
10897         are an explicit implementation.
10898
10899         (Property.DefineMethod): Ditto.
10900
10901 2002-02-11  Ravi Pratap  <ravi@ximian.com>
10902
10903         * expression.cs (BetterFunction): Catch hideous bug which was
10904          preventing us from detecting ambiguous calls due to implicit casts i.e
10905         cs0121.
10906
10907 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
10908
10909         * support.cs (Pair): Remove un-needed method.  I figured why I was
10910         getting the error in cs-parser.jay, the variable in a foreach loop
10911         is readonly, and the compiler does not really treat this as a variable.
10912
10913         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
10914         instead of EQUALS in grammar.  
10915
10916         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
10917
10918         * expression.cs (Unary.DoResolve): Check whether the argument is
10919         managed or not.
10920
10921 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
10922
10923         * support.cs: Api for Pair to set a value.  Despite the fact that
10924         the variables are public the MS C# compiler refuses to compile
10925         code that accesses the field if the variable is part of a foreach
10926         statement. 
10927
10928         * statement.cs (Fixed): Begin implementation of the fixed
10929         statement.
10930
10931         (Block.AddVariable): Return the VariableInfo on success and null
10932         on failure instead of true/false. 
10933
10934         * cs-parser.jay (foreach): Catch errors on variables already
10935         defined (we were ignoring this value before) and properly unwind
10936         the block hierarchy
10937
10938         (fixed_statement): grammar for the fixed statement.
10939
10940 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
10941
10942         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
10943         pointer types to be incretemented.
10944
10945         (SizeOf): Implement.
10946
10947         * cs-parser.jay (pointer_member_access): Implement
10948         expr->IDENTIFIER production.
10949
10950         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
10951         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
10952         on safe contexts.
10953
10954         (Unary): Implement indirection.
10955
10956         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
10957         use in non-unsafe context).
10958
10959         (SimpleName.DoResolve): Check for pointers in field access on safe
10960         contexts. 
10961
10962         (Expression.LoadFromPtr): Factor the load-indirect code in this
10963         function.  This was duplicated in UnboxCast and ParameterReference
10964
10965 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
10966
10967         * expression.cs (ComposedCast): report an error if a pointer cast
10968         is used in a safe region.
10969
10970         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
10971         pointer type casts in unsafe context.
10972
10973         * codegen.cs (EmitContext): Set up IsUnsafe.
10974
10975         * cs-parser.jay (non_expression_type): Add productions for pointer
10976         casts. 
10977
10978         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
10979         code.  We should not use force into static mode if the method is
10980         not virtual.  Fixes bug in MIS
10981
10982         * statement.cs (Do.Emit, While.Emit, For.Emit,
10983         Statement.EmitBoolExpression): Add support to Do and While to
10984         propagate infinite loop as `I do return' semantics.
10985
10986         Improve the For case to also test for boolean constants.
10987
10988         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
10989         to the list of attributes we can add.
10990
10991         Remove `EmitContext' argument.
10992
10993         * class.cs (Method.Define): Apply parameter attributes.
10994         (Constructor.Define): Apply parameter attributes.
10995         (MethodCore.LabelParameters): Move here the core of labeling
10996         parameters. 
10997
10998         * support.cs (ReflectionParameters.ParameterModifier,
10999         InternalParameters.ParameterModifier): Use IsByRef on the type and
11000         only return the OUT bit for these parameters instead of in/out/ref
11001         flags.
11002
11003         This is because I miss-understood things.  The ParameterInfo.IsIn
11004         and IsOut represent whether the parameter has the [In] and [Out]
11005         attributes set.  
11006
11007 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * ecore.cs (FieldExpr.Emit): Release temporaries.
11010
11011         * assign.cs (LocalTemporary.Release): new function.
11012
11013         * codegen.cs (EmitContext.GetTemporaryStorage,
11014         EmitContext.FreeTemporaryStorage): Rework the way we deal with
11015         temporary storage.  Now we can "put back" localbuilders when we
11016         are done with them
11017
11018 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
11019
11020         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
11021         need to make a copy of the variable to generate verifiable code.
11022
11023 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
11024
11025         * driver.cs: Compute dynamically the system directory.
11026
11027         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
11028         Slower, but more generally useful.  Used by the abstract
11029         registering implementation. 
11030
11031         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
11032         the rules for the special rule on Type/instances.  First check if
11033         we have the same name, and if so, try that special static path
11034         rather than the instance path.
11035
11036 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
11037
11038         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
11039         for, while and if.
11040
11041         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
11042         Enum, ValueType, Delegate or Array for non-corlib compiles.
11043
11044         * cs-tokenizer.cs: Catch long identifiers (645)
11045
11046         * typemanager.cs (IndexerPropetyName): Ravi never tested this
11047         piece of code.
11048
11049         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
11050         fix, we were returning too early, so we were not registering
11051         pending methods from abstract classes.
11052
11053         Do not register pending methods if the class is abstract.
11054
11055         * expression.cs (Conditional.DoResolve): Report circular implicit
11056         conversions when we neecd to compute it for conditional
11057         expressions. 
11058
11059         (Is.DoResolve): If the expression is always of the provided type,
11060         flag warning 183.  If the expression can not ever be of the
11061         provided type flag warning 184.
11062
11063         * class.cs: Catch 169 as well.
11064
11065         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
11066         read. 
11067
11068 2002-01-18  Nick Drochak  <ndrochak@gol.com>
11069
11070         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
11071
11072 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
11073
11074         * interface.cs: (PopulateMethod): Check for pointers being defined
11075         only if the unsafe context is active.
11076         (PopulateProperty): ditto.
11077         (PopulateIndexer): ditto.
11078
11079         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
11080         specified.  If pointers are present, make sure that they are
11081         present in an unsafe context.
11082         (Constructor, Constructor.Define): ditto.
11083         (Field, Field.Define): ditto.
11084         (Property, Property.Define): ditto.
11085         (Event, Event.Define): ditto.
11086
11087         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
11088         hashtable if there are classes or structs defined.
11089
11090         * expression.cs (LocalVariableReference.DoResolve): Simplify this
11091         code, as the constant resolution moved.
11092
11093         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
11094         the metadata, so we can flag error 133. 
11095
11096         * decl.cs (MemberCore.UnsafeOK): New function to test that a
11097         pointer is being declared in an unsafe context.
11098
11099 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
11100
11101         * modifiers.cs (Modifiers.Check): Require a Location argument.
11102         Report error 227 for Unsafe use.
11103
11104         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
11105
11106         * statement.cs (For.Emit): If the test is null, then report that
11107         we do `return', as we wont reach anything afterwards.
11108
11109         (Switch.SwitchGoverningType): Track the expression that matched
11110         the conversion.
11111
11112         * driver.cs: Allow negative numbers as an error code to flag.
11113
11114         * cs-parser.jay: Handle 1551.
11115
11116         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
11117
11118 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
11119
11120         * cs-parser.jay: Report 1518 (type declaration can only contain
11121         class, struct, interface, enum or delegate)
11122
11123         (switch_label): Report 1523 (keywords `case' or `default' must
11124         preced code)
11125
11126         (opt_switch_sections): Report 1522 (empty switch)
11127
11128         * driver.cs: Report 1515 (response file specified multiple times)
11129         Report 1516 (Source file specified multiple times).
11130
11131         * expression.cs (Argument.Resolve): Signal 1510
11132
11133         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
11134         access not allowed in static code)
11135
11136 2002-01-11  Ravi Pratap  <ravi@ximian.com>
11137
11138         * typemanager.cs (IsPointerType): Utility method which we are going
11139         to need a lot.
11140
11141         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
11142         the object type, so we take care of that.
11143
11144         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
11145
11146         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
11147         added to non-params parameters :-)
11148
11149         * typemanager.cs (CSharpName): Include 'void' type too. 
11150
11151         (void_ptr_type): Include in the set of core types.
11152
11153         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
11154         duplicating code.
11155
11156         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
11157         an unsafe context.
11158
11159         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
11160         completely forgotten about it.
11161
11162 2002-01-10  Ravi Pratap  <ravi@ximian.com>
11163
11164         * cs-parser.jay (pointer_type): Add. This begins our implementation
11165         of parsing rules for unsafe code.
11166
11167         (unsafe_statement): Implement.
11168
11169         (embedded_statement): Modify to include the above.
11170
11171         * statement.cs (Unsafe): Implement new class for unsafe blocks.
11172
11173         * codegen.cs (EmitContext.InUnsafe): Add. This determines
11174         if the current context is an unsafe one.
11175
11176         * cs-parser.jay (local_variable_pointer_type): Since local variable types
11177         are handled differently, we need separate rules for them.
11178
11179         (local_variable_declaration): Update to use local_variable_pointer_type
11180         to allow variable declarations of unmanaged pointer types.
11181
11182         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
11183         in unsafe contexts.
11184
11185         * ../errors/cs0214.cs : Add.
11186
11187 2002-01-16  Nick Drochak  <ndrochak@gol.com>
11188
11189         * makefile: remove 'response' file when cleaning.
11190
11191 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
11192
11193         * cs-parser.jay: Report 1524.
11194
11195 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
11196
11197         * typemanager.cs (RegisterMethod): drop checking if we have
11198         registered this from here
11199
11200 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
11201
11202         * class.cs (Method.EmitDestructor): Implement calling our base
11203         destructor. 
11204
11205         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
11206         value of InFinally.
11207
11208         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
11209         this routine and will wrap the call in a try/catch block.  Deal
11210         with the case.
11211
11212 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
11213
11214         * ecore.cs (Expression.MemberLookup): instead of taking a
11215         parameter `same_type' that was used to tell whether we could
11216         access private members we compute our containing type from the
11217         EmitContext.
11218
11219         (FieldExpr): Added partial support for volatile fields.  This does
11220         not work for volatile fields exposed from assemblies, as I can not
11221         figure out how to extract the modreq from it.
11222
11223         Updated all the source files to use this.
11224
11225         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
11226         because it is referenced by MemberLookup very often. 
11227
11228 2002-01-09  Ravi Pratap  <ravi@ximian.com>
11229
11230         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
11231         TypeBuilder.GetCustomAttributes to retrieve what we need.
11232
11233         Get rid of redundant default_member_attr_type as this is the same as
11234         default_member_type which already exists.
11235
11236         * interface.cs, attribute.cs : Update accordingly.
11237
11238 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
11239
11240         * typemanager.cs: Enable IndexerPropertyName again.  It does not
11241         work for TYpeBuilders though.  Ravi, can you please fix this?
11242
11243         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
11244
11245         * expression.cs (Argument.Emit): Handle the case of ref objects
11246         being passed to ref functions;  
11247
11248         (ParameterReference.EmitLoad): Loads the content of the pointer
11249         without dereferencing.
11250
11251 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * cs-tokenizer.cs: Implemented the pre-processing expressions.
11254
11255 2002-01-08  Ravi Pratap  <ravi@ximian.com>
11256
11257         * class.cs (Indexer.DefineMethod): Incorporate the interface
11258         type in the name of the method if we are doing explicit interface
11259         implementation.
11260
11261         * expression.cs (ConversionExists): Remove as it is completely obsolete.
11262
11263         (BetterConversion): Fix extremely trivial bug where we were referring to
11264         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
11265         again !
11266
11267         * ../errors/bug16.cs : Add although we have fixed it.
11268
11269 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
11270
11271         * expression.cs (BaseIndexer): Begin implementation.
11272
11273         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
11274
11275         * cs-parser.jay (indexer_declarator): Use qualified_identifier
11276         production directly to remove a shift/reduce, and implement
11277         explicit interface implementation.
11278
11279         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
11280         after a floating point suffix.
11281
11282         * expression.cs (DoNumericPromotions): Improved the conversion for
11283         uint/uint.  If we have a constant, we avoid doing a typecast to a
11284         larger type.
11285
11286         * class.cs (Indexer): Implement explicit interface implementation
11287         for indexers.
11288
11289 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
11290
11291         * class.cs: make the default instance constructor public and hidebysig.
11292
11293 2001-01-03  Ravi Pratap  <ravi@ximian.com>
11294
11295         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
11296         so we can call it from elsewhere.
11297
11298         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
11299         we emit it internally if the class has a defined indexer; otherwise the user
11300         emits it by decorating the class definition with the DefaultMemberAttribute.
11301
11302         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
11303         attribute is not used on a type which defines an indexer.
11304
11305         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
11306         character when we skip whitespace.
11307
11308         * ../errors/cs0646.cs : Add.
11309
11310 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
11313         again. 
11314
11315         * makefile: Add practical target `mcs3.exe' which builds the third
11316         generation compiler. 
11317
11318         * expression.cs (New): Fix structures constructor calling.
11319
11320         * class.cs (Property, Method, Indexer): Emit Final flag on the
11321         method if we are an interface implementation and we are not
11322         abstract. 
11323
11324         * ecore.cs (PropertyExpr): New public field `IsBase', tells
11325         whether this property is referencing a `base' method.
11326
11327         * expression.cs (Invocation.EmitCall): take an extra argument:
11328         is_base, this is used to determine whether the `call' or
11329         `callvirt' opcode should be used.
11330
11331
11332         * delegate.cs: update EmitCall.
11333
11334         * class.cs (Method.Define): Set NewSlot for the cases where we are
11335         not implementing an interface method.
11336
11337         (Property.Define): ditto.
11338
11339 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
11340
11341         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
11342         'r'.  Allows mcs to parse itself fully.
11343
11344 2002-01-02  Ravi Pratap  <ravi@ximian.com>
11345
11346         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
11347         of the number of initializers that require the InitializeArray method.
11348
11349         (CheckIndices): Store the Expression in all cases - not the plain value. Also
11350         update the above field where necessary.
11351
11352         (MakeByteBlob): Update accordingly.
11353
11354         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
11355         greater than 2.
11356
11357         (EmitDynamicInitializers): Update in accordance with the new optimization.
11358
11359         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
11360         same OpCode applies.
11361
11362         * cs-parser.jay : Fix some glaring errors I introduced.
11363
11364 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
11365
11366         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
11367         so that we can check for name clashes there too.
11368
11369         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
11370         for interface indexers.
11371
11372         * interfaces.cs (Define): Emit the default member attribute.
11373
11374         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
11375         variable was being referred to while setting the value ;-)
11376
11377 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
11378
11379         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
11380         byte-by-byte information when we know the data is zero.
11381
11382         Make the block always a multiple of 4, because
11383         DefineInitializedData has a bug.
11384
11385         * assign.cs: Fix, we should assign from the temporary, not from
11386         the source. 
11387
11388         * expression.cs (MakeByteBlob): Fix my incorrect code.
11389
11390 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
11391
11392         * typemanager.cs (EnumToUnderlying): This function is used to get
11393         the underlying type from an enumeration, because it does not
11394         always work. 
11395
11396         * constant.cs: Use the I4_S form for values between -128 and 127.
11397
11398         * statement.cs (Block.LookupLabel): Looks up a label.
11399         (Block): Drop support for labeled blocks.
11400
11401         (LabeledStatement): New kind of statement that represents a label
11402         only.
11403
11404         (Goto): Finally implement this bad boy.
11405
11406         * cs-parser.jay: Update to reflect new mechanism to implement
11407         labels.
11408
11409 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
11410
11411         * codegen.cs (EmitContext.This): a codegen property that keeps the
11412         a single instance of this instead of creating many different this
11413         instances. 
11414
11415         * delegate.cs (Delegate.DoResolve): Update to use the property;
11416
11417         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
11418
11419         * expression.cs (BaseAccess.DoResolve): Ditto.
11420
11421 2001-12-29  Ravi Pratap  <ravi@ximian.com>
11422
11423         * typemanager.cs (methodimpl_attr_type): Add to hold the type
11424         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
11425
11426         (InitCoreTypes): Update accordingly.
11427
11428         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
11429         so we can quickly store the state.
11430
11431         (ApplyAttributes): Set the correct implementation flags
11432         for InternalCall methods.
11433
11434 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
11435
11436         * expression.cs (EmitCall): if a method is not virtual, then do
11437         not use callvirt on it.
11438
11439         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
11440         user defined stuff) requires the use of stobj, which takes an
11441         address on the stack instead of an array and an index.  So emit
11442         the Ldelema operation for it.
11443
11444         (EmitStoreOpcode): Use stobj for valuetypes.
11445
11446         (UnaryMutator.EmitCode): Use the right 1 value depending on
11447         whether we are dealing with int64/uint64, float or doubles.
11448
11449         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
11450         constructors that I implemented last night.
11451
11452         (Constructor.IsDefault): Fix to work properly for static
11453         constructors.
11454
11455         * cs-parser.jay (CheckDef): report method signature errors.
11456         Update error number 103 to be 132.
11457
11458         * decl.cs: New AdditionResult enumeration value: MethodExists.
11459         Although we do this check for methods later on in the semantic
11460         analysis, catching repeated default constructors is so easy that
11461         we catch these here. 
11462
11463         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
11464         promotions code.
11465
11466         (ParameterReference.EmitAssign, Emit): handle
11467         bools as bytes.
11468
11469         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
11470         (ArrayAccess.EmitStoreOpcode): ditto.
11471
11472         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
11473
11474         * expression.cs (MakeByteBlob): Complete all the missing types
11475         (uint, short, ushort, byte, sbyte)
11476
11477         * class.cs: Only init instance field initializers on instance
11478         constructors. 
11479
11480         Rename `constructors' to instance_constructors. 
11481
11482         (TypeContainer.AddConstructor): Only add constructors to the list
11483         if it is not static.
11484
11485         Make sure that we handle default_static_constructor independently
11486         everywhere where we handle instance_constructors
11487
11488 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
11489
11490         * class.cs: Do not lookup or create a base initializer for a
11491         static constructor.
11492
11493         (ConstructorInitializer.Resolve): use the proper type to lookup
11494         for constructors.
11495
11496         * cs-parser.jay: Report error 1585 (modifiers between type and name).
11497
11498         * enum.cs, interface.cs: Remove CloseType, this is taken care by
11499         in DeclSpace. 
11500
11501         * decl.cs: CloseType is now an virtual method, the default
11502         implementation just closes this type.
11503
11504 2001-12-28  Ravi Pratap  <ravi@ximian.com>
11505
11506         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
11507         to PreserveSig by default. Also emit HideBySig on such methods.
11508
11509         Basically, set the defaults to standard values.
11510
11511         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
11512         argument, if candidate is better, it can't be worse than the best !
11513
11514         (Invocation): Re-write bits to differentiate between methods being
11515         applicable in their expanded form and their normal form - for params
11516         methods of course.
11517
11518         Get rid of use_standard everywhere as only standard conversions are allowed
11519         in overload resolution. 
11520
11521         More spec conformance.
11522
11523 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
11524
11525         * driver.cs: Add --timestamp, to see where the compiler spends
11526         most of its time.
11527
11528         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
11529         `this' in static code.
11530
11531         (SimpleName.DoResolve): Implement in terms of a helper function
11532         that allows static-references to be passed upstream to
11533         MemberAccess.
11534
11535         (Expression.ResolveWithSimpleName): Resolve specially simple
11536         names when called by MemberAccess to implement the special
11537         semantics. 
11538
11539         (Expression.ImplicitReferenceConversion): Handle conversions from
11540         Null to reference types before others, as Null's type is
11541         System.Object. 
11542
11543         * expression.cs (Invocation.EmitCall): Handle the special case of
11544         calling methods declared on a reference type from a ValueType
11545         (Base classes System.Object and System.Enum)
11546
11547         (MemberAccess.Resolve): Only perform lookups on Enumerations if
11548         the left hand side is a TypeExpr, not on every enumeration. 
11549
11550         (Binary.Resolve): If types are reference types, then do a cast to
11551         object on operators != and == of both arguments.
11552
11553         * typemanager.cs (FindMembers): Extract instance and static
11554         members if requested.
11555
11556         * interface.cs (PopulateProperty): Use void_type instead of null
11557         as the return type for the setter method.
11558
11559         (PopulateIndexer): ditto.
11560
11561 2001-12-27  Ravi Pratap  <ravi@ximian.com>
11562
11563         * support.cs (ReflectionParameters): Fix minor bug where we
11564         were examining the wrong parameter for the ParamArray attribute.
11565
11566         Cope with requests for the type of the parameter at position
11567         greater than the params parameter's. We now return the element
11568         type of the params array as that makes more sense.
11569
11570         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
11571         accordingly as we no longer have to extract the element type
11572         ourselves.
11573
11574         (Invocation.OverloadResolve): Update.
11575
11576 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
11579         against IEnumerator, test whether the return value is a descendant
11580         of the IEnumerator interface.
11581
11582         * class.cs (Indexer.Define): Use an auxiliary method to implement
11583         the other bits of the method definition.  Begin support for
11584         explicit interface implementation.
11585
11586         (Property.DefineMethod): Use TypeManager.void_type instead of null
11587         for an empty return value.
11588
11589 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
11590
11591         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
11592         dealing with a FieldExpr which is composed of a FieldBuilder, in
11593         the code path we did extract the constant, but we should have
11594         obtained the underlying value to be able to cast it (otherwise we
11595         end up in an infinite loop, this is what Ravi was running into).
11596
11597         (ArrayCreation.UpdateIndices): Arrays might be empty.
11598
11599         (MemberAccess.ResolveMemberAccess): Add support for section
11600         14.5.4.1 that deals with the special case of E.I when E is a type
11601         and something else, that I can be a reference to a static member.
11602
11603         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
11604         handle a particular array type to create byte blobs, it is just
11605         something we dont generate byteblobs for.
11606
11607         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
11608         arguments. 
11609
11610         * location.cs (Push): remove the key from the hashtable that we
11611         are about to add.   This happens for empty files.
11612
11613         * driver.cs: Dispose files after we have parsed them.
11614
11615         (tokenize): new function that only runs the tokenizer on its
11616         input, for speed testing.
11617
11618 2001-12-26  Ravi Pratap  <ravi@ximian.com>
11619
11620         * class.cs (Event.Define): Define the private field only if there
11621         are no accessors defined.
11622
11623         * expression.cs (ResolveMemberAccess): If there is no associated
11624         field with the event, that means we have an event defined with its
11625         own accessors and we should flag error cs0070 since transforming
11626         ourselves into a field is not valid in that case.
11627
11628         * ecore.cs (SimpleName.DoResolve): Same as above.
11629
11630         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
11631         and charset to sane values.
11632
11633 2001-12-25  Ravi Pratap  <ravi@ximian.com>
11634
11635         * assign.cs (DoResolve): Perform check on events only if they 
11636         are being accessed outside the declaring type.
11637
11638         * cs-parser.jay (event_declarations): Update rules to correctly
11639         set the type of the implicit parameter etc.
11640
11641         (add_accessor, remove_accessor): Set current local parameters.
11642
11643         * expression.cs (Binary): For delegate addition and subtraction,
11644         cast the return value from the method into the appropriate delegate
11645         type.
11646
11647 2001-12-24  Ravi Pratap  <ravi@ximian.com>
11648
11649         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
11650         of these as the workaround is unnecessary.
11651
11652         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
11653         delegate data - none of that is needed at all.
11654
11655         Re-write bits to extract the instance expression and the delegate method
11656         correctly.
11657
11658         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
11659         on delegates too.
11660
11661         * attribute.cs (ApplyAttributes): New method to take care of common tasks
11662         of attaching attributes instead of duplicating code everywhere.
11663
11664         * everywhere : Update code to do attribute emission using the above method.
11665
11666 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
11667
11668         * expression.cs (IsParamsMethodApplicable): if there are not
11669         parameters, return immediately.
11670
11671         * ecore.cs: The 0 literal can be implicity converted to an enum
11672         type. 
11673
11674         (SimpleName.DoResolve): First lookup the type, then lookup the
11675         members. 
11676
11677         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
11678         want to get its address.  If the InstanceExpression is not
11679         addressable, store the result in a temporary variable, then get
11680         the address of it.
11681
11682         * codegen.cs: Only display 219 errors on warning level or above. 
11683
11684         * expression.cs (ArrayAccess): Make it implement the
11685         IMemoryLocation interface.
11686
11687         (Binary.DoResolve): handle the operator == (object a, object b)
11688         and operator != (object a, object b) without incurring into a
11689         BoxedCast (because 5 != o should never be performed).
11690
11691         Handle binary enumerator operators.
11692
11693         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
11694         value type, otherwise use Ldelem_ref.
11695
11696         Use precomputed names;
11697
11698         (AddressOf): Implement address of
11699
11700         * cs-parser.jay (labeled_statement): Fix recursive block
11701         addition by reworking the production.
11702
11703         * expression.cs (New.DoEmit): New has a special case:
11704                 
11705                  If we are dealing with a ValueType, we have a few
11706                  situations to deal with:
11707                 
11708                     * The target of New is a ValueType variable, that is
11709                       easy, we just pass this as the variable reference
11710                 
11711                     * The target of New is being passed as an argument,
11712                       to a boxing operation or a function that takes a
11713                       ValueType.
11714                 
11715                       In this case, we need to create a temporary variable
11716                       that is the argument of New.
11717
11718
11719 2001-12-23  Ravi Pratap  <ravi@ximian.com>
11720
11721         * rootcontext.cs (LookupType): Check that current_type is not null before
11722         going about looking at nested types.
11723
11724         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
11725         not implement the IAssignMethod interface any more.
11726
11727         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
11728         where we tranform them into FieldExprs if they are being resolved from within
11729         the declaring type.
11730
11731         * ecore.cs (SimpleName.DoResolve): Do the same here.
11732
11733         * assign.cs (DoResolve, Emit): Clean up code considerably. 
11734
11735         * ../errors/bug10.cs : Add.
11736
11737         * ../errors/cs0070.cs : Add.
11738
11739         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
11740
11741         * assign.cs : Get rid of EventIsLocal everywhere.
11742
11743 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
11744
11745         * ecore.cs (ConvertIntLiteral): finished the implementation.
11746
11747         * statement.cs (SwitchLabel): Convert the value we are using as a
11748         key before looking up the table.
11749
11750 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
11751
11752         * codegen.cs (EmitTopBlock): Require a Location argument now.
11753
11754         * cs-parser.jay (constructor_declarator): We need to setup
11755         current_local_parameters before we parse the
11756         opt_constructor_initializer, to allow the variables to be bound
11757         to the constructor arguments.
11758
11759         * rootcontext.cs (LookupType): First lookup nested classes in our
11760         class and our parents before we go looking outside our class.
11761
11762         * expression.cs (ConstantFold): Extract/debox the values at the
11763         beginnning. 
11764
11765         * rootcontext.cs (EmitCode): Resolve the constants first before we
11766         resolve the types.  This is not really needed, but it helps debugging.
11767
11768         * statement.cs: report location.
11769
11770         * cs-parser.jay: pass location to throw statement.
11771
11772         * driver.cs: Small bug fix.
11773
11774         * report.cs: Updated format to be 4-zero filled digits.
11775
11776 2001-12-22  Ravi Pratap  <ravi@ximian.com>
11777
11778         * expression.cs (CheckIndices): Fix minor bug where the wrong
11779         variable was being referred to ;-)
11780
11781         (DoEmit): Do not call EmitStaticInitializers when the 
11782         underlying type is System.Object.
11783
11784 2001-12-21  Ravi Pratap  <ravi@ximian.com>
11785
11786         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
11787         and do the usual workaround for SRE.
11788
11789         * class.cs (MyEventBuilder.EventType): New member to get at the type
11790         of the event, quickly.
11791
11792         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
11793
11794         * assign.cs (Assign.DoResolve): Handle the case when the target
11795         is an EventExpr and perform the necessary checks.
11796
11797         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
11798         interface.
11799
11800         (SimpleName.MemberStaticCheck): Include check for EventExpr.
11801
11802         (EventExpr): Set the type in the constructor itself since we 
11803         are meant to be born fully resolved.
11804
11805         (EventExpr.Define): Revert code I wrote earlier.
11806                 
11807         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
11808         instance expression is null. The instance expression is a This in that case
11809         or a null, depending on whether it is a static method or not.
11810
11811         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
11812         refers to more than one method.
11813
11814         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
11815         and accordingly flag errors.
11816
11817 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
11818
11819         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
11820
11821 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
11822
11823         * location.cs (ToString): Provide useful rutine.
11824
11825 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
11826
11827         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
11828         objects, return the actual integral boxed.
11829
11830         * statement.cs (SwitchLabel): define an ILLabel for each
11831         SwitchLabel. 
11832
11833         (Switch.CheckSwitch): If the value is a Literal, extract
11834         the underlying literal.
11835
11836         Also in the unused hashtable we had, add the SwitchLabel so we can
11837         quickly look this value up.
11838
11839         * constant.cs: Implement a bunch of new constants.  Rewrite
11840         Literal based on this.  Made changes everywhere to adapt to this.
11841
11842         * expression.cs (Expression.MakeByteBlob): Optimize routine by
11843         dereferencing array only once, and also copes with enumrations.
11844
11845         bytes are two bytes wide, not one.
11846
11847         (Cast): Perform constant conversions.
11848
11849         * ecore.cs (TryImplicitIntConversion): Return literals instead of
11850         wrappers to the literals here.
11851
11852         * expression.cs (DoNumericPromotions): long literals can converted
11853         to ulong implicity (this is taken care of elsewhere, but I was
11854         missing this spot).
11855
11856         * ecore.cs (Expression.Literalize): Make the return type Literal,
11857         to improve type checking.
11858
11859         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
11860
11861 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
11862
11863         * literal.cs: Revert code from ravi that checked the bounds.  The
11864         bounds are sane by the definition of the type itself. 
11865
11866         * typemanager.cs: Fix implementation of ImplementsInterface.  We
11867         need to actually look up in our parent hierarchy for interfaces
11868         implemented. 
11869
11870         * const.cs: Use the underlying type for enumerations
11871
11872         * delegate.cs: Compute the basename for the delegate creation,
11873         that should fix the delegate test case, and restore the correct
11874         Type Lookup semantics in rootcontext
11875
11876         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
11877         referencing a nested type with the Reflection API is using the "+"
11878         sign. 
11879
11880         * cs-parser.jay: Do not require EOF token at the end.
11881
11882 2001-12-20  Ravi Pratap  <ravi@ximian.com>
11883
11884         * rootcontext.cs (LookupType): Concatenate type names with
11885         a '.' instead of a '+' The test suite passes again.
11886
11887         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
11888         field of the enumeration.
11889
11890         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
11891         the case when the member is an EventExpr.
11892
11893         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
11894         static has an associated instance expression.
11895
11896         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
11897
11898         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
11899
11900         * class.cs (Event.Define): Register event and perform appropriate checks
11901         for error #111.
11902
11903         We define the Add and Remove methods even if the use provides none because
11904         in that case, we provide default implementations ourselves.
11905
11906         Define a private field of the type of the event. This is done by the CSC compiler
11907         and we should be doing it too ;-)
11908
11909         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
11910         More methods we use in code we generate.
11911
11912         (multicast_delegate_type, delegate_type): Two separate types since the distinction
11913         is important.
11914
11915         (InitCoreTypes): Update accordingly for the above.
11916
11917         * class.cs (Event.Emit): Generate code for default accessors that we provide
11918
11919         (EmitDefaultMethod): Do the job in the above.
11920
11921         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
11922         appropriate place.
11923
11924 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
11925
11926         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
11927         builders even if we were missing one.
11928
11929         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
11930         pass the Basename as our class name instead of the Name.  The
11931         basename will be correctly composed for us.
11932
11933         * parameter.cs (Paramters): Now takes a Location argument.
11934
11935         * decl.cs (DeclSpace.LookupType): Removed convenience function and
11936         make all the code call directly LookupType in RootContext and take
11937         this chance to pass the Location information everywhere.
11938
11939         * Everywhere: pass Location information.
11940
11941 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * class.cs (Constructor.Define): Updated way of detecting the
11944         length of the parameters.
11945
11946         (TypeContainer.DefineType): Use basename as the type name for
11947         nested types.
11948
11949         (TypeContainer.Define): Do not recursively define types here, as
11950         definition is taken care in order by the RootContext.
11951
11952         * tree.cs: Keep track of namespaces in a per-file basis.
11953
11954         * parameter.cs (Parameter.ComputeSignature): Update to use
11955         DeclSpace. 
11956
11957         (Parameters.GetSignature): ditto.
11958
11959         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
11960         instead of a TypeContainer.
11961
11962         (Interface.SemanticAnalysis): Use `this' instead of our parent to
11963         resolve names.  Because we need to be resolve in our context, not
11964         our parents.
11965
11966         * driver.cs: Implement response files.
11967
11968         * class.cs (TypeContainer.DefineType): If we are defined, do not
11969         redefine ourselves.
11970
11971         (Event.Emit): Emit the code for add/remove handlers.
11972         (Event.Define): Save the MethodBuilders for add/remove.
11973
11974         * typemanager.cs: Use pair here too.
11975
11976         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
11977         DictionaryEntry requires the first argument to be non-null.  
11978
11979         (enum_declaration): Compute full name for registering the
11980         enumeration.
11981
11982         (delegate_declaration): Instead of using
11983         formal_parameter_list, use opt_formal_parameter_list as the list
11984         can be empty.
11985
11986         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
11987         (EventParsing): New property that controls whether `add' and
11988         `remove' are returned as tokens or identifiers (for events);
11989
11990 2001-12-19  Ravi Pratap  <ravi@ximian.com>
11991
11992         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
11993         use MyEventBuilder only and let it wrap the real builder for us.
11994
11995         (MyEventBuilder): Revamp constructor etc.
11996
11997         Implement all operations that we perform on EventBuilder in precisely the same
11998         way here too.
11999
12000         (FindMembers): Update to use the EventBuilder member.
12001
12002         (Event.Emit): Update accordingly.
12003
12004 2001-12-18  Ravi Pratap  <ravi@ximian.com>
12005
12006         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
12007         by calling the appropriate methods.
12008
12009         (GetCustomAttributes): Make stubs as they cannot possibly do anything
12010         useful.
12011
12012         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
12013
12014 2001-12-17  Ravi Pratap  <ravi@ximian.com>
12015
12016         * delegate.cs (Delegate.Populate): Check that the return type
12017         and various parameters types are indeed accessible.
12018
12019         * class.cs (Constructor.Define): Same here.
12020
12021         (Field.Define): Ditto.
12022
12023         (Event.Define): Ditto.
12024
12025         (Operator.Define): Check that the underlying Method defined itself
12026         correctly - so it's MethodBuilder should not be null.
12027
12028         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
12029         expression happens to be null.
12030
12031         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
12032         members but as of now we don't seem to be able to do anything really useful with it.
12033
12034         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
12035         not the EventBuilder.
12036
12037 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
12038
12039         * cs-tokenizer.cs: Add support for defines.
12040         Add support for #if, #elif, #else, #endif
12041
12042         (eval_var): evaluates a variable.
12043         (eval): stubbed for evaluating functions.
12044
12045         * cs-parser.jay: Pass the defines information
12046
12047         * driver.cs: Add --define command line option.
12048
12049         * decl.cs: Move MemberCore here.
12050
12051         Make it the base class for DeclSpace.  This allows us to catch and
12052         report 108 and 109 for everything now.
12053
12054         * class.cs (TypeContainer.Define): Extract all the members
12055         before populating and emit the warning 108 (new keyword required
12056         to override) instead of having each member implement this.
12057
12058         (MemberCore.Define): New abstract method, we will be using this in
12059         the warning reporting engine in Populate.
12060
12061         (Operator.Define): Adjust to new MemberCore protocol. 
12062
12063         * const.cs (Const): This does not derive from Expression, it is a
12064         temporary object we use to create fields, it is a MemberCore. 
12065
12066         * class.cs (Method.Define): Allow the entry point to be in a
12067         specific class.
12068
12069         * driver.cs: Rewrite the argument handler to clean it up a bit.
12070
12071         * rootcontext.cs: Made it just an auxiliary namespace feature by
12072         making everything static.
12073
12074         * driver.cs: Adapt code to use RootContext type name instead of
12075         instance variable.
12076
12077         * delegate.cs: Remove RootContext argument.
12078
12079         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
12080         argument. 
12081
12082         * class.cs (Event.Define): The lookup can fail.
12083
12084         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
12085
12086         * expression.cs: Resolve the this instance before invoking the code.
12087
12088 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
12089
12090         * cs-parser.jay: Add a production in element_access that allows
12091         the thing to become a "type" reference.  This way we can parse
12092         things like "(string [])" as a type.
12093
12094         Note that this still does not handle the more complex rules of
12095         casts. 
12096
12097
12098         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
12099
12100         * ecore.cs: (CopyNewMethods): new utility function used to
12101         assemble the list of methods from running FindMembers.
12102
12103         (MemberLookup): Rework FindMembers so that 
12104
12105 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
12106
12107         * class.cs (TypeContainer): Remove Delegates who fail to be
12108         defined.
12109
12110         * delegate.cs (Populate): Verify that we dont get null return
12111         values.   TODO: Check for AsAccessible.
12112
12113         * cs-parser.jay: Use basename to emit error 574 (destructor should
12114         have the same name as container class), not the full name.
12115
12116         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
12117         possible representation.  
12118
12119         Also implements integer type suffixes U and L.
12120
12121 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
12122
12123         * expression.cs (ArrayCreation.DoResolve): We need to do the
12124         argument resolution *always*.
12125
12126         * decl.cs: Make this hold the namespace.  Hold the root context as
12127         well.
12128         (LookupType): Move here.
12129
12130         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
12131
12132         * location.cs (Row, Name): Fixed the code, it was always returning
12133         references to the first file.
12134
12135         * interface.cs: Register properties defined through interfaces.
12136
12137         * driver.cs: Add support for globbing on the command line
12138
12139         * class.cs (Field): Make it derive from MemberCore as well.
12140         (Event): ditto.
12141
12142 2001-12-15  Ravi Pratap  <ravi@ximian.com>
12143
12144         * class.cs (Event::Define): Check that the type of the event is a delegate
12145         type else flag error #66.
12146
12147         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
12148         same.
12149
12150         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
12151         values of EntryPoint, CharSet etc etc.
12152
12153         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
12154
12155         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
12156         be null and we should ignore this. I am not sure if this is really clean. Apparently,
12157         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
12158         which needs this to do its work.
12159
12160         * ../errors/cs0066.cs : Add.
12161
12162 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
12165         helper functions.
12166
12167         * class.cs: (MethodSignature.MethodSignature): Removed hack that
12168         clears out the parameters field.
12169         (MemberSignatureCompare): Cleanup
12170
12171         (MemberCore): New base class used to share code between MethodCore
12172         and Property.
12173
12174         (RegisterRequiredImplementations) BindingFlags.Public requires
12175         either BindingFlags.Instace or Static.  Use instance here.
12176
12177         (Property): Refactored code to cope better with the full spec.
12178
12179         * parameter.cs (GetParameterInfo): Return an empty array instead
12180         of null on error.
12181
12182         * class.cs (Property): Abstract or extern properties have no bodies.
12183
12184         * parameter.cs (GetParameterInfo): return a zero-sized array.
12185
12186         * class.cs (TypeContainer.MethodModifiersValid): Move all the
12187         method modifier validation to the typecontainer so we can reuse
12188         this on properties.
12189
12190         (MethodCore.ParameterTypes): return an empty sized array of types.
12191
12192         (Property.Define): Test property modifier validity.
12193
12194         Add tests for sealed/override too.
12195
12196         (Method.Emit): abstract or extern methods have no bodies.
12197
12198 2001-12-14  Ravi Pratap  <ravi@ximian.com>
12199
12200         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
12201         thing.
12202
12203         (Method::Define, ::Emit): Modify accordingly.
12204
12205         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
12206
12207         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
12208
12209         * makefile: Pass in /unsafe.
12210
12211 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
12212
12213         * class.cs (MakeKey): Kill routine.
12214
12215         * class.cs (TypeContainer.Define): Correctly define explicit
12216         method implementations (they require the full interface name plus
12217         the method name).
12218
12219         * typemanager.cs: Deply the PtrHashtable here and stop using the
12220         lame keys.  Things work so much better.
12221
12222         This of course broke everyone who depended on `RegisterMethod' to
12223         do the `test for existance' test.  This has to be done elsewhere.
12224
12225         * support.cs (PtrHashtable): A hashtable that avoid comparing with
12226         the object stupid Equals method (because, that like fails all over
12227         the place).  We still do not use it.
12228
12229         * class.cs (TypeContainer.SetRequiredInterface,
12230         TypeContainer.RequireMethods): Killed these two routines and moved
12231         all the functionality to RegisterRequiredImplementations.
12232
12233         (TypeContainer.RegisterRequiredImplementations): This routine now
12234         registers all the implementations required in an array for the
12235         interfaces and abstract methods.  We use an array of structures
12236         which can be computed ahead of time to reduce memory usage and we
12237         also assume that lookups are cheap as most classes will not
12238         implement too many interfaces.
12239
12240         We also avoid creating too many MethodSignatures.
12241
12242         (TypeContainer.IsInterfaceMethod): Update and optionally does not
12243         clear the "pending" bit if we find that there are problems with
12244         the declaration.
12245
12246         (TypeContainer.VerifyPendingMethods): Update to report errors of
12247         methods that look like implementations but are not.
12248
12249         (TypeContainer.Define): Add support for explicit interface method
12250         implementation. 
12251
12252 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * typemanager.cs: Keep track of the parameters here instead of
12255         being a feature of the TypeContainer.
12256
12257         * class.cs: Drop the registration of parameters here, as
12258         InterfaceMethods are also interface declarations.
12259
12260         * delegate.cs: Register methods with the TypeManager not only with
12261         the TypeContainer.  This code was buggy.
12262
12263         * interface.cs: Full registation here.
12264
12265 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
12266
12267         * expression.cs: Remove reducer for binary expressions, it can not
12268         be done this way.
12269
12270         * const.cs: Put here the code that used to go into constant.cs
12271
12272         * constant.cs: Put here the code for constants, this is a new base
12273         class for Literals.
12274
12275         * literal.cs: Make Literal derive from Constant.
12276
12277 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * statement.cs (Return.Emit): Report error 157 if the user
12280         attempts to return from a finally block.
12281
12282         (Return.Emit): Instead of emitting a return, jump to the end of
12283         the function.
12284
12285         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
12286         LocalBuilder to store the result of the function.  ReturnLabel is
12287         the target where we jump.
12288
12289
12290 2001-12-09  Radek Doulik  <rodo@ximian.com>
12291
12292         * cs-parser.jay: remember alias in current namespace
12293
12294         * ecore.cs (SimpleName::DoResolve): use aliases for types or
12295         namespaces
12296
12297         * class.cs (LookupAlias): lookup alias in my_namespace
12298
12299         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
12300         aliases hashtable
12301         (LookupAlias): lookup alias in this and if needed in parent
12302         namespaces
12303
12304 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
12305
12306         * support.cs: 
12307
12308         * rootcontext.cs: (ModuleBuilder) Made static, first step into
12309         making things static.  I need this to avoid passing the
12310         TypeContainer when calling ParameterType.
12311
12312         * support.cs (InternalParameters.ParameterType): Remove ugly hack
12313         that did string manipulation to compute the type and then call
12314         GetType.  Use Parameter.ParameterType instead.
12315
12316         * cs-tokenizer.cs: Consume the suffix for floating values.
12317
12318         * expression.cs (ParameterReference): figure out whether this is a
12319         reference parameter or not.  Kill an extra variable by computing
12320         the arg_idx during emission.
12321
12322         * parameter.cs (Parameters.GetParameterInfo): New overloaded
12323         function that returns whether a parameter is an out/ref value or not.
12324
12325         (Parameter.ParameterType): The type of the parameter (base,
12326         without ref/out applied).
12327
12328         (Parameter.Resolve): Perform resolution here.
12329         (Parameter.ExternalType): The full type (with ref/out applied).
12330
12331         * statement.cs (Using.Emit, Using.EmitExpression): Implement
12332         support for expressions on the using statement.
12333
12334 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * statement.cs (Using.EmitLocalVariableDecls): Split the
12337         localvariable handling of the using statement.
12338
12339         (Block.EmitMeta): Keep track of variable count across blocks.  We
12340         were reusing slots on separate branches of blocks.
12341
12342         (Try.Emit): Emit the general code block, we were not emitting it. 
12343
12344         Check the type of the declaration to be an IDisposable or
12345         something that can be implicity converted to it. 
12346
12347         Emit conversions if required.
12348
12349         * ecore.cs (EmptyExpression): New utility class.
12350         (Expression.ImplicitConversionExists): New utility function.
12351
12352 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
12353
12354         * statement.cs (Using): Implement.
12355
12356         * expression.cs (LocalVariableReference): Support read only variables.
12357
12358         * statement.cs: Remove the explicit emit for the Leave opcode.
12359         (VariableInfo): Add a readonly field.
12360
12361 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
12362
12363         * ecore.cs (ConvCast): new class used to encapsulate the various
12364         explicit integer conversions that works in both checked and
12365         unchecked contexts.
12366
12367         (Expression.ConvertNumericExplicit): Use new ConvCast class to
12368         properly generate the overflow opcodes.
12369
12370 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * statement.cs: The correct type for the EmptyExpression is the
12373         element_type, not the variable type.  Ravi pointed this out.
12374
12375 2001-12-04  Ravi Pratap  <ravi@ximian.com>
12376
12377         * class.cs (Method::Define): Handle PInvoke methods specially
12378         by using DefinePInvokeMethod instead of the usual one.
12379
12380         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
12381         above to do the task of extracting information and defining the method.
12382
12383 2001-12-04  Ravi Pratap  <ravi@ximian.com>
12384
12385         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
12386         of the condition for string type.
12387
12388         (Emit): Move that here. 
12389
12390         (ArrayCreation::CheckIndices): Keep string literals in their expression
12391         form.
12392
12393         (EmitDynamicInitializers): Handle strings appropriately.
12394
12395 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
12396
12397         * codegen.cs (EmitContext): Replace multiple variables with a
12398         single pointer to the current Switch statement.
12399
12400         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
12401         EmitContext.
12402
12403 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * statement.cs 
12406
12407         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
12408         default'.
12409
12410         (Foreach.Emit): Foreach on arrays was not setting
12411         up the loop variables (for break/continue).
12412
12413         (GotoCase): Semi-implented.
12414
12415 2001-12-03  Ravi Pratap  <ravi@ximian.com>
12416
12417         * attribute.cs (CheckAttribute): Handle system attributes by using
12418         Attribute.GetAttributes to examine information we need.
12419
12420         (GetValidPlaces): Same here.
12421
12422         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
12423
12424         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
12425
12426         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
12427
12428         (Method::Define): Set appropriate flags if we have a DllImport attribute.
12429
12430         (Method::Emit): Handle the case when we are a PInvoke method.
12431
12432 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
12433
12434         * expression.cs: Use ResolveWithSimpleName on compound names.
12435
12436 2001-12-02  Ravi Pratap  <ravi@ximian.com>
12437
12438         * constant.cs (EmitConstant): Make sure we resolve the associated expression
12439         before trying to reduce it.
12440
12441         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
12442
12443         * constant.cs (LookupConstantValue): Implement.
12444
12445         (EmitConstant): Use the above in emitting the constant.
12446
12447         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
12448         that are user-defined by doing a LookupConstantValue on them.
12449
12450         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
12451         too, like above.
12452
12453 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
12456
12457         (BaseAccess.DoResolve): Implement.
12458
12459         (MemberAccess.DoResolve): Split this routine into a
12460         ResolveMemberAccess routine that can be used independently
12461
12462 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
12463
12464         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
12465         As that share bits of the implementation.  Is returns a boolean,
12466         while As returns the Type that is being probed.
12467
12468 2001-12-01  Ravi Pratap  <ravi@ximian.com>
12469
12470         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
12471         instead of a Literal - much easier.
12472
12473         (EnumInTransit): Remove - utterly useless :-)
12474
12475         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
12476
12477         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
12478
12479         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
12480         chain when we have no associated expression.
12481
12482 2001-11-30  Ravi Pratap  <ravi@ximian.com>
12483
12484         * constant.cs (Define): Use Location while reporting the errror.
12485
12486         Also emit a warning when 'new' is used and there is no inherited
12487         member to hide.
12488
12489         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
12490         populated.
12491
12492         (LookupEnumValue): Implement to lookup an enum member's value and define it
12493         if necessary.
12494
12495         (Populate): Re-write accordingly to use the above routine.
12496
12497 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
12498
12499         * expression.cs (This): Fix prototype for DoResolveLValue to
12500         override the base class DoResolveLValue.
12501
12502         * cs-parser.cs: Report errors cs574 and cs575 (destructor
12503         declarations) 
12504
12505         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
12506         (we need to load the address of the field here).  This fixes
12507         test-22. 
12508
12509         (FieldExpr.DoResolveLValue): Call the DoResolve
12510         function to initialize the Instance expression.
12511
12512         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
12513         correctly the GetEnumerator operation on a value type.
12514
12515         * cs-parser.jay: Add more simple parsing error catches.
12516
12517         * statement.cs (Switch): Add support for string switches.
12518         Handle null specially.
12519
12520         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
12521
12522 2001-11-28  Ravi Pratap  <ravi@ximian.com>
12523
12524         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
12525
12526         (declare_local_constant): New helper function.
12527
12528         * statement.cs (AddConstant): Keep a separate record of constants
12529
12530         (IsConstant): Implement to determine if a variable is a constant.
12531
12532         (GetConstantExpression): Implement.
12533
12534         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
12535
12536         * statement.cs (IsVariableDefined): Re-write.
12537
12538 2001-11-27  Ravi Pratap  <ravi@ximian.com>
12539
12540         * class.cs (TypeContainer::FindMembers): Look for constants
12541         in the case when we are looking for MemberTypes.Field
12542
12543         * expression.cs (MemberAccess::DoResolve): Check that in the
12544         case we are a FieldExpr and a Literal, we are not being accessed
12545         by an instance reference.
12546
12547         * cs-parser.jay (local_constant_declaration): Implement.
12548
12549         (declaration_statement): Implement for constant declarations.
12550
12551 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
12552
12553         * statement.cs (Switch): Catch double defaults.
12554
12555         (Switch): More work on the switch() statement
12556         implementation.  It works for integral values now, need to finish
12557         string support.
12558
12559
12560 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
12561
12562         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
12563         integer literals into other integer literals.  To be used by
12564         switch. 
12565
12566 2001-11-24  Ravi Pratap  <ravi@ximian.com>
12567
12568         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
12569         some memory.
12570
12571         (EmitDynamicInitializers): Cope with the above since we extract data
12572         directly from ArrayData now.
12573
12574         (ExpectInitializers): Keep track of whether initializers are mandatory
12575         or not.
12576
12577         (Bounds): Make it a hashtable to prevent the same dimension being 
12578         recorded for every element in that dimension.
12579
12580         (EmitDynamicInitializers): Fix bug which prevented the Set array method
12581         from being found.
12582
12583         Also fix bug which was causing the indices to be emitted in the reverse
12584         order.
12585
12586 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
12587
12588         * expression.cs (ArrayCreation): Implement the bits that Ravi left
12589         unfinished.  They do not work, because the underlying code is
12590         sloppy.
12591
12592 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
12593
12594         * cs-parser.jay: Remove bogus fixme.
12595
12596         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
12597         on Switch statement.
12598
12599 2001-11-23  Ravi Pratap  <ravi@ximian.com>
12600
12601         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
12602         the same. 
12603
12604         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
12605         parameter. Apparently, any expression is allowed. 
12606
12607         (ValidateInitializers): Update accordingly.
12608
12609         (CheckIndices): Fix some tricky bugs thanks to recursion.
12610
12611         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
12612         I was being completely brain-dead.
12613
12614         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
12615         and re-write acordingly.
12616
12617         (DelegateInvocation): Re-write accordingly.
12618
12619         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
12620
12621         (MakeByteBlob): Handle types more correctly.
12622
12623         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
12624         initialization from expressions but it is incomplete because I am a complete
12625         Dodo :-|
12626
12627 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
12628
12629         * statement.cs (If.Emit): Fix a bug that generated incorrect code
12630         on If.  Basically, we have to return `true' (ie, we do return to
12631         our caller) only if both branches of the if return.
12632
12633         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
12634         short-circuit operators, handle them as short circuit operators. 
12635
12636         (Cast.DoResolve): Resolve type.
12637         (Cast.Cast): Take an expression as the target type.
12638
12639         * cs-parser.jay (cast_expression): Remove old hack that only
12640         allowed a limited set of types to be handled.  Now we take a
12641         unary_expression and we resolve to a type during semantic
12642         analysis.
12643
12644         Use the grammar productions from Rhys to handle casts (this is
12645         not complete like Rhys syntax yet, we fail to handle that corner
12646         case that C# has regarding (-x), but we will get there.
12647
12648 2001-11-22  Ravi Pratap  <ravi@ximian.com>
12649
12650         * class.cs (EmitFieldInitializer): Take care of the case when we have a
12651         field which is an array type.
12652
12653         * cs-parser.jay (declare_local_variables): Support array initialization too.
12654
12655         * typemanager.cs (MakeKey): Implement.
12656
12657         (everywhere): Use the above appropriately.
12658
12659         * cs-parser.jay (for_statement): Update for array initialization while
12660         declaring variables.
12661
12662         * ecore.cs : The error message was correct, it's the variable's names that
12663         were misleading ;-) Make the code more readable.
12664
12665         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
12666         the correct type etc.
12667
12668         (ConvertExplicit): Handle Enum types by examining the underlying type.
12669
12670 2001-11-21  Ravi Pratap  <ravi@ximian.com>
12671
12672         * parameter.cs (GetCallingConvention): Always return
12673         CallingConventions.Standard for now.
12674
12675 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
12676
12677         * expression.cs (Binary.ResolveOperator): Update the values of `l'
12678         and `r' after calling DoNumericPromotions.
12679
12680         * ecore.cs: Fix error message (the types were in the wrong order).
12681
12682         * statement.cs (Foreach.ProbeCollectionType): Need to pass
12683         BindingFlags.Instance as well 
12684
12685         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
12686         implicit int literal conversion in an empty cast so that we
12687         propagate the right type upstream.
12688
12689         (UnboxCast): new class used to unbox value types.
12690         (Expression.ConvertExplicit): Add explicit type conversions done
12691         by unboxing.
12692
12693         (Expression.ImplicitNumericConversion): Oops, forgot to test for
12694         the target type before applying the implicit LongLiterals to ULong
12695         literal cast.
12696
12697 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
12698
12699         * cs-parser.jay (for_statement): Reworked the way For works: now
12700         we declare manually any variables that are introduced in
12701         for_initializer to solve the problem of having out-of-band code
12702         emition (that is what got for broken).
12703
12704         (declaration_statement): Perform the actual variable declaration
12705         that used to be done in local_variable_declaration here.
12706
12707         (local_variable_declaration): Do not declare anything, just pass
12708         the information on a DictionaryEntry
12709
12710 2001-11-20  Ravi Pratap  <ravi@ximian.com>
12711
12712         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
12713         re-write of the logic to now make it recursive.
12714
12715         (UpdateIndices): Re-write accordingly.
12716
12717         Store element data in a separate ArrayData list in the above methods.
12718
12719         (MakeByteBlob): Implement to dump the array data into a byte array.
12720
12721 2001-11-19  Ravi Pratap  <ravi@ximian.com>
12722
12723         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
12724         into CheckIndices.
12725
12726         * constant.cs (Define): Implement.
12727
12728         (EmitConstant): Re-write fully.
12729
12730         Pass in location info.
12731
12732         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
12733         respectively.
12734
12735         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
12736         DictionaryEntry since we need location info too.
12737
12738         (constant_declaration): Update accordingly.
12739
12740         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
12741         code into another method : UpdateIndices.
12742
12743 2001-11-18  Ravi Pratap  <ravi@ximian.com>
12744
12745         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
12746         some type checking etc.
12747
12748 2001-11-17  Ravi Pratap  <ravi@ximian.com>
12749
12750         * expression.cs (ArrayCreation::ValidateInitializers): Implement
12751         bits to provide dimension info if the user skips doing that.
12752
12753         Update second constructor to store the rank correctly.
12754
12755 2001-11-16  Ravi Pratap  <ravi@ximian.com>
12756
12757         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
12758         and try to implement.
12759
12760         * ../errors/cs0150.cs : Add.
12761
12762         * ../errors/cs0178.cs : Add.
12763
12764 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
12765
12766         * statement.cs: Implement foreach on multi-dimensional arrays. 
12767
12768         * parameter.cs (Parameters.GetParameterByName): Also lookup the
12769         name of the params argument.
12770
12771         * expression.cs: Use EmitStoreOpcode to get the right opcode while
12772         initializing the array.
12773
12774         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
12775         we can use this elsewhere.
12776
12777         * statement.cs: Finish implementation of foreach for single
12778         dimension arrays.
12779
12780         * cs-parser.jay: Use an out-of-band stack to pass information
12781         around, I wonder why I need this.
12782
12783         foreach_block: Make the new foreach_block the current_block.
12784
12785         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
12786         function used to return a static Parameters structure.  Used for
12787         empty parameters, as those are created very frequently.
12788
12789         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
12790
12791 2001-11-15  Ravi Pratap  <ravi@ximian.com>
12792
12793         * interface.cs : Default modifier is private, not public. The
12794         make verify test passes again.
12795
12796 2001-11-15  Ravi Pratap  <ravi@ximian.com>
12797
12798         * support.cs (ReflectionParameters): Fix logic to determine
12799         whether the last parameter is a params one. Test 9 passes again.
12800
12801         * delegate.cs (Populate): Register the builders we define with
12802         RegisterParameterForBuilder. Test 19 passes again.
12803
12804         * cs-parser.jay (property_declaration): Reference $6 instead
12805         of $$ to get at the location.
12806
12807         (indexer_declaration): Similar stuff.
12808
12809         (attribute): Ditto.
12810
12811         * class.cs (Property): Register parameters for the Get and Set methods
12812         if they exist. Test 23 passes again.
12813
12814         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
12815         call to EmitArguments as we are sure there aren't any params arguments. 
12816         Test 32 passes again.
12817
12818         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
12819         IndexOutOfRangeException. 
12820
12821         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
12822         Test 33 now passes again.
12823
12824 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
12825
12826         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
12827         broke a bunch of things.  Will have to come up with a better way
12828         of tracking locations.
12829
12830         * statement.cs: Implemented foreach for single dimension arrays.
12831
12832 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
12833
12834         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
12835         an error.  This removes the lookup from the critical path.
12836
12837         * cs-parser.jay: Removed use of temporary_loc, which is completely
12838         broken. 
12839
12840 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
12841
12842         * support.cs (ReflectionParameters.ParameterModifier): Report
12843         whether the argument is a PARAMS argument or not.
12844
12845         * class.cs: Set the attribute `ParamArrayAttribute' on the
12846         parameter argument.
12847
12848         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
12849         and cons_param_array_attribute (ConstructorInfo for
12850         ParamArrayAttribute)., 
12851
12852         * codegen.cs: Emit the return using the `Return' statement, that
12853         way we can report the error correctly for missing return values. 
12854
12855         * class.cs (Method.Emit): Clean up.
12856
12857         * expression.cs (Argument.Resolve): Take another argument: the
12858         location where this argument is used.  Notice that this is not
12859         part of the "Argument" class as to reduce the size of the
12860         structure (we know the approximate location anyways).
12861
12862         Test if the argument is a variable-reference, if not, then
12863         complain with a 206.
12864
12865         (Argument.Emit): Emit addresses of variables.
12866
12867         (Argument.FullDesc): Simplify.
12868
12869         (Invocation.DoResolve): Update for Argument.Resolve.
12870
12871         (ElementAccess.DoResolve): ditto.
12872
12873         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
12874         method should be virtual, as this method is always virtual.
12875
12876         (NewDelegate.DoResolve): Update for Argument.Resolve.
12877
12878         * class.cs (ConstructorInitializer.DoResolve): ditto.
12879
12880         * attribute.cs (Attribute.Resolve): ditto.
12881
12882 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
12883
12884         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
12885
12886         * expression.cs (ParameterReference): Drop IStackStorage and implement
12887         IAssignMethod instead. 
12888
12889         (LocalVariableReference): ditto.
12890
12891         * ecore.cs (FieldExpr): Drop IStackStorage and implement
12892         IAssignMethod instead. 
12893
12894 2001-11-13  Miguel de Icaza <miguel@ximian.com>
12895
12896         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
12897         enumerations that are used in heavily used structures derive from
12898         byte in a laughable and pathetic attempt to reduce memory usage.
12899         This is the kind of pre-optimzations that you should not do at
12900         home without adult supervision.
12901
12902         * expression.cs (UnaryMutator): New class, used to handle ++ and
12903         -- separatedly from the other unary operators.  Cleans up the
12904         code, and kills the ExpressionStatement dependency in Unary.
12905
12906         (Unary): Removed `method' and `Arguments' from this class, making
12907         it smaller, and moving it all to SimpleCall, so I can reuse this
12908         code in other locations and avoid creating a lot of transient data
12909         strucutres when not required.
12910
12911         * cs-parser.jay: Adjust for new changes.
12912
12913 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
12914
12915         * enum.cs (Enum.Populate): If there is a failure during
12916         definition, return
12917
12918         * cs-parser.jay (opt_enum_base): we used to catch type errors
12919         here, but this is really incorrect.  The type error should be
12920         catched during semantic analysis.
12921
12922 2001-12-11  Ravi Pratap  <ravi@ximian.com>
12923
12924         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
12925         current_local_parameters as expected since I, in my stupidity, had forgotten
12926         to do this :-)
12927
12928         * attribute.cs (GetValidPlaces): Fix stupid bug.
12929
12930         * class.cs (Method::Emit): Perform check on applicability of attributes.
12931
12932         (Constructor::Emit): Ditto.
12933
12934         (Field::Emit): Ditto.
12935
12936         (Field.Location): Store location information.
12937
12938         (Property, Event, Indexer, Operator): Ditto.
12939
12940         * cs-parser.jay (field_declaration): Pass in location for each field.
12941
12942         * ../errors/cs0592.cs : Add.
12943
12944 2001-11-12  Ravi Pratap  <ravi@ximian.com>
12945
12946         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
12947
12948         (InitCoreTypes): Update accordingly.
12949
12950         (RegisterAttrType, LookupAttr): Implement.
12951
12952         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
12953         info about the same.
12954
12955         (Resolve): Update to populate the above as necessary.
12956
12957         (Error592): Helper.
12958
12959         (GetValidPlaces): Helper to the above.
12960
12961         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
12962
12963         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
12964
12965 2001-11-12  Ravi Pratap  <ravi@ximian.com>
12966
12967         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
12968
12969         * ../errors/cs0617.cs : Add.
12970
12971 2001-11-11  Ravi Pratap  <ravi@ximian.com>
12972
12973         * enum.cs (Emit): Rename to Populate to be more consistent with what
12974         we expect it to do and when exactly it is called.
12975
12976         * class.cs, rootcontext.cs : Update accordingly.
12977
12978         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
12979         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
12980
12981         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
12982
12983         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
12984         of a fieldinfo using the above, when dealing with a FieldBuilder.
12985
12986 2001-11-10  Ravi Pratap  <ravi@ximian.com>
12987
12988         * ../errors/cs0031.cs : Add.
12989
12990         * ../errors/cs1008.cs : Add.
12991
12992         * ../errrors/cs0543.cs : Add.
12993
12994         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
12995         enum type.
12996
12997         (FindMembers): Implement.
12998
12999         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
13000         enums and delegates too.
13001
13002         (enum_types): Rename to builder_to_enum.
13003
13004         (delegate_types): Rename to builder_to_delegate.
13005
13006         * delegate.cs (FindMembers): Implement.
13007
13008 2001-11-09  Ravi Pratap  <ravi@ximian.com>
13009
13010         * typemanager.cs (IsEnumType): Implement.
13011
13012         * enum.cs (Emit): Re-write parts to account for the underlying type
13013         better and perform checking etc.
13014
13015         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
13016         of the underlying type.
13017
13018         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
13019         value
13020
13021         * enum.cs (error31): Helper to report error #31.
13022
13023         * cs-parser.jay (enum_declaration): Store location of each member too.
13024
13025         * enum.cs (member_to_location): New hashtable. 
13026
13027         (AddEnumMember): Update location hashtable.
13028
13029         (Emit): Use the location of each member while reporting errors.
13030
13031 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * cs-parser.jay: A for_initializer if is a
13034         local_variable_declaration really ammount to have an implicit
13035         block with the variable declaration and no initializer for for.
13036
13037         * statement.cs (For.Emit): Cope with null initializers.
13038
13039         This fixes the infinite loop on for initializers.
13040
13041 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
13042
13043         * enum.cs: More cleanup.
13044
13045         * ecore.cs: Remove dead code.
13046
13047         * class.cs (Property.Emit): More simplification.
13048         (Event.Emit): ditto.
13049
13050         Reworked to have less levels of indentation.
13051
13052 2001-11-08  Ravi Pratap  <ravi@ximian.com>
13053
13054         * class.cs (Property): Emit attributes.
13055
13056         (Field): Ditto.
13057
13058         (Event): Ditto.
13059
13060         (Indexer): Ditto.
13061
13062         (Operator): Ditto.
13063
13064         * enum.cs (Emit): Ditto.
13065
13066         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
13067         Enums too.
13068
13069         * class.cs (Field, Event, etc.): Move attribute generation into the
13070         Emit method everywhere.
13071
13072         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
13073         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
13074         as we had no way of defining nested enums !
13075
13076         * rootcontext.cs : Adjust code accordingly.
13077
13078         * typemanager.cs (AddEnumType): To keep track of enum types separately.
13079
13080 2001-11-07  Ravi Pratap  <ravi@ximian.com>
13081
13082         * expression.cs (EvalConstantExpression): Move into ecore.cs
13083
13084         * enum.cs (Enum): Rename some members and make them public and readonly
13085         according to our convention.
13086
13087         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
13088         nothing else.
13089
13090         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
13091
13092         (Enum::Emit): Write a simple version for now which doesn't try to compute
13093         expressions. I shall modify this to be more robust in just a while.
13094
13095         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
13096
13097         (TypeContainer::CloseType): Create the Enum types too.
13098
13099         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
13100
13101         * expression.cs (EvalConstantExpression): Get rid of completely.
13102
13103         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
13104         user-defined values and other cases.
13105
13106         (IsValidEnumLiteral): Helper function.
13107
13108         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
13109         out there in the case we had a literal FieldExpr.
13110
13111         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
13112
13113         (Literalize): Revamp a bit to take two arguments.
13114
13115         (EnumLiteral): New class which derives from Literal to wrap enum literals.
13116
13117 2001-11-06  Ravi Pratap  <ravi@ximian.com>
13118
13119         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
13120
13121         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
13122
13123         (Resolve): Use the above to ensure we have proper initializers.
13124
13125 2001-11-05  Ravi Pratap  <ravi@ximian.com>
13126
13127         * expression.cs (Expression::EvalConstantExpression): New method to 
13128         evaluate constant expressions.
13129
13130         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
13131
13132 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
13135         in an array.
13136
13137         (Binary.ResolveOperator): Handle operator != (object a, object b)
13138         and operator == (object a, object b);
13139
13140         (Binary.DoNumericPromotions): Indicate whether the numeric
13141         promotion was possible.
13142
13143         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
13144         Implement.  
13145
13146         Made the ArrayAccess implement interface IAssignMethod instead of
13147         IStackStore as the order in which arguments are passed reflects
13148         this.
13149
13150         * assign.cs: Instead of using expr.ExprClass to select the way of
13151         assinging, probe for the IStackStore/IAssignMethod interfaces.
13152
13153         * typemanager.cs: Load InitializeArray definition.
13154
13155         * rootcontext.cs (RootContext.MakeStaticData): Used to define
13156         static data that can be used to initialize arrays. 
13157
13158 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * expression.cs: Handle operator== and operator!= for booleans.
13161
13162         (Conditioal.Reduce): Implement reducer for the ?: operator.
13163
13164         (Conditional.Resolve): Implement dead code elimination.
13165
13166         (Binary.Resolve): Catch string literals and return a new
13167         concatenated string.
13168
13169         (Unary.Reduce): Implement reduction of unary expressions.
13170
13171         * ecore.cs: Split out the expression core handling here.
13172
13173         (Expression.Reduce): New method used to perform constant folding
13174         and CSE.  This is needed to support constant-expressions. 
13175
13176         * statement.cs (Statement.EmitBoolExpression): Pass true and false
13177         targets, and optimize for !x.
13178
13179 2001-11-04  Ravi Pratap  <ravi@ximian.com>
13180
13181         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
13182         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
13183         set custom atttributes.
13184
13185         * literal.cs (Literal::GetValue): New abstract method to return the actual
13186         value of the literal, cast as an object.
13187
13188         (*Literal): Implement GetValue method.
13189
13190         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
13191         expressions to the arraylist but objects of type Argument.
13192
13193         * class.cs (TypeContainer::Emit): Emit our attributes too.
13194
13195         (Method::Emit, Constructor::Emit): Ditto.
13196
13197         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
13198         to be ignoring earlier.
13199
13200 2001-11-03  Ravi Pratap  <ravi@ximian.com>
13201
13202         * attribute.cs (AttributeSection::Define): Implement to do the business
13203         of constructing a CustomAttributeBuilder.
13204
13205         (Attribute): New trivial class. Increases readability of code.  
13206
13207         * cs-parser.jay : Update accordingly.
13208
13209         (positional_argument_list, named_argument_list, named_argument): New rules
13210
13211         (attribute_arguments): Use the above so that we are more correct.
13212
13213 2001-11-02  Ravi Pratap  <ravi@ximian.com>
13214
13215         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
13216         to perform all checks for a method with a params parameter.
13217
13218         (Invocation::OverloadResolve): Update to use the above method and therefore
13219         cope correctly with params method invocations.
13220
13221         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
13222         params too.
13223
13224         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
13225         constructors in our parent too because we can't afford to miss out on 
13226         protected ones ;-)
13227
13228         * attribute.cs (AttributeSection): New name for the class Attribute
13229
13230         Other trivial changes to improve readability.
13231
13232         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
13233         use the new class names.
13234
13235 2001-11-01  Ravi Pratap  <ravi@ximian.com>
13236
13237         * class.cs (Method::Define): Complete definition for params types too
13238
13239         (Indexer::Define): Ditto.
13240
13241         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
13242         Cope everywhere with a request for info about the array parameter.
13243
13244 2001-11-01  Ravi Pratap  <ravi@ximian.com>
13245
13246         * tree.cs (RecordNamespace): Fix up to check for the correct key.
13247
13248         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
13249         local_variable_type to extract the string corresponding to the type.
13250
13251         (local_variable_type): Fixup the action to use the new helper method.
13252
13253         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
13254         go.
13255
13256         * expression.cs : Clean out code which uses the above.
13257
13258 2001-10-31  Ravi Pratap  <ravi@ximian.com>
13259
13260         * typemanager.cs (RegisterMethod): Check if we already have an existing key
13261         and bale out if necessary by returning a false.
13262
13263         (RegisterProperty): Ditto.
13264
13265         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
13266         and print out appropriate error messages.
13267
13268         * interface.cs (everywhere): Ditto.
13269
13270         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
13271         location to constructor.
13272
13273         * class.cs (Property, Event, Indexer): Update accordingly.
13274
13275         * ../errors/cs111.cs : Added.
13276
13277         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
13278         of a method, as laid down by the spec.
13279
13280         (Invocation::OverloadResolve): Use the above method.
13281
13282 2001-10-31  Ravi Pratap  <ravi@ximian.com>
13283
13284         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
13285         now take a TypeContainer and a Parameters object.
13286
13287         (ParameterData): Modify return type of ParameterModifier method to be 
13288         Parameter.Modifier and not a string.
13289
13290         (ReflectionParameters, InternalParameters): Update accordingly.
13291
13292         * expression.cs (Argument::GetParameterModifier): Same here.
13293
13294         * support.cs (InternalParameters::ParameterType): Find a better way of determining
13295         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
13296         symbol in it at all so maybe this is only for now.
13297
13298 2001-10-30  Ravi Pratap  <ravi@ximian.com>
13299
13300         * support.cs (InternalParameters): Constructor now takes an extra argument 
13301         which is the actual Parameters class.
13302
13303         (ParameterDesc): Update to provide info on ref/out modifiers.
13304
13305         * class.cs (everywhere): Update call to InternalParameters to pass in
13306         the second argument too.
13307
13308         * support.cs (ParameterData): Add ParameterModifier, which is a method 
13309         to return the modifier info [ref/out etc]
13310
13311         (InternalParameters, ReflectionParameters): Implement the above.
13312
13313         * expression.cs (Argument::ParameterModifier): Similar function to return
13314         info about the argument's modifiers.
13315
13316         (Invocation::OverloadResolve): Update to take into account matching modifiers 
13317         too.
13318
13319         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
13320         a new SetFormalParameters object which we pass to InternalParameters.
13321
13322 2001-10-30  Ravi Pratap  <ravi@ximian.com>
13323
13324         * expression.cs (NewArray): Merge into the ArrayCreation class.
13325
13326 2001-10-29  Ravi Pratap  <ravi@ximian.com>
13327
13328         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
13329         NewUserdefinedArray into one as there wasn't much of a use in having
13330         two separate ones.
13331
13332         * expression.cs (Argument): Change field's name to ArgType from Type.
13333
13334         (Type): New readonly property which returns the proper type, taking into 
13335         account ref/out modifiers.
13336
13337         (everywhere): Adjust code accordingly for the above.
13338
13339         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
13340         whether we are emitting for a ref or out parameter.
13341
13342         * expression.cs (Argument::Emit): Use the above field to set the state.
13343
13344         (LocalVariableReference::Emit): Update to honour the flag and emit the
13345         right stuff.
13346
13347         * parameter.cs (Attributes): Set the correct flags for ref parameters.
13348
13349         * expression.cs (Argument::FullDesc): New function to provide a full desc.
13350
13351         * support.cs (ParameterData): Add method ParameterDesc to the interface.
13352
13353         (ReflectionParameters, InternalParameters): Implement the above method.
13354
13355         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
13356         reporting errors.
13357
13358         (Invocation::FullMethodDesc): Ditto. 
13359
13360 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * cs-parser.jay: Add extra production for the second form of array
13363         creation. 
13364
13365         * expression.cs (ArrayCreation): Update to reflect the above
13366         change. 
13367
13368         * Small changes to prepare for Array initialization.
13369
13370 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
13371
13372         * typemanager.cs (ImplementsInterface): interface might be null;
13373         Deal with this problem;
13374
13375         Also, we do store negative hits on the cache (null values), so use
13376         this instead of calling t.GetInterfaces on the type everytime.
13377
13378 2001-10-28  Ravi Pratap  <ravi@ximian.com>
13379
13380         * typemanager.cs (IsBuiltinType): New method to help determine the same.
13381
13382         * expression.cs (New::DoResolve): Get rid of array creation code and instead
13383         split functionality out into different classes.
13384
13385         (New::FormArrayType): Move into NewBuiltinArray.
13386
13387         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
13388         quite useless.
13389
13390         (NewBuiltinArray): New class to handle creation of built-in arrays.
13391
13392         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
13393         account creation of one-dimensional arrays.
13394
13395         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
13396
13397         (NewUserdefinedArray::DoResolve): Implement.
13398
13399         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
13400
13401         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
13402         we maintain inside the TypeManager. This is necessary to perform lookups on the
13403         module builder.
13404
13405         (LookupType): Update to perform GetType on the module builders too.     
13406
13407         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
13408
13409         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
13410
13411 2001-10-23  Ravi Pratap  <ravi@ximian.com>
13412
13413         * expression.cs (New::DoResolve): Implement guts of array creation.
13414
13415         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
13416
13417 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
13418
13419         * expression.cs: Fix bug I introduced lsat night that broke
13420         Delegates. 
13421
13422         (Expression.Resolve): Report a 246 error (can not resolve name)
13423         if we find a SimpleName in the stream.
13424
13425         (Expression.ResolveLValue): Ditto.
13426
13427         (Expression.ResolveWithSimpleName): This function is a variant of
13428         ResolveName, this one allows SimpleNames to be returned without a
13429         warning.  The only consumer of SimpleNames is MemberAccess
13430
13431 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
13434         might arrive here.  I have my doubts that this is correct.
13435
13436         * statement.cs (Lock): Implement lock statement.
13437
13438         * cs-parser.jay: Small fixes to support `lock' and `using'
13439
13440         * cs-tokenizer.cs: Remove extra space
13441
13442         * driver.cs: New flag --checked, allows to turn on integer math
13443         checking. 
13444
13445         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
13446         Threading.Monitor.Exit 
13447
13448 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
13449
13450         * expression.cs (IndexerAccess::DoResolveLValue): Set the
13451         Expression Class to be IndexerAccess.
13452
13453         Notice that Indexer::DoResolve sets the eclass to Value.
13454
13455 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * class.cs (TypeContainer::Emit): Emit code for indexers.
13458
13459         * assign.cs (IAssignMethod): New interface implemented by Indexers
13460         and Properties for handling assignment.
13461
13462         (Assign::Emit): Simplify and reuse code. 
13463
13464         * expression.cs (IndexerAccess, PropertyExpr): Implement
13465         IAssignMethod, clean up old code. 
13466
13467 2001-10-22  Ravi Pratap  <ravi@ximian.com>
13468
13469         * typemanager.cs (ImplementsInterface): New method to determine if a type
13470         implements a given interface. Provides a nice cache too.
13471
13472         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
13473         method.
13474
13475         (ConvertReferenceExplicit): Ditto.
13476
13477         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
13478         various methods, with correct names etc.
13479
13480         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
13481         Operator.UnaryNegation.
13482
13483         * cs-parser.jay (operator_declarator): Be a little clever in the case where
13484         we have a unary plus or minus operator.
13485
13486         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
13487         UnaryMinus.
13488
13489         * everywhere : update accordingly.
13490
13491         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
13492         respectively.
13493
13494         * class.cs (Method::Define): For the case where we are implementing a method
13495         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
13496         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
13497
13498 2001-10-21  Ravi Pratap  <ravi@ximian.com>
13499
13500         * interface.cs (FindMembers): Implement to work around S.R.E
13501         lameness.
13502
13503         * typemanager.cs (IsInterfaceType): Implement.
13504
13505         (FindMembers): Update to handle interface types too.
13506
13507         * expression.cs (ImplicitReferenceConversion): Re-write bits which
13508         use IsAssignableFrom as that is not correct - it doesn't work.
13509
13510         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
13511         and accordingly override EmitStatement.
13512
13513         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
13514         using the correct logic :-)
13515
13516 2001-10-19  Ravi Pratap  <ravi@ximian.com>
13517
13518         * ../errors/cs-11.cs : Add to demonstrate error -11 
13519
13520 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
13521
13522         * assign.cs (Assign::Resolve): Resolve right hand side first, and
13523         then pass this as a hint to ResolveLValue.
13524
13525         * expression.cs (FieldExpr): Add Location information
13526
13527         (FieldExpr::LValueResolve): Report assignment to readonly
13528         variable. 
13529
13530         (Expression::ExprClassFromMemberInfo): Pass location information.
13531
13532         (Expression::ResolveLValue): Add new method that resolves an
13533         LValue. 
13534
13535         (Expression::DoResolveLValue): Default invocation calls
13536         DoResolve. 
13537
13538         (Indexers): New class used to keep track of indexers in a given
13539         Type. 
13540
13541         (IStackStore): Renamed from LValue, as it did not really describe
13542         what this did.  Also ResolveLValue is gone from this interface and
13543         now is part of Expression.
13544
13545         (ElementAccess): Depending on the element access type
13546
13547         * typemanager.cs: Add `indexer_name_type' as a Core type
13548         (System.Runtime.CompilerServices.IndexerNameAttribute)
13549
13550         * statement.cs (Goto): Take a location.
13551
13552 2001-10-18  Ravi Pratap  <ravi@ximian.com>
13553
13554         * delegate.cs (Delegate::VerifyDelegate): New method to verify
13555         if two delegates are compatible.
13556
13557         (NewDelegate::DoResolve): Update to take care of the case when
13558         we instantiate a delegate from another delegate.
13559
13560         * typemanager.cs (FindMembers): Don't even try to look up members
13561         of Delegate types for now.
13562
13563 2001-10-18  Ravi Pratap  <ravi@ximian.com>
13564
13565         * delegate.cs (NewDelegate): New class to take care of delegate
13566         instantiation.
13567
13568         * expression.cs (New): Split the delegate related code out into 
13569         the NewDelegate class.
13570
13571         * delegate.cs (DelegateInvocation): New class to handle delegate 
13572         invocation.
13573
13574         * expression.cs (Invocation): Split out delegate related code into
13575         the DelegateInvocation class.
13576
13577 2001-10-17  Ravi Pratap  <ravi@ximian.com>
13578
13579         * expression.cs (New::DoResolve): Implement delegate creation fully
13580         and according to the spec.
13581
13582         (New::DoEmit): Update to handle delegates differently.
13583
13584         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
13585         because of which we were printing out arguments in reverse order !
13586
13587         * delegate.cs (VerifyMethod): Implement to check if the given method
13588         matches the delegate.
13589
13590         (FullDelegateDesc): Implement.
13591
13592         (VerifyApplicability): Implement.
13593
13594         * expression.cs (Invocation::DoResolve): Update to accordingly handle
13595         delegate invocations too.
13596
13597         (Invocation::Emit): Ditto.
13598
13599         * ../errors/cs1593.cs : Added.
13600
13601         * ../errors/cs1594.cs : Added.
13602
13603         * delegate.cs (InstanceExpression, TargetMethod): New properties.
13604
13605 2001-10-16  Ravi Pratap  <ravi@ximian.com>
13606
13607         * typemanager.cs (intptr_type): Core type for System.IntPtr
13608
13609         (InitCoreTypes): Update for the same.
13610
13611         (iasyncresult_type, asynccallback_type): Ditto.
13612
13613         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
13614         correct.
13615
13616         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
13617         too.
13618
13619         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
13620         the builders for the 4 members of a delegate type :-)
13621
13622         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
13623         type.
13624
13625         * expression.cs (New::DoResolve): Implement guts for delegate creation.
13626
13627         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
13628
13629 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
13630
13631         * statement.cs (Break::Emit): Implement.   
13632         (Continue::Emit): Implement.
13633
13634         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
13635         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
13636         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
13637         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
13638         end loop
13639
13640         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
13641         properties that track the label for the current loop (begin of the
13642         loop and end of the loop).
13643
13644 2001-10-15  Ravi Pratap  <ravi@ximian.com>
13645
13646         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
13647         use of emitting anything at all.
13648
13649         * class.cs, rootcontext.cs : Get rid of calls to the same.
13650
13651         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
13652
13653         (Populate): Define the constructor correctly and set the implementation
13654         attributes.
13655
13656         * typemanager.cs (delegate_types): New hashtable to hold delegates that
13657         have been defined.
13658
13659         (AddDelegateType): Implement.
13660
13661         (IsDelegateType): Implement helper method.
13662
13663         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
13664
13665         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
13666         and accordingly handle it.
13667
13668         * delegate.cs (Populate): Take TypeContainer argument.
13669         Implement bits to define the Invoke method. However, I still haven't figured out
13670         how to take care of the native int bit :-(
13671
13672         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
13673         Qualify the name of the delegate, not its return type !
13674
13675         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
13676         conversion.
13677
13678         (StandardConversionExists): Checking for array types turns out to be recursive.
13679
13680         (ConvertReferenceExplicit): Implement array conversion.
13681
13682         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
13683
13684 2001-10-12  Ravi Pratap  <ravi@ximian.com>
13685
13686         * cs-parser.jay (delegate_declaration): Store the fully qualified
13687         name as it is a type declaration.
13688
13689         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
13690         readonly.
13691
13692         (DefineDelegate): Renamed from Define. Does the same thing essentially,
13693         as TypeContainer::DefineType.
13694
13695         (Populate): Method in which all the definition of the various methods (Invoke)
13696         etc is done.
13697
13698         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
13699         see.
13700
13701         (CloseDelegate): Finally creates the delegate.
13702
13703         * class.cs (TypeContainer::DefineType): Update to define delegates.
13704         (Populate, Emit and CloseType): Do the same thing here too.
13705
13706         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
13707         delegates in all these operations.
13708
13709 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
13710
13711         * expression.cs: LocalTemporary: a new expression used to
13712         reference a temporary that has been created.
13713
13714         * assign.cs: Handle PropertyAccess back here, so that we can
13715         provide the proper semantic access to properties.
13716
13717         * expression.cs (Expression::ConvertReferenceExplicit): Implement
13718         a few more explicit conversions. 
13719
13720         * modifiers.cs: `NEW' modifier maps to HideBySig.
13721
13722         * expression.cs (PropertyExpr): Make this into an
13723         ExpressionStatement, and support the EmitStatement code path. 
13724
13725         Perform get/set error checking, clean up the interface.
13726
13727         * assign.cs: recognize PropertyExprs as targets, and if so, turn
13728         them into toplevel access objects.
13729
13730 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
13731
13732         * expression.cs: PropertyExpr::PropertyExpr: use work around the
13733         SRE.
13734
13735         * typemanager.cs: Keep track here of our PropertyBuilders again to
13736         work around lameness in SRE.
13737
13738 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * expression.cs (LValue::LValueResolve): New method in the
13741         interface, used to perform a second resolution pass for LValues. 
13742
13743         (This::DoResolve): Catch the use of this in static methods.
13744
13745         (This::LValueResolve): Implement.
13746
13747         (This::Store): Remove warning, assigning to `this' in structures
13748         is 
13749
13750         (Invocation::Emit): Deal with invocation of
13751         methods on value types.  We need to pass the address to structure
13752         methods rather than the object itself.  (The equivalent code to
13753         emit "this" for structures leaves the entire structure on the
13754         stack instead of a pointer to it). 
13755
13756         (ParameterReference::DoResolve): Compute the real index for the
13757         argument based on whether the method takes or not a `this' pointer
13758         (ie, the method is static).
13759
13760         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
13761         value types returned from functions when we need to invoke a
13762         method on the sturcture.
13763
13764
13765 2001-10-11  Ravi Pratap  <ravi@ximian.com>
13766
13767         * class.cs (TypeContainer::DefineType): Method to actually do the business of
13768         defining the type in the Modulebuilder or Typebuilder. This is to take
13769         care of nested types which need to be defined on the TypeBuilder using
13770         DefineNestedMethod.
13771
13772         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
13773         methods in RootContext, only ported to be part of TypeContainer.
13774
13775         (TypeContainer::GetInterfaceOrClass): Ditto.
13776
13777         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
13778
13779         * interface.cs (Interface::DefineInterface): New method. Does exactly
13780         what RootContext.CreateInterface did earlier, only it takes care of nested types 
13781         too.
13782
13783         (Interface::GetInterfaces): Move from RootContext here and port.
13784
13785         (Interface::GetInterfaceByName): Same here.
13786
13787         * rootcontext.cs (ResolveTree): Re-write.
13788
13789         (PopulateTypes): Re-write.
13790
13791         * class.cs (TypeContainer::Populate): Populate nested types too.
13792         (TypeContainer::Emit): Emit nested members too.
13793
13794         * typemanager.cs (AddUserType): Do not make use of the FullName property,
13795         instead just use the name argument passed in as it is already fully
13796         qualified.
13797
13798         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
13799         to TypeContainer mapping to see if a type is user-defined.
13800
13801         * class.cs (TypeContainer::CloseType): Implement. 
13802
13803         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
13804         the default constructor.
13805
13806         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
13807         twice.
13808
13809         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
13810
13811         * interface.cs (CloseType): Create the type here.
13812
13813         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
13814         the hierarchy.
13815
13816         Remove all the methods which are now in TypeContainer.
13817
13818 2001-10-10  Ravi Pratap  <ravi@ximian.com>
13819
13820         * delegate.cs (Define): Re-write bits to define the delegate
13821         correctly.
13822
13823 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
13824
13825         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
13826
13827         * expression.cs (ImplicitReferenceConversion): handle null as well
13828         as a source to convert to any reference type.
13829
13830         * statement.cs (Return): Perform any implicit conversions to
13831         expected return type.  
13832
13833         Validate use of return statement.  
13834
13835         * codegen.cs (EmitContext): Pass the expected return type here.
13836
13837         * class.cs (Method, Constructor, Property): Pass expected return
13838         type to EmitContext.
13839
13840 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * expression.cs: Make DoResolve take an EmitContext instead of a
13843         TypeContainer.
13844
13845         Replaced `l' and `location' for `loc', for consistency.
13846
13847         (Error, Warning): Remove unneeded Tc argument.
13848
13849         * assign.cs, literal.cs, constant.cs: Update to new calling
13850         convention. 
13851
13852         * codegen.cs: EmitContext now contains a flag indicating whether
13853         code is being generated in a static method or not.
13854
13855         * cs-parser.jay: DecomposeQI, new function that replaces the old
13856         QualifiedIdentifier.  Now we always decompose the assembled
13857         strings from qualified_identifier productions into a group of
13858         memberaccesses.
13859
13860 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * rootcontext.cs: Deal with field-less struct types correctly now
13863         by passing the size option to Define Type.
13864
13865         * class.cs: Removed hack that created one static field. 
13866
13867 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
13868
13869         * statement.cs: Moved most of the code generation here. 
13870
13871 2001-10-09  Ravi Pratap  <ravi@ximian.com>
13872
13873         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
13874         seem very right.
13875
13876         (ElementAccess): Remove useless bits for now - keep checks as the spec
13877         says.
13878
13879 2001-10-08  Ravi Pratap  <ravi@ximian.com>
13880
13881         * expression.cs (ElementAccess::DoResolve): Remove my crap code
13882         and start performing checks according to the spec.
13883
13884 2001-10-07  Ravi Pratap  <ravi@ximian.com>
13885
13886         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
13887         rank_specifiers instead.
13888
13889         (rank_specifiers): Change the order in which the rank specifiers are stored
13890
13891         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
13892
13893         * expression.cs (ElementAccess): Implement the LValue interface too.
13894
13895 2001-10-06  Ravi Pratap  <ravi@ximian.com>
13896
13897         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
13898         except that user defined conversions are not included.
13899
13900         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
13901         perform the conversion of the return type, if necessary.
13902
13903         (New::DoResolve): Check whether we are creating an array or an object
13904         and accordingly do the needful.
13905
13906         (New::Emit): Same here.
13907
13908         (New::DoResolve): Implement guts of array creation.
13909
13910         (New::FormLookupType): Helper function.
13911
13912 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * codegen.cs: Removed most of the code generation here, and move the
13915         corresponding code generation bits to the statement classes. 
13916
13917         Added support for try/catch/finalize and throw.
13918
13919         * cs-parser.jay: Added support for try/catch/finalize.
13920
13921         * class.cs: Catch static methods having the flags override,
13922         virtual or abstract.
13923
13924         * expression.cs (UserCast): This user cast was not really doing
13925         what it was supposed to do.  Which is to be born in fully resolved
13926         state.  Parts of the resolution were being performed at Emit time! 
13927
13928         Fixed this code.
13929
13930 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
13931
13932         * expression.cs: Implicity convert the result from UserCast.
13933
13934 2001-10-05  Ravi Pratap  <ravi@ximian.com>
13935
13936         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
13937         prevented it from working correctly. 
13938
13939         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
13940         merely ConvertImplicit.
13941
13942 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
13943
13944         * typemanager.cs: Make the LookupTypeContainer function static,
13945         and not per-instance.  
13946
13947         * class.cs: Make static FindMembers (the one that takes a Type
13948         argument). 
13949
13950         * codegen.cs: Add EmitForeach here.
13951
13952         * cs-parser.jay: Make foreach a toplevel object instead of the
13953         inline expansion, as we need to perform semantic analysis on it. 
13954
13955 2001-10-05  Ravi Pratap  <ravi@ximian.com>
13956
13957         * expression.cs (Expression::ImplicitUserConversion): Rename to
13958         UserDefinedConversion.
13959
13960         (Expression::UserDefinedConversion): Take an extra argument specifying 
13961         whether we look for explicit user conversions too.
13962
13963         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
13964
13965         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
13966
13967         (ExplicitUserConversion): Make it a call to UserDefinedConversion
13968         with the appropriate arguments.
13969
13970         * cs-parser.jay (cast_expression): Record location too.
13971
13972         * expression.cs (Cast): Record location info.
13973
13974         (Expression::ConvertExplicit): Take location argument.
13975
13976         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
13977         to determine if we are doing explicit conversions.
13978
13979         (UserCast::Emit): Update accordingly.
13980
13981         (Expression::ConvertExplicit): Report an error if everything fails.
13982
13983         * ../errors/cs0030.cs : Add.
13984
13985 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
13986
13987         * modifiers.cs: If the ABSTRACT keyword is present, also set the
13988         virtual and newslot bits. 
13989
13990         * class.cs (TypeContainer::RegisterRequiredImplementations):
13991         Record methods we need.
13992
13993         (TypeContainer::MakeKey): Helper function to make keys for
13994         MethodBases, since the Methodbase key is useless.
13995
13996         (TypeContainer::Populate): Call RegisterRequiredImplementations
13997         before defining the methods.   
13998
13999         Create a mapping for method_builders_to_methods ahead of time
14000         instead of inside a tight loop.
14001
14002         (::RequireMethods):  Accept an object as the data to set into the
14003         hashtable so we can report interface vs abstract method mismatch.
14004
14005 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
14006
14007         * report.cs: Make all of it static.
14008
14009         * rootcontext.cs: Drop object_type and value_type computations, as
14010         we have those in the TypeManager anyways.
14011
14012         Drop report instance variable too, now it is a global.
14013
14014         * driver.cs: Use try/catch on command line handling.
14015
14016         Add --probe option to debug the error reporting system with a test
14017         suite. 
14018
14019         * report.cs: Add support for exiting program when a probe
14020         condition is reached.
14021
14022 2001-10-03  Ravi Pratap  <ravi@ximian.com>
14023
14024         * expression.cs (Binary::DoNumericPromotions): Fix the case when
14025         we do a forcible conversion regardless of type, to check if 
14026         ForceConversion returns a null.
14027
14028         (Binary::error19): Use location to report error.
14029
14030         (Unary::error23): Use location here too.
14031
14032         * ../errors/cs0019.cs : Check in.
14033
14034         * ../errors/cs0023.cs : Check in.
14035
14036         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
14037         case of a non-null MethodInfo object with a length of 0 !
14038
14039         (Binary::ResolveOperator): Flag error if overload resolution fails to find
14040         an applicable member - according to the spec :-)
14041         Also fix logic to find members in base types.
14042
14043         (Unary::ResolveOperator): Same here.
14044
14045         (Unary::report23): Change name to error23 and make first argument a TypeContainer
14046         as I was getting thoroughly confused between this and error19 :-)
14047
14048         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
14049         (::FindMostEncompassedType): Implement.
14050         (::FindMostEncompassingType): Implement.
14051         (::StandardConversionExists): Implement.
14052
14053         (UserImplicitCast): Re-vamp. We now need info about most specific
14054         source and target types so that we can do the necessary conversions.
14055
14056         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
14057         mathematical union with no duplicates.
14058
14059 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
14060
14061         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
14062         in order from base classes to child classes, so that we can in
14063         child classes look up in our parent for method names and
14064         attributes (required for handling abstract, virtual, new, override
14065         constructs: we need to instrospect our base class, and if we dont
14066         populate the classes in order, the introspection might be
14067         incorrect.  For example, a method could query its parent before
14068         the parent has any methods and would determine that the parent has
14069         no abstract methods (while it could have had them)).
14070
14071         (RootContext::CreateType): Record the order in which we define the
14072         classes.
14073
14074 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
14075
14076         * class.cs (TypeContainer::Populate): Also method definitions can
14077         fail now, keep track of this.
14078
14079         (TypeContainer::FindMembers): Implement support for
14080         DeclaredOnly/noDeclaredOnly flag.
14081
14082         (Constructor::Emit) Return the ConstructorBuilder.
14083
14084         (Method::Emit) Return the MethodBuilder. 
14085         Check for abstract or virtual methods to be public.
14086
14087         * rootcontext.cs (RootContext::CreateType): Register all the
14088         abstract methods required for the class to be complete and the
14089         interface methods that must be implemented. 
14090
14091         * cs-parser.jay: Report error 501 (method requires body if it is
14092         not marked abstract or extern).
14093
14094         * expression.cs (TypeOf::Emit): Implement.
14095
14096         * typemanager.cs: runtime_handle_type, new global type.
14097
14098         * class.cs (Property::Emit): Generate code for properties.
14099
14100 2001-10-02  Ravi Pratap  <ravi@ximian.com>
14101
14102         * expression.cs (Unary::ResolveOperator): Find operators on base type
14103         too - we now conform exactly to the spec.
14104
14105         (Binary::ResolveOperator): Same here.
14106
14107         * class.cs (Operator::Define): Fix minor quirk in the tests.
14108
14109         * ../errors/cs0215.cs : Added.
14110
14111         * ../errors/cs0556.cs : Added.
14112
14113         * ../errors/cs0555.cs : Added.
14114
14115 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
14116
14117         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
14118         single integer which is really efficient
14119
14120 2001-10-01  Ravi Pratap  <ravi@ximian.com>
14121
14122         *  expression.cs (Expression::ImplicitUserConversion): Use location
14123         even in the case when we are examining True operators.
14124  
14125         * class.cs (Operator::Define): Perform extensive checks to conform
14126         with the rules for operator overloading in the spec.
14127
14128         * expression.cs (Expression::ImplicitReferenceConversion): Implement
14129         some of the other conversions mentioned in the spec.
14130
14131         * typemanager.cs (array_type): New static member for the System.Array built-in
14132         type.
14133
14134         (cloneable_interface): For System.ICloneable interface.
14135
14136         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
14137         we start resolving the tree and populating types.
14138
14139         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
14140  
14141 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
14142
14143         * expression.cs (Expression::ExprClassFromMemberInfo,
14144         Expression::Literalize): Create literal expressions from
14145         FieldInfos which are literals.
14146
14147         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
14148         type casts, because they were wrong.  The test suite in tests
14149         caught these ones.
14150
14151         (ImplicitNumericConversion): ushort to ulong requires a widening
14152         cast. 
14153
14154         Int32 constant to long requires widening cast as well.
14155
14156         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
14157         for integers because the type on the stack is not i4.
14158
14159 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * expression.cs (report118): require location argument. 
14162
14163         * parameter.cs: Do not dereference potential null value.
14164
14165         * class.cs: Catch methods that lack the `new' keyword when
14166         overriding a name.  Report warnings when `new' is used without
14167         anything being there to override.
14168
14169         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
14170
14171         * class.cs: Only add constructor to hashtable if it is non-null
14172         (as now constructors can fail on define).
14173
14174         (TypeManager, Class, Struct): Take location arguments.
14175
14176         Catch field instance initialization in structs as errors.
14177
14178         accepting_filter: a new filter for FindMembers that is static so
14179         that we dont create an instance per invocation.
14180
14181         (Constructor::Define): Catch errors where a struct constructor is
14182         parameterless 
14183
14184         * cs-parser.jay: Pass location information for various new
14185         constructs. 
14186
14187         * delegate.cs (Delegate): take a location argument.
14188
14189         * driver.cs: Do not call EmitCode if there were problesm in the
14190         Definition of the types, as many Builders wont be there. 
14191
14192         * decl.cs (Decl::Decl): Require a location argument.
14193
14194         * cs-tokenizer.cs: Handle properly hex constants that can not fit
14195         into integers, and find the most appropiate integer for it.
14196
14197         * literal.cs: Implement ULongLiteral.
14198
14199         * rootcontext.cs: Provide better information about the location of
14200         failure when CreateType fails.
14201
14202 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
14203
14204         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
14205         as well.
14206
14207         * expression.cs (Binary::CheckShiftArguments): Add missing type
14208         computation.
14209         (Binary::ResolveOperator): Add type to the logical and and logical
14210         or, Bitwise And/Or and Exclusive Or code paths, it was missing
14211         before.
14212
14213         (Binary::DoNumericPromotions): In the case where either argument
14214         is ulong (and most signed types combined with ulong cause an
14215         error) perform implicit integer constant conversions as well.
14216
14217 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
14218
14219         * expression.cs (UserImplicitCast): Method should always be
14220         non-null. 
14221         (Invocation::BetterConversion): Simplified test for IntLiteral.
14222
14223         (Expression::ImplicitNumericConversion): Split this routine out.
14224         Put the code that performs implicit constant integer conversions
14225         here. 
14226
14227         (Expression::Resolve): Become a wrapper around DoResolve so we can
14228         check eclass and type being set after resolve.
14229
14230         (Invocation::Badness): Remove this dead function
14231
14232         (Binary::ResolveOperator): Do not compute the expensive argumnets
14233         unless we have a union for it.
14234
14235         (Probe::Emit): Is needs to do an isinst and then
14236         compare against null.
14237
14238         (::CanConvert): Added Location argument.  If the Location argument
14239         is null (Location.Null), then we do not report errors.  This is
14240         used by the `probe' mechanism of the Explicit conversion.  We do
14241         not want to generate an error for something that the user
14242         explicitly requested to be casted.  But the pipeline for an
14243         explicit cast first tests for potential implicit casts.
14244
14245         So for now, if the Location is null, it means `Probe only' to
14246         avoid adding another argument.   Might have to revise this
14247         strategy later.
14248
14249         (ClassCast): New class used to type cast objects into arbitrary
14250         classes (used in Explicit Reference Conversions).
14251
14252         Implement `as' as well.
14253
14254         Reverted all the patches from Ravi below: they were broken:
14255
14256                 * The use of `level' as a mechanism to stop recursive
14257                   invocations is wrong.  That was there just to catch the
14258                   bug with a strack trace but not as a way of addressing
14259                   the problem.
14260
14261                   To fix the problem we have to *understand* what is going
14262                   on and the interactions and come up with a plan, not
14263                   just get things going.
14264
14265                 * The use of the type conversion cache that I proposed
14266                   last night had an open topic: How does this work across
14267                   protection domains.  A user defined conversion might not
14268                   be public in the location where we are applying the
14269                   conversion, a different conversion might be selected
14270                   (ie, private A->B (better) but public B->A (worse),
14271                   inside A, A->B applies, but outside it, B->A will
14272                   apply).
14273
14274                 * On top of that (ie, even if the above is solved),
14275                   conversions in a cache need to be abstract.  Ie, `To
14276                   convert from an Int to a Short use an OpcodeCast', not
14277                   `To convert from an Int to a Short use the OpcodeCast on
14278                   the variable 5' (which is what this patch was doing).
14279
14280 2001-09-28  Ravi Pratap  <ravi@ximian.com>
14281
14282         * expression.cs (Invocation::ConversionExists): Re-write to use
14283         the conversion cache
14284
14285         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
14286         cache all conversions done, not just user-defined ones.
14287
14288         (Invocation::BetterConversion): The real culprit. Use ConversionExists
14289         to determine if a conversion exists instead of acutually trying to 
14290         perform the conversion. It's faster too.
14291
14292         (Expression::ConvertExplicit): Modify to use ConversionExists to check
14293         and only then attempt the implicit conversion.
14294
14295 2001-09-28  Ravi Pratap  <ravi@ximian.com>
14296
14297         * expression.cs (ConvertImplicit): Use a cache for conversions
14298         already found. Check level of recursion and bail out if necessary.
14299
14300 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
14301
14302         * typemanager.cs (string_concat_string_string, string_concat_object_object):
14303         Export standard methods that we expect for string operations.
14304
14305         * statement.cs (Block::UsageWarning): Track usage of variables and
14306         report the errors for not used variables.
14307
14308         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
14309         operator. 
14310
14311 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
14312
14313         * codegen.cs: remove unnneded code 
14314
14315         * expression.cs: Removed BuiltinTypeAccess class
14316
14317         Fix the order in which implicit conversions are
14318         done.  
14319
14320         The previous fixed dropped support for boxed conversions (adding a
14321         test to the test suite now)
14322
14323         (UserImplicitCast::CanConvert): Remove test for source being null,
14324         that code is broken.  We should not feed a null to begin with, if
14325         we do, then we should track the bug where the problem originates
14326         and not try to cover it up here.
14327
14328         Return a resolved expression of type UserImplicitCast on success
14329         rather than true/false.  Ravi: this is what I was talking about,
14330         the pattern is to use a static method as a "constructor" for
14331         objects. 
14332
14333         Also, do not create arguments until the very last minute,
14334         otherwise we always create the arguments even for lookups that
14335         will never be performed. 
14336
14337         (UserImplicitCast::Resolve): Eliminate, objects of type
14338         UserImplicitCast are born in a fully resolved state. 
14339
14340         * typemanager.cs (InitCoreTypes): Init also value_type
14341         (System.ValueType). 
14342
14343         * expression.cs (Cast::Resolve): First resolve the child expression.
14344
14345         (LValue): Add new method AddressOf to be used by
14346         the `&' operator.  
14347
14348         Change the argument of Store to take an EmitContext instead of an
14349         ILGenerator, because things like FieldExpr need to be able to call
14350         their children expression to generate the instance code. 
14351
14352         (Expression::Error, Expression::Warning): Sugar functions for
14353         reporting errors.
14354
14355         (Expression::MemberLookup): Accept a TypeContainer instead of a
14356         Report as the first argument.
14357
14358         (Expression::ResolvePrimary): Killed.  I still want to improve
14359         this as currently the code is just not right.
14360
14361         (Expression::ResolveMemberAccess): Simplify, but it is still
14362         wrong. 
14363
14364         (Unary::Resolve): Catch errors in AddressOf operators.
14365
14366         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
14367         index to a byte for the short-version, or the compiler will choose
14368         the wrong Emit call, which generates the wrong data.
14369
14370         (ParameterReference::Emit, ::Store): same.
14371
14372         (FieldExpr::AddressOf): Implement.
14373
14374         * typemanager.cs: TypeManager: made public variable instead of
14375         property.
14376
14377         * driver.cs: document --fatal.
14378
14379         * report.cs (ErrorMessage, WarningMessage): new names for the old
14380         Error and Warning classes.
14381
14382         * cs-parser.jay (member_access): Turn built-in access to types
14383         into a normal simplename
14384
14385 2001-09-27  Ravi Pratap  <ravi@ximian.com>
14386
14387         * expression.cs (Invocation::BetterConversion): Fix to cope
14388         with q being null, since this was introducing a bug.
14389
14390         * expression.cs (ConvertImplicit): Do built-in conversions first.
14391
14392 2001-09-27  Ravi Pratap  <ravi@ximian.com>
14393
14394         * expression.cs (UserImplicitCast::Resolve): Fix bug.
14395
14396 2001-09-27  Ravi Pratap  <ravi@ximian.com>
14397
14398         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
14399         I had introduced long ago (what's new ?).
14400
14401         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
14402         the work of all the checking. 
14403         (ConvertImplicit): Call CanConvert and only then create object if necessary.
14404         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
14405
14406         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
14407         that is the right way. 
14408
14409         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
14410         overloading resolution. Use everywhere instead of cutting and pasting code.
14411
14412         (Binary::ResolveOperator): Use MakeUnionSet.
14413
14414         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
14415         we have to convert to bool types. Not complete yet.
14416
14417 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
14418
14419         * typemanager.cs (TypeManager::CSharpName): support ushort.
14420
14421         * expression.cs (Expression::TryImplicitIntConversion): Attempts
14422         to provide an expression that performsn an implicit constant int
14423         conversion (section 6.1.6).
14424         (Expression::ConvertImplicitRequired): Reworked to include
14425         implicit constant expression conversions.
14426
14427         (Expression::ConvertNumericExplicit): Finished.
14428
14429         (Invocation::Emit): If InstanceExpression is null, then it means
14430         that we perform a call on this.
14431
14432 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * expression.cs (Unary::Emit): Remove some dead code.
14435         (Probe): Implement Resolve and Emit for `is'.
14436         (Expression::ConvertImplicitRequired): Attempt to do constant
14437         expression conversions here.  Maybe should be moved to
14438         ConvertImplicit, but I am not sure.
14439         (Expression::ImplicitLongConstantConversionPossible,
14440         Expression::ImplicitIntConstantConversionPossible): New functions
14441         that tell whether is it possible to apply an implicit constant
14442         expression conversion.
14443
14444         (ConvertNumericExplicit): Started work on explicit numeric
14445         conversions.
14446
14447         * cs-parser.jay: Update operator constants.
14448
14449         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
14450         (Parameters::GetSignature): Hook up VerifyArgs here.
14451         (Parameters::VerifyArgs): Verifies that no two arguments have the
14452         same name. 
14453
14454         * class.cs (Operator): Update the operator names to reflect the
14455         ones that the spec expects (as we are just stringizing the
14456         operator names).
14457
14458         * expression.cs (Unary::ResolveOperator): Fix bug: Use
14459         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
14460         previous usage did only work for our methods.
14461         (Expression::ConvertImplicit): Handle decimal implicit numeric
14462         conversions as well.
14463         (Expression::InternalTypeConstructor): Used to invoke constructors
14464         on internal types for default promotions.
14465
14466         (Unary::Emit): Implement special handling for the pre/post
14467         increment/decrement for overloaded operators, as they need to have
14468         the same semantics as the other operators.
14469
14470         (Binary::ResolveOperator): ditto.
14471         (Invocation::ConversionExists): ditto.
14472         (UserImplicitCast::Resolve): ditto.
14473
14474 2001-09-26  Ravi Pratap  <ravi@ximian.com>
14475
14476         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
14477         operator, return after emitting body. Regression tests pass again !
14478
14479         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
14480         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
14481         (Invocation::OverloadResolve): Ditto.
14482         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
14483
14484         * everywhere : update calls to the above methods accordingly.
14485
14486 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
14487
14488         * assign.cs (Assign): Make it inherit from ExpressionStatement.
14489
14490         * expression.cs (ExpressionStatement): New base class used for
14491         expressions that can appear in statements, so that we can provide
14492         an alternate path to generate expression that do not leave a value
14493         on the stack.
14494
14495         (Expression::Emit, and all the derivatives): We no longer return
14496         whether a value is left on the stack or not.  Every expression
14497         after being emitted leaves a single value on the stack.
14498
14499         * codegen.cs (EmitContext::EmitStatementExpression): Use the
14500         facilties of ExpressionStatement if possible.
14501
14502         * cs-parser.jay: Update statement_expression.
14503
14504 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
14505
14506         * driver.cs: Change the wording of message
14507
14508 2001-09-25  Ravi Pratap  <ravi@ximian.com>
14509
14510         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
14511         the type of the expression to the return type of the method if
14512         we have an overloaded operator match ! The regression tests pass again !
14513         (Unary::ResolveOperator): Ditto.
14514
14515         * expression.cs (Invocation::ConversionExists): Correct the member lookup
14516         to find "op_Implicit", not "implicit" ;-)
14517         (UserImplicitCast): New class to take care of user-defined implicit conversions.
14518         (ConvertImplicit, ForceConversion): Take TypeContainer argument
14519
14520         * everywhere : Correct calls to the above accordingly.
14521
14522         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
14523         (ConvertImplicit): Do user-defined conversion if it exists.
14524
14525 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
14526
14527         * assign.cs: track location.
14528         (Resolve): Use implicit conversions on assignment.
14529
14530         * literal.cs: Oops.  Not good, Emit of short access values should
14531         pass (Bytes) or the wrong argument will be selected.
14532
14533         * expression.cs (Unary::Emit): Emit code for -expr.
14534
14535         (Unary::ResolveOperator): Handle `Substract' for non-constants
14536         (substract from zero from the non-constants).
14537         Deal with Doubles as well. 
14538
14539         (Expression::ConvertImplicitRequired): New routine that reports an
14540         error if no implicit conversion exists. 
14541
14542         (Invocation::OverloadResolve): Store the converted implicit
14543         expressions if we make them
14544
14545 2001-09-24  Ravi Pratap  <ravi@ximian.com>
14546
14547         * class.cs (ConstructorInitializer): Take a Location argument.
14548         (ConstructorBaseInitializer): Same here.
14549         (ConstructorThisInitializer): Same here.
14550
14551         * cs-parser.jay : Update all calls accordingly.
14552
14553         * expression.cs (Unary, Binary, New): Take location argument.
14554         Update accordingly everywhere.
14555
14556         * cs-parser.jay : Update all calls to the above to take a location
14557         argument.
14558
14559         * class.cs : Ditto.
14560
14561 2001-09-24  Ravi Pratap  <ravi@ximian.com>
14562
14563         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
14564         (Invocation::BetterConversion): Same here
14565         (Invocation::ConversionExists): Ditto.
14566
14567         (Invocation::ConversionExists): Implement.
14568
14569 2001-09-22  Ravi Pratap  <ravi@ximian.com>
14570
14571         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
14572         Also take an additional TypeContainer argument.
14573
14574         * All over : Pass in TypeContainer as argument to OverloadResolve.
14575
14576         * typemanager.cs (CSharpName): Update to check for the string type and return
14577         that too.
14578
14579         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
14580         a given method.
14581
14582 2001-09-21  Ravi Pratap  <ravi@ximian.com>
14583
14584         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
14585         (Invocation::BetterFunction): Implement.
14586         (Invocation::BetterConversion): Implement.
14587         (Invocation::ConversionExists): Skeleton, no implementation yet.
14588
14589         Okay, things work fine !
14590
14591 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * typemanager.cs: declare and load enum_type, delegate_type and
14594         void_type. 
14595
14596         * expression.cs (Expression::Emit): Now emit returns a value that
14597         tells whether a value is left on the stack or not.  This strategy
14598         might be reveted tomorrow with a mechanism that would address
14599         multiple assignments.
14600         (Expression::report118): Utility routine to report mismatches on
14601         the ExprClass.
14602
14603         (Unary::Report23): Report impossible type/operator combination
14604         utility function.
14605
14606         (Unary::IsIncrementableNumber): Whether the type can be
14607         incremented or decremented with add.
14608         (Unary::ResolveOperator): Also allow enumerations to be bitwise
14609         complemented. 
14610         (Unary::ResolveOperator): Implement ++, !, ~,
14611
14612         (Invocation::Emit): Deal with new Emit convetion.
14613
14614         * All Expression derivatives: Updated their Emit method to return
14615         whether they leave values on the stack or not.
14616
14617         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
14618         stack for expressions that are statements. 
14619
14620 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
14621
14622         * expression.cs (LValue): New interface.  Must be implemented by
14623         LValue objects.
14624         (LocalVariableReference, ParameterReference, FieldExpr): Implement
14625         LValue interface.
14626
14627         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
14628         interface for generating code, simplifies the code.
14629
14630 2001-09-20  Ravi Pratap  <ravi@ximian.com>
14631
14632         * expression.cs (everywhere): Comment out return statements in ::Resolve
14633         methods to avoid the warnings.
14634
14635 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
14636
14637         * driver.cs (parse): Report error 2001 if we can not open the
14638         source file.
14639
14640         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
14641         not resolve it.
14642
14643         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
14644         object. 
14645
14646         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
14647         otherwise nested blocks end up with the same index.
14648
14649         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
14650
14651         * expression.cs:  Instead of having FIXMEs in the Resolve
14652         functions, throw exceptions so it is obvious that we are facing a
14653         bug. 
14654
14655         * cs-parser.jay (invocation_expression): Pass Location information.
14656
14657         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
14658         Use a basename for those routines because .NET does not like paths
14659         on them. 
14660
14661         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
14662         already defined.
14663
14664 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
14667         are loading the correct data types (throws an exception if not).
14668         (TypeManager::InitCoreTypes): Use CoreLookupType
14669
14670         * expression.cs (Unary::ResolveOperator): return the child
14671         expression for expressions which are just +expr.
14672         (Unary::ResolveOperator): Return negative literals for -LITERAL
14673         expressions (otherwise they are Unary {Literal}).
14674         (Invocation::Badness): Take into account `Implicit constant
14675         expression conversions'.
14676
14677         * literal.cs (LongLiteral): Implement long literal class.
14678         (IntLiteral): export the `Value' of the intliteral. 
14679
14680 2001-09-19  Ravi Pratap  <ravi@ximian.com>
14681
14682         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
14683
14684         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
14685         instead of 'Operator'
14686
14687         * expression.cs (Binary::ResolveOperator): Update accordingly.
14688         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
14689         and 'Minus'
14690
14691         * cs-parser.jay (unary_expression): Update to use the new names.
14692
14693         * gen-treedump.cs (GetUnary): Same here.
14694
14695         * expression.cs (Unary::Resolve): Implement.
14696         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
14697         operators are found instead of making noise ;-)
14698         (Unary::ResolveOperator): New method to do precisely the same thing which
14699         Binary::ResolveOperator does for Binary expressions.
14700         (Unary.method, .Arguments): Add.
14701         (Unary::OperName): Implement.   
14702         (Unary::ForceConversion): Copy and Paste !
14703
14704         * class.cs (Operator::Define): Fix a small bug for the case when we have 
14705         a unary operator.
14706
14707         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
14708         for the inbuilt operators. Only overloading works for now ;-)
14709
14710 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
14711
14712         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
14713         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
14714
14715         * expression.cs (This::Emit): Implement. 
14716         (This::Resolve): Implement.
14717         (TypeOf:Resolve): Implement.
14718         (Expression::ResolveSimpleName): Add an implicit this to instance
14719         field references. 
14720         (MemberAccess::Resolve): Deal with Parameters and Fields. 
14721         Bind instance variable to Field expressions.
14722         (FieldExpr::Instance): New field used to track the expression that
14723         represents the object instance.
14724         (FieldExpr::Resolve): Track potential errors from MemberLookup not
14725         binding 
14726         (FieldExpr::Emit): Implement.
14727
14728         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
14729         the last instruction contains a return opcode to avoid generating
14730         the last `ret' instruction (this generates correct code, and it is
14731         nice to pass the peverify output).
14732
14733         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
14734         initializer for static and instance variables.
14735         (Constructor::Emit): Allow initializer to be null in the case of
14736         static constructors.  Only emit initializer for instance
14737         constructors. 
14738
14739         (TypeContainer::FindMembers): Return a null array if there are no
14740         matches.
14741
14742         Also fix the code for the MemberTypes.Method branch, as it was not
14743         scanning that for operators (or tried to access null variables before).
14744
14745         * assign.cs (Assign::Emit): Handle instance and static fields. 
14746
14747         * TODO: Updated.
14748
14749         * driver.cs: Stop compilation if there are parse errors.
14750
14751         * cs-parser.jay (constructor_declaration): Provide default base
14752         initializer for non-static constructors.
14753         (constructor_declarator): Do not provide a default base
14754         initializers if none was specified.
14755         Catch the fact that constructors should not have parameters.
14756
14757         * class.cs: Do not emit parent class initializers for static
14758         constructors, that should be flagged as an error.
14759
14760 2001-09-18  Ravi Pratap  <ravi@ximian.com>
14761
14762         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
14763         Move back code into TypeContainer::Populate.
14764
14765 2001-09-18  Ravi Pratap  <ravi@ximian.com>
14766
14767         * class.cs (TypeContainer::AddConstructor): Fix the check to
14768         compare against Name, not Basename. 
14769         (Operator::OpType): Change Plus and Minus to Add and Subtract.
14770
14771         * cs-parser.jay : Update accordingly.
14772
14773         * class.cs (TypeContainer::FindMembers): For the case where we are searching
14774         for methods, don't forget to look into the operators too.
14775         (RegisterMethodBuilder): Helper method to take care of this for
14776         methods, constructors and operators.
14777         (Operator::Define): Completely revamp.
14778         (Operator.OperatorMethod, MethodName): New fields.
14779         (TypeContainer::Populate): Move the registering of builders into
14780         RegisterMethodBuilder.
14781         (Operator::Emit): Re-write.
14782
14783         * expression.cs (Binary::Emit): Comment out code path to emit method
14784         invocation stuff for the case when we have a user defined operator. I am
14785         just not able to get it right !
14786
14787 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
14790         argument. 
14791
14792         (Expression::MemberLookup): Provide a version that allows to
14793         specify the MemberTypes and BindingFlags. 
14794
14795         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
14796         so it was not fetching variable information from outer blocks.
14797
14798         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
14799         Beforefieldinit as it was buggy.
14800
14801         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
14802         that Ravi put here.  
14803
14804         * class.cs (Constructor::Emit): Only emit if block is not null.
14805         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
14806         deal with this by semantically definining it as if the user had
14807         done it.
14808
14809         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
14810         constructors as we now "emit" them at a higher level.
14811
14812         (TypeContainer::DefineDefaultConstructor): Used to define the
14813         default constructors if none was provided.
14814
14815         (ConstructorInitializer): Add methods Resolve and Emit. 
14816
14817         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
14818
14819 2001-09-17  Ravi Pratap  <ravi@ximian.com>
14820
14821         * class.cs (TypeContainer::EmitDefaultConstructor): Register
14822         the default constructor builder with our hashtable for methodbuilders
14823         to methodcores.
14824
14825         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
14826         and argument_count is 0 in which case we have a match.
14827         (Binary::ResolveOperator): More null checking and miscellaneous coding
14828         style cleanup.
14829
14830 2001-09-17  Ravi Pratap  <ravi@ximian.com>
14831
14832         * rootcontext.cs (IsNameSpace): Compare against null.
14833
14834         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
14835
14836         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
14837         and Unary::Operator.
14838
14839         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
14840         accordingly.
14841
14842         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
14843         we have overloaded operators.
14844         (Binary::ResolveOperator): Implement the part which does the operator overload
14845         resolution.
14846
14847         * class.cs (Operator::Emit): Implement.
14848         (TypeContainer::Emit): Emit the operators we have too.
14849
14850         * expression.cs (Binary::Emit): Update to emit the appropriate code for
14851         the case when we have a user-defined operator.
14852
14853 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
14854
14855         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
14856
14857 2001-09-16  Ravi Pratap  <ravi@ximian.com>
14858
14859         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
14860         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
14861         (Constructor::Emit): Implement.
14862         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
14863         if we have no work to do. 
14864         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
14865         Emit method.
14866
14867         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
14868         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
14869
14870         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
14871         of parent.parent.
14872
14873 2001-09-15  Ravi Pratap  <ravi@ximian.com>
14874
14875         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
14876         in the source.
14877         (Tree::RecordNamespace): Method to do what the name says ;-)
14878         (Tree::Namespaces): Property to get at the namespaces hashtable.
14879
14880         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
14881         keep track.
14882
14883         * rootcontext.cs (IsNamespace): Fixed it :-)
14884
14885 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
14886
14887         * class.cs (TypeContainer::FindMembers): Add support for
14888         constructors. 
14889         (MethodCore): New class that encapsulates both the shared aspects
14890         of a Constructor and a Method.  
14891         (Method, Constructor): Factored pieces into MethodCore.
14892
14893         * driver.cs: Added --fatal which makes errors throw exceptions.
14894         Load System assembly as well as part of the standard library.
14895
14896         * report.cs: Allow throwing exceptions on errors for debugging.
14897
14898         * modifiers.cs: Do not use `parent', instead use the real type
14899         container to evaluate permission settings.
14900
14901         * class.cs: Put Ravi's patch back in.  He is right, and we will
14902         have to cope with the
14903
14904 2001-09-14  Ravi Pratap  <ravi@ximian.com>
14905
14906         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
14907         FamORAssem, not FamANDAssem.
14908
14909 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * driver.cs: Added --parse option that only parses its input files
14912         and terminates.
14913
14914         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
14915         incorrect.  IsTopLevel is not used to tell whether an object is
14916         root_types or not (that can be achieved by testing this ==
14917         root_types).  But to see if this is a top-level *class* (not
14918         necessarly our "toplevel" container). 
14919
14920 2001-09-14  Ravi Pratap  <ravi@ximian.com>
14921
14922         * enum.cs (Enum::Define): Modify to call the Lookup method on the
14923         parent instead of a direct call to GetType.
14924
14925 2001-09-14  Ravi Pratap  <ravi@ximian.com>
14926
14927         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
14928         Modifiers.TypeAttr. This should just be a call to that method.
14929
14930         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
14931         object so that we can determine if we are top-level or not.
14932
14933         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
14934         TypeContainer too.
14935
14936         * enum.cs (Enum::Define): Ditto.
14937
14938         * modifiers.cs (FieldAttr): Re-write.
14939
14940         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
14941         (TypeContainer::HaveStaticConstructor): New property to provide access
14942         to precisely that info.
14943
14944         * modifiers.cs (MethodAttr): Re-write.
14945         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
14946
14947         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
14948         of top-level types as claimed.
14949
14950 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
14951
14952         * expression.cs (MemberLookup): Fruitless attempt to lookup
14953         constructors.  Maybe I need to emit default constructors?  That
14954         might be it (currently .NET emits this for me automatically).
14955         (Invocation::OverloadResolve): Cope with Arguments == null.
14956         (Invocation::EmitArguments): new function, shared by the new
14957         constructor and us.
14958         (Invocation::Emit): Handle static and instance methods.  Emit
14959         proper call instruction for virtual or non-virtual invocations.
14960         (New::Emit): Implement.
14961         (New::Resolve): Implement.
14962         (MemberAccess:Resolve): Implement.
14963         (MethodGroupExpr::InstanceExpression): used conforming to the spec
14964         to track instances.
14965         (FieldExpr::Resolve): Set type.
14966
14967         * support.cs: Handle empty arguments.
14968                 
14969         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
14970         SimpleLookup): Auxiliary routines to help parse a qualifier
14971         identifier.  
14972
14973         Update qualifier_identifier rule.
14974
14975         * codegen.cs: Removed debugging messages.
14976
14977         * class.cs: Make this a global thing, this acts just as a "key" to
14978         objects that we might have around.
14979
14980         (Populate): Only initialize method_builders_to_methods once.
14981
14982         * expression.cs (PropertyExpr): Initialize type from the
14983         PropertyType. 
14984
14985         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
14986         Resolve pattern.  Attempt to implicitly convert value to boolean.
14987         Emit code.
14988
14989         * expression.cs: Set the type for the int32/int32 argument case.
14990         (Binary::ResolveOperator): Set the return type to boolean for
14991         comparission operators
14992
14993         * typemanager.cs: Remove debugging print code.
14994
14995         (Invocation::Resolve): resolve type.
14996
14997         * class.cs: Allocate a MemberInfo of the correct size, as the code
14998         elsewhere depends on the test to reflect the correct contents.
14999
15000         (Method::) Keep track of parameters, due to System.Reflection holes
15001
15002         (TypeContainer::Populate): Keep track of MethodBuilders to Method
15003         mapping here.
15004
15005         (TypeContainer::FindMembers): Use ArrayList and then copy an array
15006         of the exact size and return that.
15007
15008         (Class::LookupMethodByBuilder): New function that maps
15009         MethodBuilders to its methods.  Required to locate the information
15010         on methods because System.Reflection bit us again.
15011
15012         * support.cs: New file, contains an interface ParameterData and
15013         two implementations: ReflectionParameters and InternalParameters
15014         used to access Parameter information.  We will need to grow this
15015         as required.
15016
15017         * expression.cs (Invocation::GetParameterData): implement a cache
15018         and a wrapper around the ParameterData creation for methods. 
15019         (Invocation::OverloadResolve): Use new code.
15020
15021 2001-09-13  Ravi Pratap  <ravi@ximian.com>
15022
15023         * class.cs (TypeContainer::EmitField): Remove and move into 
15024         (Field::Define): here and modify accordingly.
15025         (Field.FieldBuilder): New member.
15026         (TypeContainer::Populate): Update accordingly.
15027         (TypeContainer::FindMembers): Implement.
15028
15029 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
15030
15031         * statement.cs: (VariableInfo::VariableType): New field to be
15032         initialized with the full type once it is resolved. 
15033
15034 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
15035
15036         * parameter.cs (GetParameterInfo): Use a type cache to compute
15037         things only once, and to reuse this information
15038
15039         * expression.cs (LocalVariableReference::Emit): Implement.
15040         (OpcodeCast::Emit): fix.
15041
15042         (ParameterReference::Resolve): Implement.
15043         (ParameterReference::Emit): Implement.
15044
15045         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
15046         that are expressions need to stay as Expressions.
15047
15048         * typemanager.cs (CSharpName): Returns the C# name of a type if
15049         possible. 
15050
15051         * expression.cs (Expression::ConvertImplicit): New function that
15052         implements implicit type conversions.
15053
15054         (Expression::ImplicitReferenceConversion): Implements implicit
15055         reference conversions.
15056
15057         (EmptyCast): New type for transparent casts.
15058
15059         (OpcodeCast): New type for casts of types that are performed with
15060         a sequence of bytecodes.
15061
15062         (BoxedCast): New type used for casting value types into reference
15063         types.  Emits a box opcode.
15064
15065         (Binary::DoNumericPromotions): Implements numeric promotions of
15066         and computation of the Binary::Type.
15067
15068         (Binary::EmitBranchable): Optimization.
15069
15070         (Binary::Emit): Implement code emission for expressions.
15071
15072         * typemanager.cs (TypeManager): Added two new core types: sbyte
15073         and byte.
15074
15075 2001-09-12  Ravi Pratap  <ravi@ximian.com>
15076
15077         * class.cs (TypeContainer::FindMembers): Method which does exactly
15078         what Type.FindMembers does, only we don't have to use reflection. No
15079         implementation yet.
15080
15081         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
15082         typecontainer objects as we need to get at them.
15083         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
15084
15085         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
15086         typecontainer object.
15087
15088         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
15089         of just a Report object.
15090
15091 2001-09-11  Ravi Pratap  <ravi@ximian.com>
15092
15093         * class.cs (Event::Define): Go back to using the prefixes "add_" and
15094         "remove_"
15095         (TypeContainer::Populate): Now define the delegates of the type too.
15096         (TypeContainer.Delegates): Property to access the list of delegates defined
15097         in the type.
15098
15099         * delegates.cs (Delegate::Define): Implement partially.
15100
15101         * modifiers.cs (TypeAttr): Handle more flags.
15102
15103 2001-09-11  Ravi Pratap  <ravi@ximian.com>
15104
15105         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
15106         and not <=
15107         (Operator::Define): Re-write logic to get types by using the LookupType method
15108         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
15109         (Indexer::Define): Ditto.
15110         (Event::Define): Ditto.
15111         (Property::Define): Ditto.
15112
15113 2001-09-10  Ravi Pratap  <ravi@ximian.com>
15114
15115         * class.cs (TypeContainer::Populate): Now define operators too. 
15116         (TypeContainer.Operators): New property to access the list of operators
15117         in a type.
15118         (Operator.OperatorMethodBuilder): New member to hold the method builder
15119         for the operator we are defining.
15120         (Operator::Define): Implement.
15121
15122 2001-09-10  Ravi Pratap  <ravi@ximian.com>
15123
15124         * class.cs (Event::Define): Make the prefixes of the accessor methods
15125         addOn_ and removeOn_ 
15126
15127         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
15128         of the location being passed in too. Ideally, this should go later since all
15129         error reporting should be done through the Report object.
15130
15131         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
15132         (Populate): Iterate thru the indexers we have and define them too.
15133         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
15134         for the get and set accessors.
15135         (Indexer::Define): Implement.
15136
15137 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
15140         my previous implementation, did not work.
15141
15142         * typemanager.cs: Add a couple of missing types (the longs).
15143
15144         * literal.cs: Use TypeManager.bool_type instead of getting it.
15145
15146         * expression.cs (EventExpr): New kind of expressions.
15147         (Expressio::ExprClassFromMemberInfo): finish
15148
15149 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
15150
15151         * assign.cs: Emit stores to static fields differently.
15152
15153 2001-09-08  Ravi Pratap  <ravi@ximian.com>
15154
15155         * Merge in changes and adjust code to tackle conflicts. Backed out my
15156         code in Assign::Resolve ;-) 
15157
15158 2001-09-08  Ravi Pratap  <ravi@ximian.com>
15159
15160         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
15161         instead Report.Error and also pass in the location.
15162         (CSharpParser::Lexer): New readonly property to return the reference
15163         to the Tokenizer object.
15164         (declare_local_variables): Use Report.Error with location instead of plain 
15165         old error.
15166         (CheckDef): Ditto.
15167
15168         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
15169         (Operator.CheckBinaryOperator): Ditto.
15170
15171         * cs-parser.jay (operator_declarator): Update accordingly.
15172
15173         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
15174         (CheckBinaryOperator): Same here.
15175
15176         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
15177         on the name without any prefixes of namespace names etc. This is because we
15178         already might have something already fully qualified like 
15179         'System.Console.WriteLine'
15180
15181         * assign.cs (Resolve): Begin implementation. Stuck ;-)
15182
15183 2001-09-07  Ravi Pratap  <ravi@ximian.com>
15184
15185         * cs-tokenizer.cs (location): Return a string which also contains
15186         the file name.
15187
15188         * expression.cs (ElementAccess): New class for expressions of the
15189         type 'element access.'
15190         (BaseAccess): New class for expressions of the type 'base access.'
15191         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
15192         respectively.
15193
15194         * cs-parser.jay (element_access): Implement action.
15195         (base_access): Implement actions.
15196         (checked_expression, unchecked_expression): Implement.
15197
15198         * cs-parser.jay (local_variable_type): Correct and implement.
15199         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
15200
15201         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
15202
15203         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
15204         name and the specifiers.
15205
15206         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
15207
15208         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
15209         making them all public ;-)
15210
15211         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
15212         class anyways.
15213
15214 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
15215
15216         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
15217         PropertyExprs.
15218         (FieldExpr, PropertyExprs): New resolved expressions.
15219         (SimpleName::MemberStaticCheck): Perform static checks for access
15220         to non-static fields on static methods. Maybe this should be
15221         generalized for MemberAccesses. 
15222         (SimpleName::ResolveSimpleName): More work on simple name
15223         resolution. 
15224
15225         * cs-parser.jay (primary_expression/qualified_identifier): track
15226         the parameter index.
15227
15228         * codegen.cs (CodeGen::Save): Catch save exception, report error.
15229         (EmitContext::EmitBoolExpression): Chain to expression generation
15230         instead of temporary hack.
15231         (::EmitStatementExpression): Put generic expression code generation.
15232
15233         * assign.cs (Assign::Emit): Implement variable assignments to
15234         local variables, parameters and fields.
15235
15236 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
15237
15238         * statement.cs (Block::GetVariableInfo): New method, returns the
15239         VariableInfo for a variable name in a block.
15240         (Block::GetVariableType): Implement in terms of GetVariableInfo
15241
15242         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
15243         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
15244
15245 2001-09-06  Ravi Pratap  <ravi@ximian.com>
15246
15247         * cs-parser.jay (operator_declaration): Continue on my quest : update
15248         to take attributes argument.
15249         (event_declaration): Ditto.
15250         (enum_declaration): Ditto.
15251         (indexer_declaration): Ditto.
15252
15253         * class.cs (Operator::Operator): Update constructor accordingly.
15254         (Event::Event): Ditto.
15255
15256         * delegate.cs (Delegate::Delegate): Same here.
15257
15258         * enum.cs (Enum::Enum): Same here.
15259
15260 2001-09-05  Ravi Pratap  <ravi@ximian.com>
15261
15262         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
15263
15264         * ../tests/cs0658.cs : New file to demonstrate error 0658.
15265
15266         * attribute.cs (Attributes): New class to encapsulate all attributes which were
15267         being passed around as an arraylist.
15268         (Attributes::AddAttribute): Method to add attribute sections.
15269
15270         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
15271         (struct_declaration): Update accordingly.
15272         (constant_declaration): Update.
15273         (field_declaration): Update.
15274         (method_header): Update.
15275         (fixed_parameter): Update.
15276         (parameter_array): Ditto.
15277         (property_declaration): Ditto.
15278         (destructor_declaration): Ditto.
15279
15280         * class.cs (Struct::Struct): Update constructors accordingly.
15281         (Class::Class): Ditto.
15282         (Field::Field): Ditto.
15283         (Method::Method): Ditto.
15284         (Property::Property): Ditto.
15285         (TypeContainer::OptAttribute): update property's return type.
15286
15287         * interface.cs (Interface.opt_attributes): New member.
15288         (Interface::Interface): Update to take the extra Attributes argument.
15289
15290         * parameter.cs (Parameter::Parameter): Ditto.
15291
15292         * constant.cs (Constant::Constant): Ditto.
15293
15294         * interface.cs (InterfaceMemberBase): New OptAttributes field.
15295         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
15296         the attributes as a parameter.
15297         (InterfaceProperty): Update constructor call.
15298         (InterfaceEvent): Ditto.
15299         (InterfaceMethod): Ditto.
15300         (InterfaceIndexer): Ditto.
15301
15302         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
15303         pass the attributes too.
15304         (interface_event_declaration): Ditto.
15305         (interface_property_declaration): Ditto.
15306         (interface_method_declaration): Ditto.
15307         (interface_declaration): Ditto.
15308
15309 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
15310
15311         * class.cs (Method::Define): Track the "static Main" definition to
15312         create an entry point. 
15313
15314         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
15315         EntryPoint if we find it. 
15316
15317         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
15318         (EmitContext::ig): Make this variable public.
15319
15320         * driver.cs: Make the default output file be the first file name
15321         with the .exe extension.  
15322
15323         Detect empty compilations
15324
15325         Handle various kinds of output targets.  Handle --target and
15326         rename -t to --dumper.
15327
15328         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
15329         methods inherited from Expression return now an Expression.  This
15330         will is used during the tree rewriting as we resolve them during
15331         semantic analysis.
15332
15333         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
15334         the spec.  Missing entirely is the information about
15335         accessability of elements of it.
15336
15337         (Expression::ExprClassFromMemberInfo): New constructor for
15338         Expressions that creates a fully initialized Expression based on
15339         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
15340         a Type.
15341
15342         (Invocation::Resolve): Begin implementing resolution of invocations.
15343
15344         * literal.cs (StringLiteral):  Implement Emit.
15345
15346 2001-09-05  Ravi Pratap  <ravi@ximian.com>
15347
15348         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
15349         member.
15350
15351 2001-09-04  Ravi Pratap  <ravi@ximian.com>
15352
15353         * cs-parser.jay (attribute_arguments): Implement actions.
15354         (attribute): Fix bug in production. Implement action.
15355         (attribute_list): Implement.
15356         (attribute_target): Implement.
15357         (attribute_target_specifier, opt_target_specifier): Implement
15358         (CheckAttributeTarget): New method to check if the attribute target
15359         is valid.
15360         (attribute_section): Implement.
15361         (opt_attributes): Implement.
15362
15363         * attribute.cs : New file to handle attributes.
15364         (Attribute): Class to hold attribute info.
15365
15366         * cs-parser.jay (opt_attribute_target_specifier): Remove production
15367         (attribute_section): Modify production to use 2 different rules to 
15368         achieve the same thing. 1 s/r conflict down !
15369         Clean out commented, useless, non-reducing dimension_separator rules.
15370
15371         * class.cs (TypeContainer.attributes): New member to hold list
15372         of attributes for a type.
15373         (Struct::Struct): Modify to take one more argument, the attribute list.
15374         (Class::Class): Ditto.
15375         (Field::Field): Ditto.
15376         (Method::Method): Ditto.
15377         (Property::Property): Ditto.
15378
15379         * cs-parser.jay (struct_declaration): Update constructor call to
15380         pass in the attributes too.
15381         (class_declaration): Ditto.
15382         (constant_declaration): Ditto.
15383         (field_declaration): Ditto.
15384         (method_header): Ditto.
15385         (fixed_parameter): Ditto.
15386         (parameter_array): Ditto.
15387         (property_declaration): Ditto.
15388
15389         * constant.cs (Constant::Constant): Update constructor similarly.
15390         Use System.Collections.
15391
15392         * parameter.cs (Parameter::Parameter): Update as above.
15393
15394 2001-09-02  Ravi Pratap  <ravi@ximian.com>
15395
15396         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
15397         (TypeContainer.delegates): New member to hold list of delegates.
15398
15399         * cs-parser.jay (delegate_declaration): Implement the action correctly 
15400         this time as I seem to be on crack ;-)
15401
15402 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
15403
15404         * rootcontext.cs (RootContext::IsNamespace): new function, used to
15405         tell whether an identifier represents a namespace.
15406
15407         * expression.cs (NamespaceExpr): A namespace expression, used only
15408         temporarly during expression resolution.
15409         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
15410         utility functions to resolve names on expressions.
15411
15412 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * codegen.cs: Add hook for StatementExpressions. 
15415
15416         * class.cs: Fix inverted test for static flag in methods.
15417
15418 2001-09-02  Ravi Pratap  <ravi@ximian.com>
15419
15420         * class.cs (Operator::CheckUnaryOperator): Correct error number used
15421         to make it coincide with MS' number.
15422         (Operator::CheckBinaryOperator): Ditto.
15423
15424         * ../errors/errors.txt : Remove error numbers added earlier.
15425
15426         * ../errors/cs1019.cs : Test case for error # 1019
15427
15428         * ../errros/cs1020.cs : Test case for error # 1020
15429
15430         * cs-parser.jay : Clean out commented cruft.
15431         (dimension_separators, dimension_separator): Comment out. Ostensibly not
15432         used anywhere - non-reducing rule.
15433         (namespace_declarations): Non-reducing rule - comment out.
15434
15435         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
15436         with TypeContainer::AddEnum.
15437
15438         * delegate.cs : New file for delegate handling classes.
15439         (Delegate): Class for declaring delegates.
15440
15441         * makefile : Update.
15442
15443         * cs-parser.jay (delegate_declaration): Implement.
15444
15445 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
15446
15447         * class.cs (Event::Define): Implement.
15448         (Event.EventBuilder): New member.
15449
15450         * class.cs (TypeContainer::Populate): Update to define all enums and events
15451         we have.
15452         (Events): New property for the events arraylist we hold. Shouldn't we move to using
15453         readonly fields for all these cases ?
15454
15455 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
15456
15457         * class.cs (Property): Revamp to use the convention of making fields readonly.
15458         Accordingly modify code elsewhere.
15459
15460         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
15461         the Define method of the Property class.
15462
15463         * class.cs : Clean up applied patch and update references to variables etc. Fix 
15464         trivial bug.
15465         (TypeContainer::Populate): Update to define all the properties we have. Also
15466         define all enumerations.
15467
15468         * enum.cs (Define): Implement.
15469
15470 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
15471
15472         * cs-parser.jay (overloadable_operator): The semantic value is an
15473         enum of the Operator class.
15474         (operator_declarator): Implement actions.
15475         (operator_declaration): Implement.
15476
15477         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
15478         validity of definitions.
15479         (Operator::CheckBinaryOperator): Static method to check for binary operators
15480         (TypeContainer::AddOperator): New method to add an operator to a type.
15481
15482         * cs-parser.jay (indexer_declaration): Added line to actually call the
15483         AddIndexer method so it gets added ;-)
15484
15485         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
15486         already taken care of by the MS compiler ?  
15487
15488 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
15489
15490         * class.cs (Operator): New class for operator declarations.
15491         (Operator::OpType): Enum for the various operators.
15492
15493 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
15494
15495         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
15496         ostensibly handle this in semantic analysis.
15497
15498         * cs-parser.jay (general_catch_clause): Comment out
15499         (specific_catch_clauses, specific_catch_clause): Ditto.
15500         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
15501         (catch_args, opt_catch_args): New productions.
15502         (catch_clause): Rewrite to use the new productions above
15503         (catch_clauses): Modify accordingly.
15504         (opt_catch_clauses): New production to use in try_statement
15505         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
15506         and re-write the code in the actions to extract the specific and
15507         general catch clauses by being a little smart ;-)
15508
15509         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
15510         Hooray, try and catch statements parse fine !
15511
15512 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
15513
15514         * statement.cs (Block::GetVariableType): Fix logic to extract the type
15515         string from the hashtable of variables.
15516
15517         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
15518         I end up making that mistake ;-)
15519         (catch_clauses): Fixed gross error which made Key and Value of the 
15520         DictionaryEntry the same : $1 !!
15521
15522 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
15523
15524         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
15525
15526         * cs-parser.jay (event_declaration): Correct to remove the semicolon
15527         when the add and remove accessors are specified. 
15528
15529 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
15530
15531         * cs-parser.jay (IndexerDeclaration): New helper class to hold
15532         information about indexer_declarator.
15533         (indexer_declarator): Implement actions.
15534         (parsing_indexer): New local boolean used to keep track of whether
15535         we are parsing indexers or properties. This is necessary because 
15536         implicit_parameters come into picture even for the get accessor in the 
15537         case of an indexer.
15538         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
15539
15540         * class.cs (Indexer): New class for indexer declarations.
15541         (TypeContainer::AddIndexer): New method to add an indexer to a type.
15542         (TypeContainer::indexers): New member to hold list of indexers for the
15543         type.
15544
15545 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
15546
15547         * cs-parser.jay (add_accessor_declaration): Implement action.
15548         (remove_accessor_declaration): Implement action.
15549         (event_accessors_declaration): Implement
15550         (variable_declarators): swap statements for first rule - trivial.
15551
15552         * class.cs (Event): New class to hold information about event
15553         declarations.
15554         (TypeContainer::AddEvent): New method to add an event to a type
15555         (TypeContainer::events): New member to hold list of events.
15556
15557         * cs-parser.jay (event_declaration): Implement actions.
15558
15559 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
15560
15561         * cs-parser.jay (dim_separators): Implement. Make it a string
15562         concatenating all the commas together, just as they appear.
15563         (opt_dim_separators): Modify accordingly
15564         (rank_specifiers): Update accordingly. Basically do the same
15565         thing - instead, collect the brackets here.
15566         (opt_rank_sepcifiers): Modify accordingly.
15567         (array_type): Modify to actually return the complete type string
15568         instead of ignoring the rank_specifiers.
15569         (expression_list): Implement to collect the expressions
15570         (variable_initializer): Implement. We make it a list of expressions
15571         essentially so that we can handle the array_initializer case neatly too.
15572         (variable_initializer_list): Implement.
15573         (array_initializer): Make it a list of variable_initializers
15574         (opt_array_initializer): Modify accordingly.
15575
15576         * expression.cs (New::NType): Add enumeration to help us
15577         keep track of whether we have an object/delegate creation
15578         or an array creation.
15579         (New:NewType, New::Rank, New::Indices, New::Initializers): New
15580         members to hold data about array creation.
15581         (New:New): Modify to update NewType
15582         (New:New): New Overloaded contructor for the array creation
15583         case.
15584
15585         * cs-parser.jay (array_creation_expression): Implement to call
15586         the overloaded New constructor.
15587
15588 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
15589
15590         * class.cs (TypeContainer::Constructors): Return member
15591         constructors instead of returning null.
15592
15593 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
15594
15595         * typemanager.cs (InitCoreTypes): Initialize the various core
15596         types after we have populated the type manager with the user
15597         defined types (this distinction will be important later while
15598         compiling corlib.dll)
15599
15600         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
15601         on Expression Classification.  Now all expressions have a method
15602         `Resolve' and a method `Emit'.
15603
15604         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
15605         generation from working.     Also add some temporary debugging
15606         code. 
15607
15608 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * codegen.cs: Lots of code generation pieces.  This is only the
15611         beginning, will continue tomorrow with more touches of polish.  We
15612         handle the fundamentals of if, while, do, for, return.  Others are
15613         trickier and I need to start working on invocations soon.
15614
15615         * gen-treedump.cs: Bug fix, use s.Increment here instead of
15616         s.InitStatement. 
15617
15618         * codegen.cs (EmitContext): New struct, used during code
15619         emission to keep a context.   Most of the code generation will be
15620         here. 
15621
15622         * cs-parser.jay: Add embedded blocks to the list of statements of
15623         this block.  So code generation proceeds in a top down fashion.
15624
15625 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
15626
15627         * statement.cs: Add support for multiple child blocks.
15628
15629 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
15630
15631         * codegen.cs (EmitCode): New function, will emit the code for a
15632         Block of code given a TypeContainer and its ILGenerator. 
15633
15634         * statement.cs (Block): Standard public readonly optimization.
15635         (Block::Block constructors): Link children. 
15636         (Block::Child): Child Linker.
15637         (Block::EmitVariables): Emits IL variable declarations.
15638
15639         * class.cs: Drop support for MethodGroups here, delay until
15640         Semantic Analysis.
15641         (Method::): Applied the same simplification that I did before, and
15642         move from Properties to public readonly fields.
15643         (Method::ParameterTypes): Returns the parameter types for the
15644         function, and implements a cache that will be useful later when I
15645         do error checking and the semantic analysis on the methods is
15646         performed.
15647         (Constructor::GetCallingConvention): Renamed from CallingConvetion
15648         and made a method, optional argument tells whether this is a class
15649         or a structure to apply the `has-this' bit.
15650         (Method::GetCallingConvention): Implement, returns the calling
15651         convention. 
15652         (Method::Define): Defines the type, a second pass is performed
15653         later to populate the methods.
15654
15655         (Constructor::ParameterTypes): implement a cache similar to the
15656         one on Method::ParameterTypes, useful later when we do semantic
15657         analysis. 
15658
15659         (TypeContainer::EmitMethod):  New method.  Emits methods.
15660
15661         * expression.cs: Removed MethodGroup class from here.
15662
15663         * parameter.cs (Parameters::GetCallingConvention): new method.
15664
15665 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
15666
15667         * class.cs (TypeContainer::Populate): Drop RootContext from the
15668         argument. 
15669
15670         (Constructor::CallingConvention): Returns the calling convention.
15671         (Constructor::ParameterTypes): Returns the constructor parameter
15672         types. 
15673
15674         (TypeContainer::AddConstructor): Keep track of default constructor
15675         and the default static constructor.
15676
15677         (Constructor::) Another class that starts using `public readonly'
15678         instead of properties. 
15679
15680         (Constructor::IsDefault): Whether this is a default constructor. 
15681
15682         (Field::) use readonly public fields instead of properties also.
15683
15684         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
15685         track of static constructors;  If none is used, turn on
15686         BeforeFieldInit in the TypeAttributes. 
15687
15688         * cs-parser.jay (opt_argument_list): now the return can be null
15689         for the cases where there are no arguments. 
15690
15691         (constructor_declarator): If there is no implicit `base' or
15692         `this', then invoke the default parent constructor. 
15693
15694         * modifiers.cs (MethodAttr): New static function maps a set of
15695         modifiers flags into a MethodAttributes enum
15696         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
15697         MethodAttr, TypeAttr to represent the various mappings where the
15698         modifiers are used.
15699         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
15700
15701 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * parameter.cs (GetParameterInfo): Fix bug where there would be no
15704         method arguments.
15705
15706         * interface.cs (PopulateIndexer): Implemented the code generator
15707         for interface indexers.
15708
15709 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
15710
15711         * interface.cs (InterfaceMemberBase): Now we track the new status
15712         here.  
15713
15714         (PopulateProperty): Implement property population.  Woohoo!  Got
15715         Methods and Properties going today. 
15716
15717         Removed all the properties for interfaces, and replaced them with
15718         `public readonly' fields. 
15719
15720 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
15721
15722         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
15723         initialize their hashtables/arraylists only when they are needed
15724         instead of doing this always.
15725
15726         * parameter.cs: Handle refs and out parameters.
15727
15728         * cs-parser.jay: Use an ArrayList to construct the arguments
15729         instead of the ParameterCollection, and then cast that to a
15730         Parameter[] array.
15731
15732         * parameter.cs: Drop the use of ParameterCollection and use
15733         instead arrays of Parameters.
15734
15735         (GetParameterInfo): Use the Type, not the Name when resolving
15736         types. 
15737
15738 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
15739
15740         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
15741         and instead use public readonly fields.
15742
15743         * class.cs: Put back walking code for type containers.
15744
15745 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
15746
15747         * class.cs (MakeConstant): Code to define constants.
15748
15749         * rootcontext.cs (LookupType): New function.  Used to locate types 
15750
15751
15752 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
15753
15754         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
15755         this System.Reflection code is.  Kudos to Microsoft
15756
15757         * typemanager.cs: Implement a type cache and avoid loading all
15758         types at boot time.  Wrap in LookupType the internals.  This made
15759         the compiler so much faster.  Wow.  I rule!
15760
15761         * driver.cs: Make sure we always load mscorlib first (for
15762         debugging purposes, nothing really important).
15763
15764         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
15765         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
15766
15767         * rootcontext.cs: Lookup types on their namespace;  Lookup types
15768         on namespaces that have been imported using the `using' keyword.
15769
15770         * class.cs (TypeContainer::TypeAttr): Virtualize.
15771         (Class::TypeAttr): Return attributes suitable for this bad boy.
15772         (Struct::TypeAttr): ditto.
15773         Handle nested classes.
15774         (TypeContainer::) Remove all the type visiting code, it is now
15775         replaced with the rootcontext.cs code
15776
15777         * rootcontext.cs (GetClassBases): Added support for structs. 
15778
15779 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
15780
15781         * interface.cs, statement.cs, class.cs, parameter.cs,
15782         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
15783         Drop use of TypeRefs, and use strings instead.
15784
15785 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
15786
15787         * rootcontext.cs: 
15788
15789         * class.cs (Struct::Struct): set the SEALED flags after
15790         checking the modifiers.
15791         (TypeContainer::TypeAttr): new property, returns the
15792         TypeAttributes for a class.  
15793
15794         * cs-parser.jay (type_list): Oops, list production was creating a
15795         new list of base types.
15796
15797         * rootcontext.cs (StdLib): New property.
15798         (GetInterfaceTypeByName): returns an interface by type name, and
15799         encapsulates error handling here.
15800         (GetInterfaces): simplified.
15801         (ResolveTree): Encapsulated all the tree resolution here.
15802         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
15803         types. 
15804
15805         * driver.cs: Add support for --nostdlib, to avoid loading the
15806         default assemblies.
15807         (Main): Do not put tree resolution here. 
15808
15809         * rootcontext.cs: Beginning of the class resolution.
15810
15811 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * rootcontext.cs: Provide better error reporting. 
15814
15815         * cs-parser.jay (interface_base): set our $$ to be interfaces.
15816
15817         * rootcontext.cs (CreateInterface): Handle the case where there
15818         are no parent interfaces.
15819
15820         (CloseTypes): Routine to flush types at the end.
15821         (CreateInterface): Track types.
15822         (GetInterfaces): Returns an array of Types from the list of
15823         defined interfaces.
15824
15825         * typemanager.c (AddUserType): Mechanism to track user types (puts
15826         the type on the global type hash, and allows us to close it at the
15827         end). 
15828
15829 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
15830
15831         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
15832         RecordInterface instead.
15833
15834         * cs-parser.jay: Updated to reflect changes above.
15835
15836         * decl.cs (Definition): Keep track of the TypeBuilder type that
15837         represents this type here.  Not sure we will use it in the long
15838         run, but wont hurt for now.
15839
15840         * driver.cs: Smaller changes to accomodate the new code.
15841
15842         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
15843         when done. 
15844
15845         * rootcontext.cs (CreateInterface):  New method, used to create
15846         the System.TypeBuilder type for interfaces.
15847         (ResolveInterfaces): new entry point to resolve the interface
15848         hierarchy. 
15849         (CodeGen): Property, used to keep track of the code generator.
15850
15851 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
15852
15853         * cs-parser.jay: Add a second production for delegate_declaration
15854         with `VOID'.
15855
15856         (enum_body): Put an opt_comma here instead of putting it on
15857         enum_body or enum_member_declarations so we can handle trailing
15858         commas on enumeration members.  Gets rid of a shift/reduce.
15859
15860         (type_list): Need a COMMA in the middle.
15861
15862         (indexer_declaration): Tell tokenizer to recognize get/set
15863
15864         * Remove old targets.
15865
15866         * Re-add the parser target.
15867
15868 2001-07-13  Simon Cozens <simon@simon-cozens.org>
15869
15870         * cs-parser.jay: Add precendence rules for a number of operators
15871         ot reduce the number of shift/reduce conflicts in the grammar.
15872
15873 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
15874
15875         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
15876         and put it here.
15877
15878         Get rid of old crufty code.
15879
15880         * rootcontext.cs: Use this to keep track of the parsed
15881         representation and the defined types available to the program. 
15882
15883         * gen-treedump.cs: adjust for new convention.
15884
15885         * type.cs: Split out the type manager, and the assembly builder
15886         from here. 
15887
15888         * typemanager.cs: the type manager will live here now.
15889
15890         * cil-codegen.cs: And the code generator here. 
15891
15892 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
15893
15894         * makefile: Fixed up for easy making.
15895
15896 2001-07-13  Simon Cozens <simon@simon-cozens.org>
15897
15898         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
15899         the 
15900
15901         (unary_expression): Expand pre_increment_expression and
15902         post_decrement_expression to reduce a shift/reduce.
15903
15904 2001-07-11  Simon Cozens
15905
15906         * cs-tokenizer.cs: Hex numbers should begin with a 0.
15907
15908         Improve allow_keyword_as_indent name.
15909
15910 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
15911
15912         * Adjustments for Beta2. 
15913
15914 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
15915
15916         * decl.cs: Added `Define' abstract method.
15917         (InTransit): new property, used to catch recursive definitions. 
15918
15919         * interface.cs: Implement `Define'. 
15920
15921         * modifiers.cs: Map Modifiers.constants to
15922         System.Reflection.TypeAttribute flags.
15923
15924         * class.cs: Keep track of types and user-defined types.
15925         (BuilderInit): New method for creating an assembly
15926         (ResolveType): New function to launch the resolution process, only
15927         used by interfaces for now.
15928
15929         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
15930         that are inserted into the name space. 
15931
15932 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * ARGH.  I have screwed up my tree so many times due to the use of
15935         rsync rather than using CVS.  Going to fix this at once. 
15936
15937         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
15938         load types.
15939
15940 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * Experiment successful: Use System.Type rather that our own
15943         version of Type.  
15944
15945 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
15946
15947         * cs-parser.jay: Removed nsAliases from here.
15948
15949         Use new namespaces, handle `using XXX;' 
15950
15951         * namespace.cs: Reimplemented namespace handling, use a recursive
15952         definition of the class.  Now we can keep track of using clauses
15953         and catch invalid using clauses.
15954
15955 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
15956
15957         * gen-treedump.cs: Adapted for all the renaming.
15958
15959         * expression.cs (Expression): this class now has a Type property
15960         which returns an expression Type.
15961
15962         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
15963         `Type', as this has a different meaning now in the base
15964
15965 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
15966
15967         * interface.cs, class.cs: Removed from all the sources the
15968         references to signature computation, as we can not do method
15969         signature computation during the parsing time, as we are not
15970         trying to solve at that point distinguishing:
15971
15972         class X {
15973                 void a (Blah x) {}
15974                 void a (NS.Blah x) {}
15975         }
15976
15977         Which depending on the context might be valid or not, as we do not
15978         know if Blah is the same thing as NS.Blah at that point.
15979
15980         * Redid everything so the code uses TypeRefs now instead of
15981         Types.  TypeRefs are just temporary type placeholders, that need
15982         to be resolved.  They initially have a pointer to a string and the
15983         current scope in which they are used.  This is used later by the
15984         compiler to resolve the reference to an actual Type. 
15985
15986         * DeclSpace is no longer a CIR.Type, and neither are
15987         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
15988         are all DeclSpaces, but no Types. 
15989
15990         * type.cs (TypeRefManager): This implements the TypeRef manager,
15991         which keeps track of all the types that need to be resolved after
15992         the parsing has finished. 
15993
15994 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
15995
15996         * ARGH.  We are going to have to store `foreach' as a class rather
15997         than resolving it, as we need to verify error 1579 after name
15998         resolution.   *OR* we could keep a flag that says `This request to
15999         IEnumerator comes from a foreach statement' which we can then use
16000         to generate the error.
16001
16002 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * class.cs (TypeContainer.AddMethod): we now add methods to the
16005         MethodGroup instead of the method hashtable.  
16006
16007         * expression.cs: Add MethodGroup abstraction, which gets us one
16008         step closer to the specification in the way we handle method
16009         declarations.  
16010
16011         * cs-parser.jay (primary_expression): qualified_identifier now
16012         tried to match up an identifier to a local variable reference or
16013         to a parameter reference.
16014
16015         current_local_parameters is now a parser global variable that
16016         points to the current parameters for the block, used during name
16017         lookup.
16018
16019         (property_declaration): Now creates an implicit `value' argument to
16020         the set accessor.
16021
16022 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
16023
16024         * parameter.cs: Do not use `param' arguments as part of the
16025         signature, per the spec.
16026
16027 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * decl.cs: Base class for classes, structs and interfaces.  This
16030         is the "Declaration Space" 
16031
16032         * cs-parser.jay: Use CheckDef for checking declaration errors
16033         instead of having one on each function.
16034
16035         * class.cs: Factor out some code for handling error handling in
16036         accordance to the "Declarations" section in the "Basic Concepts"
16037         chapter in the ECMA C# spec.
16038
16039         * interface.cs: Make all interface member classes derive from
16040         InterfaceMemberBase.
16041
16042 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
16043
16044         * Many things: all interfaces are parsed and generated in
16045         gen-treedump.  Support for member variables, constructors,
16046         destructors, properties, constants is there.
16047
16048         Beginning of the IL backend, but very little done, just there for
16049         testing purposes. 
16050
16051 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * cs-parser.jay: Fix labeled statement.
16054
16055         * cs-tokenizer.cs (escape): Escape " and ' always.
16056         ref_line, ref_name: keep track of the line/filename as instructed
16057         by #line by the compiler.
16058         Parse #line.
16059
16060 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
16063         to match the values in System.CodeDOM.
16064
16065         Divid renamed to Divide.
16066
16067         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
16068         statements. 
16069         (Statements.set): remove.
16070
16071         * System.CodeDOM/CodeCatchClause.cs: always have a valid
16072         statements. 
16073
16074         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
16075         falseStatements always have valid values. 
16076
16077         * cs-parser.jay: Use System.CodeDOM now.
16078