5e9de1c7690cb9aa923702ba032cc68cb1d35650
[mono.git] / mcs / mcs / ChangeLog
1 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5
6 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7
8         Fix #74528.
9         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10         IdenticalNameAndTypeName here.
11         (EventExpr.InstanceResolve): Likewise.
12
13 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
14
15         C# 2.0 DefaultCharSetAttribute implementation
16         
17         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
18         which allows us to set GlobalNamespace for every resolve.
19         (Attribute.ResolveArguments): Cut from Resolve.
20         (Attribute.GetCharSetValue): Returns CharSet named argument.
21         (Attribute.DefinePInvokeMethod): Gets default charset from
22         module settings.
23         (GlobalAttribute.ResolveAsTypeStep): Override.
24         (GlobalAttribute.ResolveArguments): Override.
25         
26         * class.cs (TypeAttr): Is protected.
27         
28         * codegen.cs (ModuleClass.DefaultCharSet): New member.
29         (ModuleClass.DefaultCharSetType): New memeber.
30         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
31         
32         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
33         charset from module.
34         
35         * delegate.cs (TypeAttr): Override.
36         (Delegate.DefineType): Use this TypeAttr.
37         
38         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
39         at very early stage (before types are defined) to resolve model
40         module attributes. It will probably not work with corlib but it
41         should be ok.
42         
43         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
44         charset from module.
45         
46         * typemanager.cs (default_charset_type): New type.
47
48 2005-04-13  Raja R Harinath  <rharinath@novell.com>
49
50         * decl.cs (MemberCache.AddMethods): Don't warn if
51         System.Object.Finalize has buggy MethodAttributes.
52
53         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
54         removed below.
55
56 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
57
58         * doc.cs : detect ambiguous reference to overloaded members.
59           Fixed bug #71603. MS 1.1 csc does not detect it.
60
61 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
62
63         * doc.cs : delegates must not be referenced with parameters.
64           Fixed bug #71605.
65
66 2005-04-12  Miguel de Icaza  <miguel@novell.com>
67
68         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
69
70 2005-04-10  Miguel de Icaza  <miguel@novell.com>
71
72         * driver.cs (MainDriver): Stop processing if the CLS stage found
73         errors. 
74
75         (CompilerCallableEntryPoint.InvokeCompiler): Always
76         reset after execution;   Take a TextWriter argument for the
77         output.
78
79         * report.cs: Use the error stream instead of hardcoding stderr. 
80
81 2005-04-09  Miguel de Icaza  <miguel@novell.com>
82
83         * class.cs: Reduce code paths to test, too small of an
84         optimization to make it worth the extra testing.  Always perform
85         it. 
86
87 2005-04-08  Raja R Harinath  <rharinath@novell.com>
88
89         Fix #74510.
90         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
91         operators that had errors reported on them.
92
93 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
94
95         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
96         argument types.
97         (Attribute.Resolve): Add named argument type checking.
98         
99         * class.cs (FixedField.Define): Use IsPrimitiveType
100         
101         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
102         
103         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
104         unsafe parameter types.
105         
106         * statement.cs (Using.ResolveExpression): Add better error description.
107         
108         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
109         
110 2005-04-08  Raja R Harinath  <rharinath@novell.com>
111
112         Fix #74484.
113         * attribute.cs (Attribute.GetAttributeUsage): Resolve
114         AttributeUsageAttribute in the emitcontext of the attribute class,
115         not in the emitcontext of the attributable entity it was attached to.
116         * cs-parser.jay: Use 'current_class', not 'current_container',
117         when creating a GlobalAttribute.
118
119 2005-04-08  Alp Toker  <alp@atoker.com>
120
121         * pending.cs: The fix to #58413 failed to compile methods implementing
122         interfaces with/without params modifiers and vice versa, even though
123         params modifiers aren't part of the signature. Make the modifier check
124         less strict as in csc.
125
126 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
127             Anoob V E  <projectmonokochi@rediffmail.com>
128             Harilal P R  <projectmonokochi@rediffmail.com>
129
130         Fix #58413.
131         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
132         modifiers of pending methods.
133         (PendingImplementation.PendingImplementation): Initialize it.
134         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
135         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
136         with ParameterData.  Add check for modifiers.
137         * class.cs (MethodData.Define): Update to changes.
138
139 2005-04-07  Raja R Harinath  <rharinath@novell.com>
140
141         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
142
143 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
144
145         * class.cs (PropertyMethod.Define): Check private accessor in abstract
146         property.
147         
148         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
149         
150         * rootcontext.cs,
151         * typemanager.cs: Registered RequiredAttributeAttribute.
152         
153 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
154
155         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
156         Warning CS0169 is back at level 3.
157         (IMethodData.SetMemberIsUsed): New method.
158         
159         * decl.cs (IsUsed): New value; moved from FieldBase.Status
160         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
161         
162         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
163
164         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
165         contants.
166         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
167         is used.
168         
169         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
170         is used.
171         
172         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
173         to avoid the problems with nested types.
174
175 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
176             Anoob V.E  <projectmonokochi@rediffmail.com>
177             Harilal P.R  <projectmonokochi@rediffmail.com>
178             Raja R Harinath  <rharinath@novell.com>
179
180         Fix #73820.
181         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
182         attribute.
183         * typemanager (GetConstructor): Make public.
184
185 2005-04-05  John Luke  <john.luke@gmail.com>
186             Raja R Harinath  <rharinath@novell.com>
187
188         Fix #62232.
189         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
190         struct too.  Return false quicker in a few cases.
191         (VerifyUnManaged): Use it.
192
193 2005-04-05  Raja R Harinath  <rharinath@novell.com>
194
195         Fix #74041.
196         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
197         not 'unreachable_seen'.
198
199 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
200
201         * attribute.cs (Attribute.GetValue): Removed unused.
202         
203         * codegen.cs (CodeGen.TrimExt): Removed unused.
204         
205         * cs-parser.jay (output): Removed unused.
206         
207         * cs-tokenizer.cs (hex_digits): Removed unused.
208         
209         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
210         
211         * expression.cs (Indirection.LoadExprValue): Removed unused.
212         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
213         
214         * iterators.cs (Iterator.param_types): Removed unused.
215         
216         * statement.cs (Goto.block): Removed unused.
217         (ToplevelBlock.did): Removed unused.
218         (Switch.ResolveConstantSwitch): Removed unused.
219
220 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
221
222         * rootcontext.cs: Allow mcs to bootstrap with the compilation
223         resetting thingy.
224
225 2005-04-01  Raja R Harinath  <rharinath@novell.com>
226
227         Fix #74232 and cs0208-3.cs.
228         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
229         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
230         unmanaged type.  Don't use FieldBuilders when 't' is a
231         TypeBuilder.  Use ModFlags and MemberType fields.
232         * class.cs (MemberBase.member_type): Rename from MemberType.
233         (MemberBase.MemberType): New property.  Determines member_type on
234         demand.
235         (MemberBase.DoDefine): Don't initialize MemberType here.
236         (FieldMember.Define): Likewise.
237
238 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
239
240         Fix #74241
241         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
242         Attributes are emitted there.
243         
244 2005-04-01  Raja R Harinath  <rharinath@novell.com>
245
246         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
247         keyword in 'partial enum' too.
248         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
249         is not allowed).
250         Report from Kamil Skalski <nazgul@omega.pl>.
251
252         Fix #74309.
253         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
254         have partial containers too.
255
256         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
257         in block' checks to Block.CheckInvariantMeaningInBlock.
258         * statement.cs (Block.GetKnownVariableInfo): Make private.
259         (Block.IsVariableUsedInChildBlock): Remove.
260         (Block.IsVariableUsedInBlock): Likewise.
261         (Block.CheckInvariantMeaningInBlock): New.  Show location of
262         conflicting declaration.
263         (Block.AddVariable): Make error messages less long-winded and more
264         specific.  Show location of conflicting declaration.
265         * parameter.cs (Parameters.Location): New readonly property.
266
267 2005-03-31  Raja R Harinath  <rharinath@novell.com>
268
269         Clean up semantics of invoking ResolveMemberAccess.
270         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
271         can have an instance, ensure that we pass in a non-TypeExpression
272         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
273         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
274         argument.  Update to changes and simplify.
275         (FieldExpr.Emitinstance): Remove CS0120 check.
276         (PropertyExpr.EmitInstance): Likewise.
277         * expression.cs (Argument.Resolve): Likewise.
278         (Invocation.DoResolve): Update to changes in semantics of
279         InstanceExpression.
280
281 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
282
283         Fix #74241
284         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
285         customization.
286         
287         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
288
289 2005-03-31  Raja R Harinath  <rharinath@novell.com>
290
291         Fix difference in behaviour with commandline invocation.
292         * driver.cs (Driver.Reset): New.
293         (CompilerCallableEntryPoint): Call it.
294
295         * statement.cs (If.Resolve): Avoid spurious "uninitialized
296         variable" warnings if the boolean expression failed to resolve.
297
298 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
299
300         * attribute.cs: Fix the union of several permissions when some of them
301         are unrestricted (so the result isn't an unrestricted permission set).
302         Fix #74036.
303
304 2005-03-30  Raja R Harinath  <rharinath@novell.com>
305
306         * ecore.cs (MemberExpr): New class.  Convert from interface
307         IMemberExpr.
308         (MemberExpr.ResolveMemberAccess): Refactor and move here from
309         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
310         error checks.
311         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
312         (MethodGroupExpr.IsExplicitImpl): Remove.
313         (Expression.GetFieldFromEvent): Remove.
314         (SimpleName.MemberStaticCheck): Remove.
315         (SimpleName.DoSimpleNameResolve): Update to changes.
316         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
317         (MemberAccess.IdenticalNameAndTypeName): Remove.
318         (MemberAccess.error176): Move to MemberExpr.
319         (MemberAccess.DoResolve): Update to changes.
320         (BaseAccess.DoResolve): Likewise.
321
322 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
323
324         C# 2.0 Conditional attribute class implementation
325         
326         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
327         Analyzes class whether it has attribute which has ConditionalAttribute
328         and its condition is not defined.
329         
330         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
331         (Class.IsExcluded): New method. Search for at least one defined
332         condition in ConditionalAttribute of attribute class.
333
334 2005-03-30  Raja R Harinath  <rharinath@novell.com>
335
336         * ecore.cs (PropertyExpr): Derive from Expression, not
337         ExpressionStatement.
338         (PropertyExpr.EmitStatement): Remove.
339
340 2005-03-29  Raja R Harinath  <rharinath@novell.com>
341
342         Fix #74060.
343         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
344         internal field "value__" of an enum be private.  The examples for
345         "value__" that I found on MSDN all used FieldAttributes.Private.
346
347         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
348         Don't mention IL method attribute names.
349
350         Fix #47991.  Remove a TODO.
351         * statement.cs (Block.Toplevel): Make into a field.
352         (Block.Parameters): Move into ToplevelBlock.
353         (Block.known_variables): Rename from child_variable_names.
354         (Block.Block): Remove variants that take Parameters.  Initialize
355         'Toplevel' with the immediately surrounding toplevel block.
356         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
357         LocalInfo parameter.
358         (Block.GetKnownVariableInfo): New.
359         (Block.IsVariableNameUsedInChildBlock): Update.
360         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
361         the block, even though it may not be in scope.
362         (Block.AddVariable): Remove Parameters parameter.  Use
363         Toplevel.Parameters instead.
364         (Block.AddConstant): Remove Parameters parameter.
365         (Block.GetParameterReference): Update to use Toplevel.Parameters.
366         (Block.IsParamaterReference): Likewise.
367         (Block.IsLocalParameter): Likewise.  Simplify a lot.
368         (ToplevelBlock.Parameters): New.  Moved from Block.
369         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
370         initialize Parameters to a non-null value.
371         * cs-parser.jay: Update to changes.
372         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
373         simple names that mean different things in the same block.  Use
374         Block.IsVariableNameUsedInBlock.
375
376 2005-03-28  Raja R Harinath  <rharinath@novell.com>
377
378         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
379         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
380         GetTypeHandle.  It is possible for a reflected type to derive from
381         a TypeBuilder (e.g., int[] derives from the TypeBuilder
382         System.Array during mscorlib compilation).
383         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
384         contain a method_hash, don't create one either.  Don't create a
385         deep copy of the base cache's method_hash.
386         (MemberCache.SetupCache): Rename back from DeepCopy.
387         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
388         already initialized.  If we see an override function, add its
389         underlying base virtual function to the member_hash too.
390
391         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
392
393 2005-03-26  Raja R Harinath  <harinath@acm.org>
394
395         Fix #73038.
396         * assign.cs (Assign.DoResolve): When the RHS of an assignment
397         fails to resolve, ensure that the LHS is still resolved as an
398         lvalue.
399
400 2005-03-25  Raja R Harinath  <harinath@acm.org>
401
402         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
403         ec.ContainerType.
404         (Enum.current_ec): Remove.
405         (Enum.LookupEnumValue): Remove EmitContext argument.
406         Just uses the one created during DefineType.
407         (Enum.FindMembers): Update.
408         * expression.cs (MemberAccess.DoResolve): Update.
409
410 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
411
412         * assign.cs (Assign.DoResolve): Check for CS1717 when
413         source and target are same (uses Equals).
414
415         * expression.cs (LocalVariableReference, ParameterReference,
416         This): Implemented Equals, GetHashCode.
417
418         * statement.cs (Block.GetParameterReference): Removed useless
419         local variable.
420
421 2005-03-22  Raja R Harinath  <rharinath@novell.com>
422
423         Fix cs0128.cs
424         * statement.cs (Block.AddVariable): Ensure that we skip implicit
425         blocks before deciding whether the error is cs0136 or cs0128.
426
427         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
428         (using_alias_directive, using_namespace_directive): Pass
429         MemberName, not an expression to Namespace.UsingAlias and
430         Namespace.Using.
431         (MakeName): Use the MemberName of the namespace.
432         * namespace.cs (Namespace.MemberName): New.
433         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
434         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
435         Likewise.
436         * decl.cs (MemberName.Name): Make readonly.
437         (MemberName.FromDotted): New "constructor".
438         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
439         (MemberCore.Name): Compute from MemberName on demand.
440         (MemberCore.SetMemberName): Provide a way to change the
441         MemberName.
442         (MemberCore.AddToContainer): Don't take a fullname parameter.
443         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
444         fully qualified name of the container to the member name.
445         (TypeContainer.AddToTypeContainer): Use a fully qualified name
446         only if the type is a member of the root container.
447         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
448         MemberName.Left rather than searching for an embedded ".".
449         (PartialContainer.CreatePart): Update to changes in RootContext.
450         (MemberBase.ShortName): Turn into a property.  Use
451         MemberCore.SetMemberName.
452         (MemberBase.ExplicitInterfaceName): Remove.
453         (MemberBase.UpdateMemberName): Remove.
454         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
455         (PropertyBase.SetMemberName): New override.
456         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
457         (Tree.GetDecl): New.
458         (Tree.AllDecls): Rename from Decls.
459         * attribute.cs, enum.cs, report.cs: Update to changes.
460         * driver.cs (MainDriver): Use MemberName.FromDotted on
461         RootContext.MainClass.
462
463 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
464
465         * class.cs (FixedField.Define): Check for CS1664 and more sanity
466         checks.
467
468         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
469
470 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
471
472         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
473         property accessor modifiers.
474
475         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
476         fixed buffer attribute (CS1716).
477         (PropertyMethod.HasCustomAccessModifier): When property accessor
478         has custom modifier.
479
480         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
481         modifiers.
482         (PropertyExpr.DoResolveLValue): Add CS0272.
483
484 2005-03-17  Miguel de Icaza  <miguel@novell.com>
485
486         * convert.cs: When converting to a pointer, use the proper Conv.U
487         or Conv.I depending on the source data type.
488
489         * cs-tokenizer.cs: Make the size for large decimal constants,
490         fixes #72957.
491
492 2005-03-17  Martin Baulig  <martin@ximian.com>
493
494         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
495         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
496
497 2005-03-17  Martin Baulig  <martin@ximian.com>
498
499         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
500         to bool so we can return an error condition.
501         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
502         returned an error.
503
504 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
505
506         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
507         attributes.
508
509 2005-03-16  Raja R Harinath  <rharinath@novell.com>
510
511         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
512         Refactor to avoid traversing the list of assemblies, and to avoid
513         string concatenation.
514         * typemanager.cs (guid_attr_type): Remove.
515         (negative_hits, pointers, references): Remove hashes.
516         (type_hash): New.
517         (GetConstructedType): New.  Uses type_hash to handle constructed
518         types (arrays, references, pointers).
519         (GetReferenceType, GetPointerType): Use it.
520         (GetNestedType): New.  Uses type_hash to handle nested types of
521         reflected types.
522         (LookupType, LookupTypeDirect): Remove.
523         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
524         'types' hash and LookupTypeReflection directly.
525         (params_string, params_object): Use GetConstructedType.
526         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
527         top-level types.
528         (Namespace.Lookup): Use cached_types.
529         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
530         provided by old TypeManager.LookupType.
531         * rootcontext.cs (MakeFQN): Remove.
532         * decl.cs (DeclSpace.MakeFQN): Likewise.
533         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
534         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
535         TypeManager.GetConstructedType.
536         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
537
538 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
539
540         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
541         indexers.
542
543         * cs-parser.jay: Reports CS1527 for any namespace element.
544
545         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
546         Added CS0407.
547
548         * expression.cs (ParameterReference.IsAssigned): Changed error to
549         CS0269.
550         (Error_WrongNumArguments): Moved CS0245 detection here.
551
552         * statement.cs (Return.Resolve): Add CS1622 report.
553
554 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
555
556         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
557
558 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
559
560         * attribute.cs expression.cs: Get rid of some allocations.
561
562 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
563
564         * doc.cs : just eliminate the latest change.
565
566 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
567
568         * doc.cs : commented out the latest change. It breaks xml-030.cs
569
570 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
571
572         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
573           fail. So invoke CreateType() in FindDocumentedType().
574
575 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
576
577         * cs-tokenizer.cs : added IsKeyword().
578         * doc.cs : Detect keyword incorrectly used as identifier.
579           Allow identifiers prefixed by @.
580
581 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
582
583         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
584         It caused exception in namespace resolving (again!).
585         
586         * class.cs (Class.ctor): Removed exit.
587         (PropertyMethod.ctor): ditto.
588         
589         * codegen.cs (Codegen.Reset): Reset static data.
590         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
591         
592         * cs-tokenizer.cs (Cleanup): Removed.
593         
594         * driver.cs (GetSystemDir): Rewrote to one line command.
595         It caused problem with unloaded dynamic modules.
596         (UnixParseOption): Removed Exit.
597         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
598         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
599         Now can be mcs used as library.
600         
601         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
602         empty location.
603         
604         * location.cs (Reset): Reset static data.
605         
606         * namespace.cs (Reset): Reset static data.
607         
608         * report.cs (Report.Reset): Reset static data.
609         
610         * rootcontext.cs (RootContext.Reset): Reset static data.
611         
612         * tree.cs (RootTypes.ctor): Use Location.Null
613         
614         * typemanager.cs (TypeManager.Reset): Reset static data.
615         (CoreLookupType): Removed Exit.
616         (TypeHandle.Reset): Reset static data.
617         
618 2005-03-10  Raja R Harinath  <rharinath@novell.com>
619
620         Fix #73516.
621         * typemanager.cs (ComputeNamespaces): Import namespaces from
622         referenced modules too.
623
624 2005-03-09  Raja R Harinath  <rharinath@novell.com>
625
626         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
627         than '.'.
628
629 2005-03-09  Raja R Harinath  <rharinath@novell.com>
630
631         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
632         enclosing DeclSpace.  This ensures that a name-lookup populates
633         more caches and there are fewer 'TypeExpression's.  Carve out
634         nested type lookup into ...
635         (LookupNestedTypeInHierarchy): ... this.
636
637 2005-03-09  Raja R Harinath  <rharinath@novell.com>
638
639         Clean up a few partial-class semantics.  
640         Fixes test-357.cs and cs1618-2.cs.
641         * cs-parser.jay (struct_declaration): Use 'current_class' as
642         parent of newly-created struct.  Remove call to Register ().
643         Use 'pop_current_class' to complete handing the current struct.
644         (interface_declaration): Likewise.
645         (class_declaration): Likewise.
646         (enum_declaration): Use 'current_class' as parent of newly created
647         enum.
648         (delegate_declaration): Likewise.
649         (pop_current_class): New function.  This is used to handle closing
650         up the 'current_class' and 'current_container', and pointing them
651         to the enclosing class/container.
652         (CSharpParser): Initialize 'current_class' too.
653         * decl.cs (MemberCore): Add check for invariant: a partial
654         container is not a parsed entity, and thus does not enclose any
655         parsed members.
656         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
657         (DeclSpace.BaseTypeExpr): Use it.
658         (DeclSpace.LookupType): Add check for invariant.
659         * class.cs (TypeContainer): Add check for invariant: a nested
660         class should have the same NamespaceEntry as its enclosing class.
661         (TypeContainer.EmitFieldInitializers): Make virtual.
662         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
663         MemberCore.
664         (TypeContainer.Register): Remove.
665         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
666         null.  Use TypeResolveEmitContext for resolving base types and
667         interfaces.  Move initialization of Parts.TypeBuilder here from
668         ...
669         (TypeContainer.DefineNestedTypes): ... here.
670         (PartialContainer): Take a Namespace not a NamespaceEntry.
671         (PartialContainer.Create): Don't use Register.  Call the
672         appropriate Add... function directly.
673         (ClassPart): Take both the PartialContainer and the enclosing
674         class as constructor arguments.
675         (ClassPart.EmitFieldInitializers): Override.
676         (ClassPart.PartFindNestedTypes): Remove.
677         (FieldBase.GetInitializerExpression): Resolve the initializer
678         expression in the emit context of the enclosing class.
679         * tree.cs (RootTypes): Remove Register ().
680         
681 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
682
683         * cs-parser.jay: Removed CS0134.
684         
685         * driver.cs: Removed CS1901.
686         
687         * expression.cs (SizeOf.DoResolve): Don't report CS0233
688         for predefined types.
689
690 2005-03-07  Duncan Mak  <duncan@novell.com>
691
692         * codegen.cs (Save):  Catch UnauthorizedAccessException as
693         well. Fixes bug #73454.
694
695 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
696
697         * cs-tokenizer.cs (xtoken): Add CS1035.
698         
699         * class.cs (MethodData.Define): Add CS0683.
700         (FieldMember.ctor): Add CS0681.
701
702 2005-03-07  Raja R Harinath  <rharinath@novell.com>
703
704         * ecore.cs (SimpleName.DoResolve): Rename from
705         SimpleName.DoResolveAllowStatic.
706         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
707         Pass 'intermediate' flag to MemberStaticCheck.
708         (SimpleName.MemberStaticCheck): Skip "static check" only in case
709         of "intermediate" lookups via MemberAccess.
710         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
711         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
712
713 2005-03-07  Raja R Harinath  <rharinath@novell.com>
714
715         Fix #73394.
716         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
717         slipped in because of variable names that are identical to a
718         builtin type's BCL equivalent ('string String;', 'int Int32;').
719         (PropertyExpr.EmitInstance): Likewise.
720
721 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
722
723         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
724         
725         * report.cs (warning_ignore_table): Made public.
726
727 2005-03-04  Raja R Harinath  <rharinath@novell.com>
728
729         Fix #73282.
730         * class.cs (MethodData.Emit): Pass 'container' to
731         container.GetObsoleteAttribute instead of 'container.Parent'.
732
733 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
734
735         * cs-parser.jay: Add 1534 error test.
736
737         * iterators.cs (Yield.CheckContext): Add error 1629.
738         (Iterator.ctor): Save unsafe modifier.
739         (MoveNextMethod.DoEmit): Restore unsafe context.
740
741         * namespace.cs (UsingAlias): Better error message.
742
743 2005-03-03  Dan Winship  <danw@novell.com>
744
745         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
746         the warning message [#73219]
747
748 2005-03-03  Raja R Harinath  <rharinath@novell.com>
749
750         Fix compile with MCS 1.0.0.0.
751         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
752         w_restore to not depend on string constant folding.
753
754 2005-03-03  Raja R Harinath  <rharinath@novell.com>
755
756         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
757         CS0246 check to users who passed 'silent = false'.
758         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
759         check.
760         (SimpleName.SimpleNameResolve): Update.
761         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
762         (MemberAccess.IdenticalNameAndTypeName): Update.
763         * doc.cs (FindDocumentedTypeNonArray): Update.
764
765 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
766
767         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
768         * parameters.cs (ComputeAndDefineParameters): Remove.
769         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
770         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
771         Use GetParameterInfo.
772
773 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
774
775         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
776
777 2005-03-02  Raja R Harinath  <rharinath@novell.com>
778
779         Unify DeclSpace.LookupType and DeclSpace.FindType.
780         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
781         is in charge of defining nested types on demand.
782         (DeclSpace.LookupType): Use it when the current_type is a
783         TypeBuilder.  Use LookupTypeDirect for reflected types.
784         (DeclSpace.FindType): Remove.
785         (DeclSpace.LookupInterfaceOrClass): Likewise.
786         (DeclSpace.DefineTypeAndParents): Likewise.
787         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
788         DeclSpace.LookupType.
789         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
790         * typemanager.cs (LookupType): Simplify.
791         (AddUserType): Remove type from negative_hits.
792         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
793         * class.cs (TypeContainer.FindMembers): Move handling of nested
794         types ...
795         (TypeContainer.FindMembers_NestedTypes): ... here.
796         (TypeContainer.FindNestedType): Implement override.
797         (ClassPart.FindNestedType): Delegate to PartialContainer.
798         (ClassPart.PartFindNestedType): Looks up the nested types of the
799         part alone.
800
801 2005-03-02  Martin Baulig  <martin@ximian.com>
802
803         * class.cs (TypeContainer.DoDefineMembers): We also need a default
804         static constructor in static classes.
805
806 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
807
808         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
809         sizeParamIndex is not specified.
810
811 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
812
813         Fix #73117
814         * report.cs (WarningMessage.IsEnabled): Missing null check.
815
816 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
817
818         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
819         in the fields and not in the properties.
820
821 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
822
823         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
824         fields as well.
825
826 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
827
828         * attribute.cs: Small refactoring (improved robustness).
829         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
830         (ValidateGuid): Removed.
831         (Resolve): Removed referenced to above mentioned.
832         (GetAttributeUsage): Made private and changed to work without
833         class assistance.
834         (GetIndexerAttributeValue): Don't crash.
835         (GetConditionalAttributeValue): Ditto.
836         (GetClsCompliantAttributeValue): Ditto.
837         (ExtractSecurityPermissionSet): All attributes exceptions are
838         error 648.
839         (GetPropertyValue): New helper.
840         (GetMethodImplOptions): New method.
841         (DefinePInvokeMethod): Reuse common code. Implemented handling of
842         some missing properties.
843         
844         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
845         (Method.ApplyAttributeBuilder): Updated.
846         
847         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
848         exception.
849
850 2005-02-28  Raja R Harinath  <rharinath@novell.com>
851
852         Fix #73052.
853         * report.cs (Report.SymbolRelatedToPreviousError): Handle
854         non-simple types (array, pointer, reference).
855
856 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
857
858         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
859
860         * class.cs (MethodCore.IsDuplicateImplementation): Special error
861         for operators.
862         (Method.CheckBase): Catch wrong destructor here.
863         (MethodData.Define): Add errors 550, 668.
864
865         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
866
867         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
868
869         * pending.cs (VerifyPendingMethods): Add error 551.
870
871         * typemanager.cs (CSharpName): Next error report helper.
872
873 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
874
875         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
876         attributes. Removed useless attribute double check.
877         It saves almost 2MBs for corlib.
878
879 2005-02-25  Raja R Harinath  <rharinath@novell.com>
880
881         Fix #72924.
882         * statement.cs (ExpressionStatement.Resolve): Make robust to being
883         called twice in case of error.
884
885 2005-02-23  Chris Toshok  <toshok@ximian.com>
886
887         Fix compiler portions of #72827.
888         * statement.cs (Block.Emit): call Begin/EndScope on the
889         EmitContext instead of the ILGenerator.
890
891         * codegen.cs (EmitContext.BeginScope): new method, call
892         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
893         we have one.)
894         (EmitContext.BeginScope): same, but EndScope and CloseScope
895
896         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
897         offset and call the superclass's OpenScope(int) with it.
898         (SymbolWriter.CloseScope): get the current il
899         offset and call superclass's CloseScope(int) with it.
900
901 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
902
903         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
904         CS1677 for out and ref as well.
905
906         * class.cs (Method.Define): Add error CS1599 detection.
907         
908         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
909         
910         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
911         
912         * delegate.cs (Delegate.Define): Add error CS1599 detection.
913         
914         * support.cs.cs (ModifierDesc): New helper method.
915
916 2005-02-23  Raja R Harinath  <rharinath@novell.com>
917             Abin Thomas  <projectmonokochi@rediffmail.com>
918             Anoob V E  <projectmonokochi@rediffmail.com>
919             Harilal P R  <projectmonokochi@rediffmail.com>
920
921         Fix #57851, #72718.
922         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
923         MemberLookup (used for error reporting) actually returns a result.
924         Fix error report number (122, not 112).
925
926 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
927             Anoob V E  <projectmonokochi@rediffmail.com>
928             Harilal P R  <projectmonokochi@rediffmail.com>
929
930         Fix #71134.
931         * pending.cs (PendingImplementation.GetAbstractMethods):
932         Find NonPublic members too.
933
934 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
935
936         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
937         Fixed error 217.
938         
939         * class.cs (MethodCore.CheckMethodAgainstBase):
940         Add error 239 report.
941
942 2005-02-21  Raja R Harinath  <rharinath@novell.com>
943
944         Fix #68955.
945         * expression.cs (Invocation.IsApplicable): Make public.
946         (Invocation.IsParamsMethodApplicable): Likewise.
947         * delegate.cs (Delegate.VerifyApplicability): Don't use
948         Invocation.VerifyArgumentCompat for parameter applicability
949         testing.  Use Invocation.IsApplicable and
950         Invocation.IsParamsMethodApplicable.
951
952 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
953
954         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
955         
956         * class.cs (Operator.Define): Add error 217 report.
957         
958 2005-02-21  Raja R Harinath  <rharinath@novell.com>
959
960         * namespace.cs (UsingEntry.Resolve): Undo change below.
961
962 2005-02-21  Raja R Harinath  <rharinath@novell.com>
963
964         Fix #72756.
965         * ecore.cs (Expression.MemberLookupFailed): Add argument to
966         disable the error message when the extended MemberLookup also
967         fails.
968         (Expression.MemberLookupFinal): Update.
969         (SimpleName.DoSimpleNameResolve): Update.
970         * expression.cs (MemberAccess.ResolveNamespaceOrType):
971         Don't use MemberLookupFinal.
972         (New.DoResolve): Update.
973         (BaseAccess.CommonResolve): Update.
974
975 2005-02-21  Raja R Harinath  <rharinath@novell.com>
976
977         Fix #72732.
978         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
979         occured previously, don't resolve again.
980
981 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
982
983         Fix #69949
984         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
985         argument. Call ResolveAttributeUsage for unresolved.
986         when types doesn't match ctor arguments.
987         
988         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
989         for nested attribute classes.
990         (Class.attribute_usage): Removed.
991         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
992         for attribute class.
993         
994         * ecore.cs (IsAttribute): Removed.
995         
996         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
997         
998         * rootcontext.cs (RegisterAttribute): Removed, attributes are
999         now normal types.
1000         (attribute_types): Removed.
1001         (EmitCode): Global attributes are emited as the latest.
1002
1003 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
1004
1005         * class.cs (EmitFieldInitializers): Don't emit field initializer
1006         for default values when optimilization is on.
1007         
1008         * constant.cs (Constant.IsDefaultValue): New property.
1009         
1010         * driver.cs: Add /optimize handling.
1011         
1012         * constant.cs,
1013         * ecore.cs,
1014         * literal.cs: Implement new IsDefaultValue property.
1015         
1016         * rootcontext.cs (Optimize): New field, holds /optimize option.
1017
1018 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1019
1020         Fix crasher in re-opened #72347.
1021         * namespace.cs (Namespace.Lookup): Return null if
1022         DeclSpace.DefineType returns null.
1023
1024         Fix #72678.
1025         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
1026
1027 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1028
1029         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
1030         now returns null if it cannot resolve to an lvalue.
1031         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1032         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1033         returned null.  Remove check for SimpleName.
1034         (EventExpr.DoResolveLValue): New.
1035         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1036         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
1037         error from ...
1038         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
1039         avoid CS0131 error.
1040         (Unary.ResolveOperator): Move CS0211 check ...
1041         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
1042         CS0131 error.
1043         (Unary.DoResolveLValue): Simplify.
1044         (AddressOf.DoResolveLValue): New.
1045         (ArrayAccess.DoResolveLValue): New.
1046
1047 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
1048
1049         * attribute.cs (Attribute.Resolve): Add arguments casting for
1050         when types doesn't match ctor arguments.
1051
1052 2005-02-16  Raja R Harinath  <rharinath@novell.com>
1053
1054         Fix parts of #63202.
1055         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1056         lookup of operator in base type.  Ensure that all checks happen
1057         when the operator resolves to an "op_..." method.
1058
1059 2005-02-15  Raja R Harinath  <rharinath@novell.com>
1060
1061         Fix #71992.
1062         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1063         'ignore_cs0104' parameter.  Pass it to ...
1064         (NamespaceEntry.Lookup): ... this.
1065         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1066         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1067         (TypeLookupExpression.DoResolveAsTypeStep): Update.
1068         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1069         Update.  Request that cs0104 errors be ignored.
1070         (ComposedCast.ResolveAsTypeStep): Update.
1071
1072 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1073
1074         Fix #59209.
1075         * expression.cs (Invocation.BetterFunction): Remove support for
1076         comparing virtual functions and their overrides.
1077         (Invocation.IsOverride): New.
1078         (Invocation.OverloadResolve): Don't consider 'override' functions
1079         during candidate selection.  Store them in a lookaside list.
1080         If the selected method is a 'virtual' function, use the list to
1081         find any overrides that are closer to the LHS type.
1082
1083 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
1084
1085         * expression.cs (New.DoResolve): Add complex core type reduction.
1086         (New.Constantify): Converts complex core type syntax like 'new int ()'
1087         to simple constant.
1088         
1089 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1090
1091         * decl.cs (EntryType.EntryType): New constructor to create an
1092         updated copy of a cache entry.
1093         (MemberCache.AddMethods): Use it.
1094         (MemberCache.ClearDeclaredOnly): Remove.
1095         (MemberCache.MemberCache): Update.
1096
1097 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1098
1099         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1100         variable.  This one is represents the actual low-level declaration
1101         of the method, as opposed to the semantic level `IsStatic'.   
1102
1103         An anonymous method which is hosted into a static method might be
1104         actually an instance method.  IsStatic would reflect the
1105         container, while MethodIsStatic represents the actual code
1106         generated.
1107
1108         * expression.cs (ParameterReference): Use the new MethodIsStatic
1109         instead of IsStatic.
1110
1111         * anonymous.cs (AnonymousMethod.Compatible): Pass the
1112         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1113         set on the current EmitContext. 
1114
1115         * expression.cs (Cast): Overload DoResolveLValue so we can pass
1116         resolve our casted expression as an LValue.  This triggers the
1117         proper LValue processing that is later required by Assign.
1118
1119         This fixes 72347.
1120
1121         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1122
1123 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
1124
1125         C# 2.0 Fixed buffer implementation
1126
1127         * anonymous.cs: Update after RegisterHelperClass renaming.
1128
1129         * attribute.cs (AttributeTester.fixed_buffer_cache):
1130         Cache of external fixed buffers.
1131         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
1132         implementation if field is fixed buffer else null.
1133
1134         * class.cs
1135         (TypeContainer.AddField): Accept FieldMember instead of Field.
1136         (FieldBase.IsFieldClsCompliant): Extracted code from
1137         VerifyClsCompliance descendant customization.
1138         (FixedField): New class handles fixed buffer fields.
1139         (FixedFieldExternal): Keeps information about imported fixed
1140         buffer.
1141         (IFixedField): Make access to internal or external fixed buffer
1142         same.
1143
1144         * cs-parser.jay: Add fixed buffer parsing.
1145
1146         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
1147         buffer.
1148
1149         * expression.cs (Indirection): Extended implementation to accept
1150         fixed buffer field.
1151         (PointerArithmetic.Emit): Get element from fixed buffer as well.
1152         (ElementAccess.MakePointerAccess): Get type as parameter.
1153         (DoResolve): Add fixed buffer field expression conversion.
1154         (DoResolveLValue): Ditto.
1155         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
1156         (ArrayPtr): Derives from FixedBufferPtr.
1157         (ArrayPtr.Emit): Add extra emit for array elements.
1158
1159         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
1160
1161         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
1162         for compiler generated types.
1163         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
1164
1165         * statement.cs (Fixed): Refactored to be easier add fixed buffer
1166         and consume less memory.
1167         (Fixed.Resolve): Add fixed buffer case.
1168
1169         * typemanager.cs (compiler_generated_attr_ctor,
1170         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
1171         (HasElementType): Add our own implementation to work on every
1172         runtime.
1173
1174 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1175
1176         * anonymous.cs (CaptureContext): Track whether `this' has been
1177         referenced.   
1178
1179         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
1180         only captured `this' if it was implicitly done (instance
1181         methods/variables were used). 
1182
1183         * codegen.cs (EmitContext.CaptureThis): New method to flag that
1184         `this' must be captured.
1185
1186 2005-01-30  Miguel de Icaza  <miguel@novell.com>
1187  
1188         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
1189         is null it means that there has been no need to capture anything,
1190         so we just create a sibling.
1191
1192         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
1193
1194         Just a partial fix.  The other half is fairly elusive.
1195         
1196 2005-02-10  Raja R Harinath  <rharinath@novell.com>
1197
1198         Fix #52586, cs0121-4.cs.
1199         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
1200         and return a hashtable.
1201         (MemberCache.ClearDeclaredOnly): New.
1202         (MemberCache.MemberCache): Update to change.  Make a deep copy of
1203         the method_hash of a base type too.
1204         (MemberCache.AddMethods): Adapt to having a deep copy of the base
1205         type methods.  Overwrite entries with the same MethodHandle so
1206         that the ReflectedType is correct.  The process leaves in base
1207         virtual functions and their overrides as distinct entries.
1208         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
1209         matters since it was boxed in a ArrayList before.
1210         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
1211         modifier.
1212         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
1213         case of a virtual function and its override (choose the overload
1214         as better).
1215         (Invocation.OverloadResolve): Avoid 'override' members during
1216         'applicable_type' calculation.
1217
1218 2005-02-09  Raja R Harinath  <rharinath@novell.com>
1219
1220         Combine two near-redundant caches.
1221         * typemanager.cs (method_params): Rename from method_internal_params.
1222         (TypeManager.GetParameterData): New.  Replace
1223         Invocation.GetParameterData.
1224         (TypeManager.LookupParametersByBuilder): Remove.
1225         * expression.cs (Invocation.method_parameter_cache): Remove.
1226         (Invocation.GetParameterData): Remove.
1227         Update to changes.
1228         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
1229         Update to changes.
1230
1231 2005-02-08  Raja R Harinath  <rharinath@novell.com>
1232
1233         Fix #72015.
1234         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
1235         TypeManager.multicast_delegate_type is null, resolve it by looking
1236         up "System.MulticastDelegate".
1237         * rootcontext.cs (RootContext.ResolveCore): Simplify.
1238
1239 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
1240             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
1241             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
1242
1243         Fix cs0164.cs.
1244         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
1245         (LabeledStatement.AddReference): New.  Set 'referenced'.
1246         (Goto.Resolve): Use it.
1247
1248 2005-02-05  John Luke  <john.luke@gmail.com>
1249
1250         * driver.cs: remove duplicate -doc line in Usage ()
1251
1252 2005-02-04  Raja R Harinath  <rharinath@novell.com>
1253
1254         * location.cs (Location.AddFile): Fix CS2002 error report.
1255
1256 2005-02-02  Martin Baulig  <martin@ximian.com>
1257
1258         * delegate.cs (Delegate.DefineType): Report an internal error if
1259         TypeManager.multicast_delegate_type is null.  See bug #72015 for
1260         details.        
1261
1262 2005-02-02  Raja R Harinath  <rharinath@novell.com>
1263
1264         Fix a crasher in a variant of #31984.
1265         * const.cs (Constant.CheckBase): New override that defers the
1266         new-or-override check in case the base type hasn't been populated
1267         yet.
1268         (Constant.Define): Ensure the new-or-override check is performed.
1269
1270 2005-02-01  Duncan Mak  <duncan@ximian.com>
1271
1272         * const.cs (LookupConstantValue): Check that `ce' is not null
1273         before calling GetValue ().
1274
1275 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1276
1277         Fix test-334.cs (#69519).
1278         * cs-parser.jay (using_alias_directive): Pass in an expression to
1279         NamespaceEntry.UsingAlias.
1280         (using_namespace_directive): Pass in an expression to
1281         NamespaceEntry.Using.
1282         (namespace_name): Don't flatten to a string.
1283         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
1284         (NamespaceEntry.AliasEntry.Resolve): Lookup using
1285         ResolveAsTypeStep.
1286         (NamespaceEntry.UsingEntry): Likewise.
1287         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
1288         changes.
1289         (NamespaceEntry.LookupForUsing): Remove.
1290         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
1291         names.
1292         (NamespaceEntry.Lookup): Remove support for dotted names.
1293
1294 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1295
1296         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
1297         split into two.
1298         (NamespaceEntry.ImplicitParent): Compute on demand.
1299         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
1300         parallels the current.
1301         (NamespaceEntry.LookupForUsing): Use it.
1302         (NamespaceEntry.Lookup): If the current namespace-entry is
1303         implicit, don't search aliases and using tables.
1304
1305 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1306
1307         Fix #31984.
1308         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
1309         BaseCache here.
1310         (TypeContainer.BaseCache): Compute on demand.
1311         (TypeContainer.FindMembers): Define constants and types if they're
1312         not already created.
1313         (FieldMember.Define): Move resetting of ec.InUnsafe before error
1314         check.
1315         * const.cs (Constant.Define): Make idempotent.
1316
1317 2005-01-29  Miguel de Icaza  <miguel@novell.com>
1318
1319         * pending.cs: Produce better code (no nops produced by using Ldarg
1320         + value).
1321         
1322         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
1323         i - 1' it should be arg + 1.
1324
1325         Fixes bug #71819.
1326
1327 2005-01-28  Raja R Harinath  <rharinath@novell.com>
1328
1329         * attribute.cs (Attribute.CheckAttributeType): Make private
1330         non-virtual.
1331         (Attribute.ResolveType): Make virtual.
1332         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
1333         handling of RootContext.Tree.Types.
1334
1335 2005-01-27  Raja R Harinath  <rharinath@novell.com>
1336
1337         Update attribute-handling to use the SimpleName/MemberAccess
1338         mechanisms.
1339         * cs-parser.jay (attribute): Pass in an expression to the
1340         constructors of Attribute and GlobalAttribute.
1341         * attribute.cs (Attribute): Take an expression for the name.
1342         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
1343         passed in attribute name expression.
1344         (Attribute.CheckAttributeType): Use it.
1345         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
1346         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
1347         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
1348         argument to prevent error messages if the lookup fails.
1349
1350 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
1351
1352         * expression.cs (Indirection): Implemented IVariable interface
1353         to support indirection in AddressOf operator.
1354         (PointerArithmetic.Emit): Add optimalization for case where
1355         result can be precomputed.
1356
1357 2005-01-26  Martin Baulig  <martin@ximian.com>
1358
1359         * class.cs (TypeContainer.AttributeTargets): Return the correct
1360         AttributeTargets depending on our `Kind' instead of throwing an
1361         exception; fixes #71632.
1362
1363 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
1364
1365         Fix #71257
1366         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
1367         constant members.
1368
1369 2005-01-25  Raja R Harinath  <rharinath@novell.com>
1370
1371         Fix #71602.
1372         * expression.cs (MemberAccess.DoResolve): Don't complain with
1373         cs0572 when the LHS of a member access has identical name and type
1374         name.
1375
1376 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
1377
1378         Fix #71651, #71675
1379         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
1380         CreatePermission.
1381         Create custom PermissionSet only for PermissionSetAttribute.
1382
1383 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
1384
1385         Fix #71649
1386         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
1387         delegates in static class.
1388
1389 2005-01-24  Martin Baulig  <martin@ximian.com>
1390
1391         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1392         merging an implicit block, just use its reachability.
1393
1394         * statement.cs (Block.Resolve): Make the unreachable code check
1395         work wrt. implicit blocks; see test-337 from #63842.
1396
1397 2005-01-21  Alp Toker  <alp@atoker.com>
1398  
1399         * cs-parser.jay: destructor_declaration's container is PartialContainer
1400         not Class when partial types are used, so use Kind prop instead of
1401         'is'.
1402         
1403 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
1404
1405         * cs-parser.jay: Improve error reporting when an interface
1406         declares new types.
1407
1408 2005-01-20  Dick Porter  <dick@ximian.com>
1409
1410         * support.cs: SeekableStreamReader fix from Sandor Dobos
1411         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
1412         chars are read.  Fixes bug 70369.
1413
1414 2005-01-20  Raja R Harinath  <rharinath@novell.com>
1415
1416         * cs-parser.jay (catch_clause): Simplify current_block handling
1417         somewhat.
1418
1419 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
1420
1421         * convert.cs (ImplicitStandardConversionExists): Synchronize the
1422         code with ImplicitStandardConversion to handle the implicit
1423         conversion of method groups into valid delegate invocations. 
1424
1425         The problem is that in parameter handling we were using this code
1426         path.  Fixes bug #64698
1427
1428 2005-01-19  Raja R Harinath  <rharinath@novell.com>
1429
1430         * cs-parser.jay: Fix several infelicities.
1431         - Avoid assigning to the parser value stack.  Code like 
1432           '$3 = null' is unclean.  Synthesize a value for the code block
1433           instead. 
1434         - Avoid using oob_stack for storing location information.  Use ...
1435         (_mark_): ... this.  New (empty) rule.  Saves the current location
1436         in $$.
1437         (foreach_statement): Avoid using oob_stack for current_block
1438         handling.  Use technique used in for_statement and
1439         using_statement.  Synthesize a value for the code block to store
1440         additional intermediate information.
1441
1442 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
1443
1444         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
1445         of a different type is only allowed to private fields of a
1446         containing type, not on fields of a base class.
1447
1448         See test-174.cs and error cs0122-9.cs
1449
1450 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1451
1452         Fix test-335.cs (bug #58126).
1453         * cs-parser.jay (argument): Split out non-expression parts of the
1454         rule into 'non_simple_argument'.
1455         (invocation_expression): Support parenthesized invocations with
1456         multiple arguments, and with single non-simple arguments.
1457
1458 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1459
1460         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
1461         places.
1462
1463 2005-01-12  Raja R Harinath  <rharinath@novell.com>
1464
1465         Fix cs0038-1.cs, cs1640-6.cs.
1466         * ecore.cs (Expression.Resolve): Remove special-case for
1467         SimpleName in error-handling.
1468         (Expression.almostMatchedMembers): Relax access permission to
1469         protected.
1470         (Expression.MemberLookupFailed): Handle duplicates in
1471         almostMatchedMembers list.
1472         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
1473         * expression.cs (New.DoResolve): Report CS1540 for more cases.
1474         * typemanager.cs (GetFullNameSignature): Use the MethodBase
1475         overload if the passed in MemberInfo is a MethodBase.
1476
1477 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
1478
1479         Fix #70749
1480         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
1481         for non-CAS & merge permission sets properly.
1482
1483 2005-01-11  Raja R Harinath  <rharinath@novell.com>
1484
1485         Improve standard-compliance of simple name and member access 
1486         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
1487         * ecore.cs (FullNamedExpression): New abstract base class 
1488         for Namespaces and TypeExpressions.
1489         (ResolveFlags.SimpleName): Remove.
1490         (SimpleName): Remove support for dotted names.
1491         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
1492         DeclSpace.FindType and DeclSpace.LookupType.
1493         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
1494         (Expression.ExprClassName): Make member function.
1495         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
1496         a namespace.  Remove creation of dotted "SimpleName"s.
1497         (MemberAccess.DoResolve): Likewise.
1498         * decl.cs (DeclSpace.Cache): Make private.
1499         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
1500         (DeclSpace.FindType): Update.
1501         (DeclSpace.LookupType): Move here from RootContext.  Return a 
1502         FullNamedExpression.
1503         * namespace.cs (Namespace): Derive from FullNamedExpression
1504         so that it can be part of expression resolution.
1505         (Namespace.Lookup): Return an FullNamedExpression.
1506         (NamespaceEntry.LookupAlias): Lookup aliases only in current
1507         namespace.
1508         * rootcontext.cs (NamespaceLookup): Remove.
1509         (LookupType): Move to DeclSpace.
1510         * attribute.cs (CheckAttributeType): Update.
1511         * doc.cs (FindDocumentedType): Remove allowAlias argument.
1512         (FindDocumentedTypeNonArray): Likewise.
1513
1514 2005-01-11  Raja R Harinath  <rharinath@novell.com>
1515
1516         Fix cs0509.cs, cs1632.cs.
1517         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
1518         is the same as IsInterface.
1519         (TypeContainer.GetClassBases): Likewise.
1520         * statement.cs (LabeledStatement.ig): New field.
1521         (LabeledStatement.LabelTarget): Save ILGenerator which created the
1522         label.
1523         (LabeledStatement.DoEmit): Check that the label was created with
1524         the same ILGenerator.
1525
1526 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1527
1528         Fix #71058
1529         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
1530         accessors to its properties.
1531
1532         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
1533         from accessors to property.
1534         
1535 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1536
1537         Fix #70722
1538         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
1539         only for overrides.
1540         
1541 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
1542
1543         * attribute.cs: Check for null and empty strings.  
1544
1545         I have lost another battle to Paolo.
1546
1547 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
1548
1549         Fix #70942
1550         * class.cs (PropertyMethod): Set Parent field in ctors.
1551         (SetMethod.InternalParameters): Add unsafe switch hack.
1552         Override MarkForDuplicationCheck where it is appropriate.
1553
1554         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
1555         It says whether container allows members with the same name.
1556         Base default is no.
1557         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
1558         Removed is_method parameter.
1559
1560 2005-01-06  Duncan Mak  <duncan@ximian.com>
1561
1562         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
1563         because the previous change led to incorrect reporting of CS1032
1564         ("Cannot define/undefine preprocessor symbols after first token in
1565         file"). Instead of using `tokens_seen' as the only flag that
1566         triggers CS1040, introduce `comments_seen'. This new flag is used
1567         to signify having seen comments on the current line, so it is
1568         unset after a newline.
1569
1570 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1571
1572         * doc.cs : When searching for a type, find nested type too.
1573           This fixes bug #71040.
1574
1575 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1576
1577         * doc.cs :
1578           - Warn missing member comment on those classes which also does not
1579             have doc comments. Fixed bug #71041.
1580           - Don't warn missing doc comment on default constructor.
1581             Fixed bug #71042.
1582
1583 2005-01-06  Duncan Mak  <duncan@ximian.com>
1584
1585         * cs-tokenizer.cs (xtoken): After handling traditional C-style
1586         comments, set `tokens_seen' to true. This allows us to detect
1587         misplaced preprocessor directives (i.e. not at the beginning of
1588         the a line, nor after whitespaces). In that case, report error
1589         CS1040. This fixes bug #56460.
1590
1591         * cs-parser.jay (interface_member_declaration): Add checks for
1592         IsExplicitImpl, and report CS0541 error if an interface member is
1593         defined as an explicit interface declaration.
1594
1595 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
1596
1597         Fix #70817
1598         * class.cs (PropertyMethod): Set Parent field in ctors.
1599         (SetMethod.InternalParameters): Add unsafe switch hack.
1600         
1601         * decl.cs (MemberCore.Parent): Cannot be readonly.
1602
1603 2005-01-06  Raja R Harinath  <rharinath@novell.com>
1604
1605         * decl.cs (DeclSpace.ResolveType): Remove.
1606         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
1607         Merge in code from ...
1608         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
1609         * class.cs, enum.cs: Update to changes.
1610
1611 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
1612
1613         * anonymous.cs: Ensure that we init the scope of our parent if it
1614         has not been initialized yet.
1615
1616 2004-12-30  Duncan Mak  <duncan@ximian.com>
1617
1618         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
1619         if field.FieldBuilder is null. Fixes #70758.
1620
1621         * convert.cs: Fixed some typos and updated some of the comments.
1622         (ImplicitStandardConversionExists):
1623         (TryImplicitIntConversion): If `target_type' is an interface and
1624         the type of `ic' implements this interface, return true or a new
1625         BoxedCast instead of null. This fixes #70468.
1626
1627 2004-12-29  Duncan Mak  <duncan@ximian.com>
1628
1629         * expression.cs (Argument.Emit): Check that Expr is
1630         IMemoryLocation before casting to it, and report CS1510 otherwise.
1631
1632         This fixes #70402.
1633
1634 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
1635
1636         * statement.cs (Block.ThisVariable): remove the recursion here, to
1637         make the --profile more sane.
1638
1639 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
1640
1641         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
1642         assembly, by JB Evain.
1643
1644 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1645
1646         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
1647           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
1648         "parent" refers to enclosing type/class.  "base" refers to superclass.
1649
1650 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1651
1652         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1653         Ensure that we only have GlobalAttributes.
1654         * attribute.cs (Attribute.Emit): Make non-virtual.
1655         (GlobalAttribute.Emit): Remove.
1656         (Attribute.Resolve): Make virtual.
1657         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
1658         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
1659         the argument. Don't create one.
1660         (Attribute.GetObsoleteAttribute): Likewise.
1661         (Attribute.GetClsCompliantAttributeValue): Likewise.
1662         * class.cs, decl.cs: Update to changes.
1663
1664 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
1665
1666         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
1667         
1668         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
1669         
1670         * statement.cs (Foreach.Resolve): Add error 186 report.
1671
1672 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
1673
1674         * expression.cs (Conditional.DoResolve): Add warning 429.
1675         
1676         * statement.cs (If.Resolve): Add warning 665.
1677
1678 2004-12-16  Raja R Harinath  <rharinath@novell.com>
1679
1680         New invariant: RootContext.Tree.Types.NamespaceEntry == null
1681         except when in the parser, and in GlobalAttribute.
1682         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
1683         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
1684         RootContext.Tree.Types.NamespaceEntry once work is done.
1685         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
1686         and resets RootContext.Tree.Types.NamespaceEntry.
1687
1688 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
1689
1690         * cs-parser.jay: Don't create a block for every variable.
1691
1692 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
1693
1694         * location.cs: Provide extra information.
1695
1696         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
1697         variables from the captured environment, it is the ldarg_0.
1698
1699 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1700
1701         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
1702         find a conclusion.
1703         
1704         * class.cs: Changed warning level for 169 to avoid developer
1705         displeasure from warning flooding. It will be changed back when they
1706         fix most of current BCL warnings.
1707         
1708         * RootContext.cs: Pushed default WarningLevel to 3.
1709         
1710         * statement.cs: Removed unused variable.
1711
1712 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
1715         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
1716         Add error 502 report.
1717         (StaticClass.DefineType): Add error 441 report.
1718         (Class.AllowedModifiersProp): New virtual property as temporary
1719         extension to AllowedModifiers.
1720         (Class.DefineType): Add error 418 report. Moved ModFlags check here
1721         to share implementation with StaticClass and don't call virtual
1722         methods from ctor.
1723         
1724         * driver.cs (MainDriver): Add error 1558 test.
1725
1726         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1727         report. Moved error 36 test here.
1728
1729         * statement.cs (Throw.Resolve): Add error 724 report.
1730
1731         * typemanager.cs: Add out_attribute_type core type.
1732         
1733 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
1734
1735         * class.cs (TypeContainer.VerifyClsCompliance): Add error
1736         3018 report.
1737         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1738
1739         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1740         3017 report.
1741         
1742         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1743
1744         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
1745         Add error 3023 report.
1746         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1747
1748         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1749         implementation.
1750
1751 2004-12-12  John Luke  <john.luke@gmail.com>
1752
1753         * driver.cs (AddArgs): take -- into account when
1754         adding arguments, fixes bug 65710 
1755
1756 2004-12-12  Martin Baulig  <martin@ximian.com>
1757
1758         * expression.cs (Unary.TryReduceNegative): Added support for
1759         SByteConstant and ByteConstant.
1760         (Unary.Reduce): Check error values from TryReduceNegative().
1761
1762 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1763
1764         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1765         and report exception as error 182.
1766
1767 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1768
1769         * driver.cs (Main): Fix message when there are warnings.
1770
1771 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1772
1773         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1774
1775 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1776
1777         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1778         Reduced number of warnings.
1779         
1780         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1781
1782 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1783
1784         * driver.cs: Removed message.
1785
1786         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1787
1788 2004-12-08    <vargaz@freemail.hu>
1789
1790         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1791
1792 2004-12-08  Martin Baulig  <martin@ximian.com>
1793
1794         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1795         instead of a CS3002 for properties and indexer.
1796
1797 2004-12-08  Martin Baulig  <martin@ximian.com>
1798
1799         * decl.cs (MemberName.ToString): Make this work again.
1800
1801 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1802
1803         * attribute.cs (Resolve): Add error 591 detection.
1804
1805         * class.cs (FieldMember.Define): Add error 1547 detection.
1806         (Indexer.Define): Add error 620 detection.
1807         (Operator.Define): Add error 590 detection.
1808
1809         * ecore.cs: Missing argument for error 79.
1810
1811         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1812         detection.
1813
1814 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1815
1816         Fix #70106
1817         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1818         only.
1819
1820 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1821
1822         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1823           Some operator comments were suppressed.
1824         * doc.cs : Implicit/explicit operator name in doc comments are like
1825           "op_Explicit(type)~returnType", so added suffix handling.
1826
1827 2004-12-07  Martin Baulig  <martin@ximian.com>
1828
1829         * decl.cs
1830         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1831         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1832         (DeclSpace.ec): New protected field; store the EmitContext here.
1833         (DeclSpace.EmitContext): New public property; moved here from
1834         `TypeContainer'.
1835         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1836         EmitContext.
1837
1838         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1839         (Enum.Emit): Don't create a new EmitContext.
1840
1841         * delegate.cs (Delegate.DefineType): Always create the
1842         EmitContext.
1843
1844         * iterators.cs (Iterators.DefineIterator): Create a new
1845         EmitContext and store it in `ec'.
1846
1847 2004-08-24  Martin Baulig  <martin@ximian.com>
1848
1849         * typemanager.cs
1850         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
1851         this for accessibility checks.
1852         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
1853         IsNestedFamilyAccessible.
1854         (TypeManager.IsSubclassOf): New method, do what the name actually
1855         says.   
1856
1857 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1858
1859         Fix crash on cs0657-17.cs.
1860         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1861         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1862         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1863         the case where the NamespaceEntry gets overwritten.
1864
1865 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1866
1867         Fixed #69195, #56821
1868         * ecore.cs (ResolveBoolean): Tiny refactoring.
1869
1870         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1871         of right expression resolving when left is false constant and
1872         operator is LogicalAnd OR true constant and operator is LogicalOr.
1873
1874         * statement.cs (ResolveUnreachable): Always reports warning.
1875
1876 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1877
1878         * class.cs: Distinguish between 1721 and 1722 (just a little help
1879         for the programmer).
1880
1881 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1882
1883         * delegate.cs: Only allow this on new versions of the language. 
1884
1885 2004-12-02  Duncan Mak  <duncan@ximian.com>
1886
1887         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1888         Expression class.
1889         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1890         here as a static method. Take an additional bool out parameter
1891         `must_do_cs1540_check' for signaling to InstanceResolve.
1892         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1893         member field from PropertyExpr class and made it an argument of
1894         the method instead.
1895         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1896         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1897         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1898         and `remove_accessor' as well as InstanceResolve: report CS0122
1899         where applicable.
1900
1901         Fixes #70129.
1902
1903 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1904
1905         Fix test-327.cs, test-328.cs, and put in early infrastructure
1906         for eventually fixing #52697.
1907         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1908         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1909         from other methods.
1910         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1911         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1912         (VerifyUsing, error246): Update.
1913         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1914         'NamespaceEntry.LookupNamespaceOrType'.
1915
1916 2004-12-03  Martin Baulig  <martin@ximian.com>
1917
1918         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1919         method as our child, call AnonymousMethod.Compatible() on it.
1920
1921 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1922
1923         Disable XML documentation support in 'basic' profile.
1924         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
1925         Redirect XmlElement to System.Object.
1926         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
1927         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
1928         * mcs.exe.sources: Add doc-bootstrap.cs.
1929         * doc-bootstrap.cs: New file.  Contains empty stub implementation
1930         of doc.cs.
1931
1932 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1933
1934         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1935           comments are allowed.
1936
1937 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1938
1939         * delegate.cs: Add checks for subtypes in paramaters and return values
1940         in VerifyMethod () to add support for Covariance/Contravariance
1941         in delegates.
1942         
1943 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1944
1945         * report.cs: Remove extra closing parenthesis.
1946
1947         * convert.cs (Error_CannotImplicitConversion): If the name of the
1948         types are the same, provide some extra information.
1949
1950         * class.cs (FieldBase): Use an unused bit field from the field to
1951         encode the `has_offset' property from the FieldMember.  This saves
1952         a couple of Ks on bootstrap compilation.
1953
1954         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1955         method as our child, return the AnonymousMethod resolved
1956         expression.
1957
1958         * expression.cs (New.DoResolve): Allow return values from
1959         NewDelegate to also include AnonymousMethods.
1960
1961         Fixes #70150.
1962
1963 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1964
1965         Fix bug #70102
1966         * attribute.cs (Resolve): Improved implementation of params
1967         attribute arguments.
1968
1969         * support.cs (ParameterData): Add HasParams to be faster.
1970
1971 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1972
1973         all things are for /doc support:
1974
1975         * doc.cs: new file that supports XML documentation generation.
1976         * mcs.exe.sources: added doc.cs.
1977         * driver.cs:
1978           Handle /doc command line option.
1979           Report error 2006 instead of 5 for missing file name for /doc.
1980           Generate XML documentation when required, after type resolution.
1981         * cs-tokenizer.cs:
1982           Added support for picking up documentation (/// and /** ... */),
1983           including a new XmlCommentState enumeration.
1984         * cs-parser.jay:
1985           Added lines to fill Documentation element for field, constant,
1986           property, indexer, method, constructor, destructor, operator, event
1987           and class, struct, interface, delegate, enum.
1988           Added lines to warn incorrect comment.
1989         * rootcontext.cs :
1990           Added Documentation field (passed only when /doc was specified).
1991         * decl.cs:
1992           Added DocComment, DocCommentHeader, GenerateDocComment() and
1993           OnGenerateDocComment() and some supporting private members for
1994           /doc feature to MemberCore.
1995         * class.cs:
1996           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1997         * delegate.cs:
1998           Added overriden DocCommentHeader.
1999         * enum.cs:
2000           Added overriden DocCommentHeader and GenerateDocComment().
2001
2002 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
2003
2004         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
2005         unwrapping the enumeration values, chain to
2006         DoConstantNumericPromotions again, so we can promote things to the
2007         fundamental types (takes care of enums that are bytes, sbytes).
2008
2009         Fixes bug #62054.
2010
2011 2004-12-01  Raja R Harinath  <rharinath@novell.com>
2012
2013         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
2014         Fix long-standing bug in type-lookup.  Use FindType instead of
2015         LookupType when ec.ResolvingTypeTree.
2016         (Attribute.ResolveType, Attribute.Resolve)
2017         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
2018         Update to changes.
2019         (Attributes.Search): Remove internal version.  Update.
2020         (Attributes.SearchMulti): Update.
2021         (Attributes.GetClsCompliantAttribute): Remove.
2022         (Attributes.GetIndexerNameAttribute): Remove.
2023         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
2024         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
2025         * class.cs (Indexer.Define): Likewise.
2026
2027 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
2028
2029         Fix bug #68790
2030         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
2031         MarshallByReference members access.
2032
2033         * expression.cs: Use CheckMarshallByRefAccess;
2034         Better error CS0197 message.
2035
2036         * report.cs: Print whole related error message.
2037
2038 2004-11-30  Raja R Harinath  <rharinath@novell.com>
2039
2040         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
2041         the current directory to help debugging.
2042
2043 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2044
2045         * class (GetClassBases): Better error 60 report.
2046         (EventProperty): Disabled warning 67 detection.
2047
2048 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2049
2050         Fix bug #60324
2051         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
2052
2053         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
2054         precise values.
2055
2056 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2057
2058         Fix bug #49488
2059         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
2060
2061         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
2062
2063 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
2064
2065         * attribute.cs (Attribute.Resolve): Refine error reporting and
2066         report a cs0117 if the identifier does not exist, to distinguish
2067         from 0617 which is a miss-use of the actual identifier.
2068
2069         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
2070         between cs0070 and cs0079.
2071
2072         * class.cs (MemberBase.DoDefine): When reporting a wrong
2073         accessibility level, we use MethodCore to compare instead of
2074         Method (this was a regression in some refactoring effort).
2075
2076         So now we correctly report cs0056 again.
2077
2078         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
2079         testing the target_type (which was known to be object_type) and
2080         not the source type (which is anonymous_method).
2081
2082         Fixed reporting of error cs1660.
2083
2084         * expression.cs (UserCast.Source): Expose the underlying cast.
2085
2086         * statement.cs (Switch.SwitchGoverningType): Sort the list of
2087         allowed types to find a match to int32 first (most common).
2088
2089         In addition, it ignores any ImplicitUserConversions that did an
2090         internal implicit conversion (as the switch statement allows only
2091         one integral conversion to exist).
2092
2093         * class.cs (PartialContainer.Create): rename `name' to
2094         `member_name' for clarity.  Then replace the string calls with a
2095         call to MemberName.GetPartialName, as now using
2096         MemberName.ToString is an error (this is due to the side effects
2097         it had, that were fixed in the past).
2098
2099         This will restore the error reporting on a number of partial class
2100         errors that were missusing this (and getting an exception as a
2101         results, which is now just a plain textual warning, because
2102         yyparse debug output would crash otherwise).
2103
2104 2004-11-26  Raja R Harinath  <rharinath@novell.com>
2105
2106         * Makefile (PROGRAM_INSTALL_DIR): Remove.
2107
2108 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2109
2110         * rootcontext.cs (LookupType): Make sure to cache lookups that
2111         don't give us a negative result. This saves about 5% of corlib
2112         compilation time.
2113
2114 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2115
2116         * report.cs (AbstractMessage.Print): messages are sent to stderr
2117
2118         * class.cs (TypeContainer.GetClassBases): It is an error to have a
2119         non-interface in the list of interfaces (at this point, either
2120         parent was properly set, or a base class is being listed in the
2121         interfaces section).
2122
2123         This flags error 1722, and resolves the crash from bug 69259.
2124
2125 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2126
2127         * statement.cs (Using.EmitExpressionFinally): make this work right
2128         for valuetypes. Fixes 69926.
2129
2130 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2131
2132         * const.cs (Const.ChangeType): Cope with the "0 literal can be
2133         converted to an enum" here, before we try to change the underlying
2134         type.  This code exists, but it is a different code path than the
2135         one used while encoding constants.
2136
2137         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
2138         old bug: when converting from the null literal to a pointer,
2139         return an EmptyCast, not the NullLiteral.
2140
2141         This fixes #69921, the recent null_type changes probably made this
2142         bug more prominent.
2143
2144         (ImplicitReferenceConversionExists): In addition, resynchronized
2145         the code here, so it matches the same code in
2146         ImplicitReferenceConversionExists for the `from any class-type S
2147         to any interface-type T'.
2148         
2149
2150 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
2151
2152         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
2153
2154 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
2155
2156         * cs-parser.jay: Use verbosity accordingly. 
2157
2158 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2159
2160         * expression.cs (Unary.ResolveOperator): Do not report warning;
2161         AddressOf reads from variable.
2162         
2163         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
2164
2165 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2166
2167         Fix bug #69462
2168
2169         * attribute.cs (Attributable): Removed CheckTargets.
2170         (Attributes.Emit): Explicit attribute targets are tested here.
2171
2172         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
2173         not enabled for interfaces.
2174
2175         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
2176         (GetAssemblyName): Ouch next bug there.
2177
2178 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2179
2180         * expression.cs: Error 275 added.
2181         
2182 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
2183
2184         Fix bug #69177 (Implemented decimal constant support)
2185
2186         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
2187         (BinaryFold): Add DecimalConstant.
2188
2189         * const.cs (Define): Decimal constant 
2190         (is not constant.
2191         (ChangeType): Add decimal type handling.
2192         (LookupConstantValue): Don't set value for decimal type but
2193         emit DecimalConstantAttribute. Needed for constant optimization.
2194
2195         * constant.cs (ToDecimal): New method.
2196         (ConvertToDecimal): New method.
2197         (IntConstant): Implemented ConvertToDecimal.
2198         (DecimalConstant.Emit): Emit optimized version for decimals in
2199         int range.
2200
2201         * expression.cs (ResolveOperator): Changed order of constant
2202         reduction to work correctly with native types which have
2203         overloaded operators.
2204         (ResolveMemberAccess): Extract constant value from attribute
2205         for decimal type.
2206
2207         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
2208
2209         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
2210         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
2211         (ChangeType): Decimal is special.
2212         (TypeToCoreType): Add decimal type.
2213
2214 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2215
2216         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
2217         decimal types.
2218
2219 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2220
2221         * class.cs (EventField.ApplyAttributeBuilder): Fix error
2222         test cs1667-5.cs.
2223
2224 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2225
2226         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
2227
2228         * pending.cs (PendingImplementation): Grab only interfaces.
2229
2230 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * statement.cs (ForeachHelperMethods): Add location member and
2233         error 202 detection.
2234
2235 2004-11-19  Raja R Harinath  <rharinath@novell.com>
2236
2237         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
2238         automatically handled by executable.make.
2239         (PROGRAM): Make profile-specific.
2240
2241 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
2242
2243         * expression.cs (DoResolveBase): Fixed wrong warning for out
2244         variables.
2245
2246 2004-11-18  Martin Baulig  <martin@ximian.com>
2247
2248         Merged latest changes into gmcs.  Please keep this comment in
2249         here, it makes it easier for me to see what changed in MCS since
2250         the last time I merged.
2251
2252 2004-11-17  Raja R Harinath  <rharinath@novell.com>
2253
2254         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
2255         (TypeHandle.GetMemberCache): New.
2256         (TypeHandle.TypeHandle): Update.
2257         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
2258         (TypeManager.LookupParentInterfacesCache):
2259         Rename from LookupInterfaceCache.  Optimize slightly.
2260         (TypeManager.MemberLookup_FindMembers): Update.
2261         * decl.cs (MemberCache.MemberCache): Set Container to null in the
2262         multi-type variant.
2263         (AddCacheContents): Rename from AddHashtable.
2264         * class.cs (TypeContainer.parent_container): Remove.
2265         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
2266         (TypeContainer.DoDefineMembers): Don't initialize it.
2267         Update to name changes.
2268         
2269 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
2270
2271         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
2272         that factors the code to check access modifiers on override.  
2273
2274         (PropertyBase): Use the code here.
2275
2276         Patch from Lluis S'anchez, fixes bug #69361.
2277
2278 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
2279
2280         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
2281         routine that is used to report the use of a captured variable
2282         whose address has been taken.
2283
2284         There are two checks: one when variables are being captured and
2285         the other check is when the address of a variable is taken. 
2286         
2287         (because an anonymous methods might be resolved before *or* after
2288         the address has been taken) and 
2289
2290         * expression.cs (Conditional.DoResolve): Remove the special
2291         casing that Martin added to trueExpr and falseExpr being both
2292         NullLiteral.  We get the right behavior now just by introducing
2293         the null_type into the compiler. 
2294
2295         * convert.cs (ExplicitConversion): Change the code to use
2296         null_type instead of testing `expr is NullLiteral'.
2297         (ImplicitConversionStandard): use null_type too.
2298         (ImplicitReferenceConversionExists): use null_type too.
2299         (ImplicitReferenceConversion): use null_type too.
2300
2301         * literal.cs: The type of `NullLiteral' is now null_type instead
2302         of object_type. 
2303         (Resolve): Set the type here.
2304
2305         * typemanager.cs: Introduce null_type.
2306
2307 2004-11-17  Martin Baulig  <martin@ximian.com>
2308
2309         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
2310         direction, like FindMembers() does.  Fixes #69546, testcase is in
2311         test-315.cs.    
2312
2313 2004-11-16  Martin Baulig  <martin@ximian.com>
2314
2315         This is based on a patch from Marek Safar, see bug #69082.
2316         Fixes bugs #63705 and #67130.
2317
2318         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
2319         method; create a MemberCache for an interface type and cache the
2320         result.
2321
2322         * decl.cs (IMemberContainer.ParentContainer): Removed.
2323         (IMemberContainer.ParentCache): New property.
2324         (MemberCache.SetupCacheForInterface): Removed.
2325         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
2326         to create a cache for an interface's "parent".
2327
2328         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
2329         interfaces too.
2330
2331 2004-11-16  Martin Baulig  <martin@ximian.com>
2332
2333         Merged back from gmcs; these changes already went into gmcs a
2334         couple of weeks ago.
2335
2336         * typemanager.cs
2337         (TypeManager.AddUserType): Removed the `ifaces' argument.
2338         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
2339         `TypeExpr []'.
2340         (TypeManager.AddUserInterface): Removed.
2341         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
2342         `TypeExpr []'.
2343         (TypeManager.GetInterfaces): Likewise.
2344         (TypeManager.GetExplicitInterfaces): Likewise.
2345
2346         * ecore.cs (TypeExpr.GetInterfaces): Removed.
2347
2348         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
2349         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
2350
2351 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
2352
2353         * statement.cs: Avoid adding bools to a hashtable.
2354
2355 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
2356
2357         * expression.cs (Invocation.OverloadResolve): Flag error if we are
2358         calling an unsafe method from a safe location.
2359
2360 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
2361
2362         Fix #69167
2363         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
2364
2365 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
2366
2367         * namespace.cs (VerifyUsing): use GetPartialName instead of
2368         ToString. 
2369
2370 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
2371
2372         * statement.cs (Return.Resolve): Fix regression in typo: if
2373         `in_exc', we have to request a NeedReturnLabel, this was a typo
2374         introduced in the anonymous method check-in.  Fixes #69131.
2375
2376         * Indexers were using the ShortName when defining themselves,
2377         causing a regression in the compiler bootstrap when applying the
2378         patch from 2004-11-02 (first part), now they use their full name
2379         and the bug is gone.
2380
2381 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
2382
2383         * driver.cs: Strip the path from the names of embedded resources. Fixes
2384         #68519.
2385
2386 2004-11-04  Raja R Harinath  <rharinath@novell.com>
2387
2388         Fix error message regression: cs0104-2.cs.
2389         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
2390         (AliasEntry.Resolve): Update.
2391         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
2392         'silent' flag.
2393         (RootContext.LookupType): Update.
2394
2395 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
2396
2397         * cs-parser.jay: Add support for handling accessor modifiers
2398         * class: Add support port accessor modifiers and error checking,
2399         define PropertyMethod.Define as virtual (not abstract anymore)
2400         * ecore.cs: Add checking for proeprties access with access modifiers
2401         * iterators.cs: Modify Accessor constructor call based in the modified
2402         constructor
2403 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
2404
2405         * expression.cs (StringConcat): Handle being called twice,
2406         as when we have a concat in a field init with more than two
2407         ctors in the class
2408
2409 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
2410
2411         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
2412         special case explicit implementations, we should always produce
2413         the .property or .event declaration.
2414         
2415         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
2416         since it will not return correct data if people use this
2417         unresolved in the presence of using statements (see test-313).
2418
2419         * class.cs (MethodData.Define): If we are an explicit interface
2420         implementation, set the method name to the full name of the
2421         interface plus the name of the method.  
2422
2423         Notice that using the method.MethodName.GetFullName() does not
2424         work, as it will only contain the name as declared on the source
2425         file (it can be a shorthand in the presence of using statements)
2426         and not the fully qualifed type name, for example:
2427
2428         using System;
2429
2430         class D : ICloneable {
2431                 object ICloneable.Clone ()  {
2432                 }
2433         }
2434
2435         Would produce a method called `ICloneable.Clone' instead of
2436         `System.ICloneable.Clone'.
2437
2438         * namespace.cs (Alias.Resolve): Use GetPartialName.
2439         
2440 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2441
2442         * cs-parser.jay: Add error 1055 report.
2443
2444 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
2445
2446         * assign.cs (Assign.DoResolve): Only do the transform of
2447         assignment into a New if the types are compatible, if not, fall
2448         through and let the implicit code deal with the errors and with
2449         the necessary conversions. 
2450
2451 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2452
2453         * cs-parser.jay: Add error 1031 report.
2454
2455         * cs-tokenizer.cs: Add location for error 1038.
2456
2457 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2458
2459         * cs-parser.jay: Add error 1016 report.
2460
2461 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2462
2463         * cs-parser.jay: Add errors 1575,1611 report.
2464
2465 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2466
2467         * cs-parser.jay: Add error 1001 report.
2468
2469 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2470
2471         Fix #68850
2472         * attribute.cs (GetMarshal): Add method argument for
2473         caller identification.
2474
2475         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
2476         agument for GetMarshal and RuntimeMissingSupport.
2477
2478 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2479
2480         * attribute.cs (ExtractSecurityPermissionSet): Removed
2481         TypeManager.code_access_permission_type.
2482
2483         * typemanager.cs: Removed TypeManager.code_access_permission_type.
2484
2485 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
2486
2487         * expression.cs (LocalVariableReference.DoResolveLValue): Check
2488         for obsolete use of a variable here.   Fixes regression on errors
2489         cs0619-25 and cs0619-26.
2490
2491 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
2492
2493         Fix #62358, implemented security attribute encoding.
2494
2495         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
2496         Tests permitted SecurityAction for assembly or other types.
2497         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
2498         data from SecurityPermissionAttribute to PermisionSet class.
2499
2500         * class.cs (ApplyAttributeBuilder): Added special handling
2501         for System.Security.Permissions.SecurityAttribute based types.
2502
2503         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
2504         special handling for System.Security.Permissions.SecurityAttribute
2505         based types.
2506
2507         * enum.cs (ApplyAttributeBuilder): Added special handling
2508         for System.Security.Permissions.SecurityAttribute based types.
2509
2510         * parameter.cs (ApplyAttributeBuilder): Added special handling
2511         for System.Security.Permissions.SecurityAttribute based types.
2512
2513         * rootcontext.cs: Next 2 core types.
2514
2515         * typemanager.cs (TypeManager.security_permission_attr_type):
2516         Built in type for the SecurityPermission Attribute.
2517         (code_access_permission_type): Build in type.
2518
2519 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
2520
2521         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
2522         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
2523         all of this information into
2524         EmitContext.EmitCapturedVariableInstance.
2525         
2526         * codegen.cs (EmitCapturedVariableInstance): move here the
2527         funcionality of emitting an ldarg.0 in the presence of a
2528         remapping.   This centralizes the instance emit code.
2529
2530         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
2531         then emit a load of this: it means that we have reached the
2532         topmost ScopeInfo: the one that contains the pointer to the
2533         instance of the class hosting the anonymous method.
2534
2535         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
2536         captures to the topmost CaptureContext.
2537
2538 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
2539
2540         * expression.cs (LocalVariableReference): Move the knowledge about
2541         the iterators into codegen's EmitCapturedVariableInstance.
2542
2543 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
2544
2545         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
2546         all code paths return a value from an anonymous method (it is the
2547         same as the 161 error, but for anonymous methods).
2548
2549 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
2550
2551         The introduction of anonymous methods in the compiler changed
2552         various ways of doing things in the compiler.  The most
2553         significant one is the hard split between the resolution phase
2554         and the emission phases of the compiler.
2555
2556         For instance, routines that referenced local variables no
2557         longer can safely create temporary variables during the
2558         resolution phase: they must do so from the emission phase,
2559         since the variable might have been "captured", hence access to
2560         it can not be done with the local-variable operations from the runtime.
2561         
2562         * statement.cs 
2563
2564         (Block.Flags): New flag `IsTopLevel' to indicate that this block
2565         is a toplevel block.
2566
2567         (ToplevelBlock): A new kind of Block, these are the blocks that
2568         are created by the parser for all toplevel method bodies.  These
2569         include methods, accessors and anonymous methods.
2570
2571         These contain some extra information not found in regular blocks:
2572         A pointer to an optional CaptureContext (for tracking captured
2573         local variables and parameters).  A pointer to the parent
2574         ToplevelBlock.
2575         
2576         (Return.Resolve): Catch missmatches when returning a value from an
2577         anonymous method (error 1662).
2578         Invoke NeedReturnLabel from the Resolve phase instead of the emit
2579         phase.
2580
2581         (Break.Resolve): ditto.
2582
2583         (SwitchLabel): instead of defining the labels during the
2584         resolution phase, we now turned the public ILLabel and ILLabelCode
2585         labels into methods called GetILLabelCode() and GetILLabel() that
2586         only define the label during the Emit phase.
2587
2588         (GotoCase): Track the SwitchLabel instead of the computed label
2589         (its contained therein).  Emit the code by using
2590         SwitchLabel.GetILLabelCode ().
2591
2592         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2593         whether the Local has been captured or not.
2594
2595         (LocalInfo.IsCaptured): New property, used to tell whether the
2596         local has been captured.
2597         
2598         * anonymous.cs: Vastly updated to contain the anonymous method
2599         support.
2600
2601         The main classes here are: CaptureContext which tracks any
2602         captured information for a toplevel block and ScopeInfo used to
2603         track the activation frames for various local variables.   
2604
2605         Each toplevel block has an optional capture context associated
2606         with it.  When a method contains an anonymous method both the
2607         toplevel method and the anonymous method will create a capture
2608         context.   When variables or parameters are captured, they are
2609         recorded on the CaptureContext that owns them, for example:
2610
2611         void Demo () {
2612              int a;
2613              MyDelegate d = delegate {
2614                  a = 1;
2615              }
2616         }
2617
2618         Here `a' will be recorded as captured on the toplevel
2619         CapturedContext, the inner captured context will not have anything
2620         (it will only have data if local variables or parameters from it
2621         are captured in a nested anonymous method.
2622
2623         The ScopeInfo is used to track the activation frames for local
2624         variables, for example:
2625
2626         for (int i = 0; i < 10; i++)
2627                 for (int j = 0; j < 10; j++){
2628                    MyDelegate d = delegate {
2629                         call (i, j);
2630                    }
2631                 }
2632
2633         At runtime this captures a single captured variable `i', but it
2634         captures 10 different versions of the variable `j'.  The variable
2635         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2636         recorded on a child.  
2637
2638         The toplevel ScopeInfo will also track information like the `this'
2639         pointer if instance variables were referenced (this is necessary
2640         as the anonymous method lives inside a nested class in the host
2641         type of the method). 
2642
2643         (AnonymousMethod): Expanded to track the Toplevel, implement
2644         `AnonymousMethod.Compatible' to tell whether an anonymous method
2645         can be converted to a target delegate type. 
2646
2647         The routine now also produces the anonymous method content
2648
2649         (AnonymousDelegate): A helper class that derives from
2650         DelegateCreation, this is used to generate the code necessary to
2651         produce the delegate for the anonymous method that was created. 
2652
2653         * assign.cs: API adjustments for new changes in
2654         Convert.ImplicitStandardConversionExists.
2655
2656         * class.cs: Adjustments to cope with the fact that now toplevel
2657         blocks are of type `ToplevelBlock'. 
2658
2659         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2660         insteda of standard blocks.
2661
2662         Flag errors if params arguments are passed to anonymous methods.
2663
2664         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2665         `CurrentAnonymousMethod' which points to the current Anonymous
2666         Method.  The variable points to the AnonymousMethod class that
2667         holds the code being compiled.  It is set in the new EmitContext
2668         created for the anonymous method.
2669
2670         (EmitContext.Phase): Introduce a variable and an enumeration to
2671         assist in enforcing some rules about when and where we are allowed
2672         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2673         only one that enfonces this right now).
2674
2675         (EmitContext.HaveCaptureInfo): new helper method that returns
2676         whether we have a CapturedContext initialized.
2677
2678         (EmitContext.CaptureVariable): New method used to register that a
2679         LocalInfo must be flagged for capturing. 
2680
2681         (EmitContext.CapturedParameter): New method used to register that a
2682         parameters must be flagged for capturing. 
2683         
2684         (EmitContext.CapturedField): New method used to register that a
2685         field must be flagged for capturing. 
2686
2687         (EmitContext.HaveCapturedVariables,
2688         EmitContext.HaveCapturedFields): Return whether there are captured
2689         variables or fields. 
2690
2691         (EmitContext.EmitMethodHostInstance): This is used to emit the
2692         instance for the anonymous method.  The instance might be null
2693         (static methods), this (for anonymous methods that capture nothing
2694         and happen to live side-by-side with the current method body) or a
2695         more complicated expression if the method has a CaptureContext.
2696
2697         (EmitContext.EmitTopBlock): Routine that drives the emission of
2698         code: it will first resolve the top block, then emit any metadata
2699         and then emit the code.  The split is done so that we can extract
2700         any anonymous methods and flag any captured variables/parameters.
2701         
2702         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2703         during this phase, the ILGenerator should not be used as labels
2704         and local variables declared here might not be accessible to any
2705         code that is part of an anonymous method.  
2706
2707         Exceptions to this include the temporary variables that are
2708         created by some statements internally for holding temporary
2709         variables. 
2710         
2711         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2712         metadata for a cb
2713
2714         (EmitContext.TemporaryReturn): This method is typically called
2715         from the Emit phase, and its the only place where we allow the
2716         ReturnLabel to be defined other than the EmitMeta.  The reason is
2717         that otherwise we would have to duplicate a lot of logic in the
2718         Resolve phases of various methods that today is on the Emit
2719         phase. 
2720
2721         (EmitContext.NeedReturnLabel): This no longer creates the label,
2722         as the ILGenerator is not valid during the resolve phase.
2723
2724         (EmitContext.EmitThis): Extended the knowledge in this class to
2725         work in anonymous methods in addition to iterators. 
2726
2727         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2728         code is necessary on the stack to access the instance to a local
2729         variable (the variable will be accessed as a field).
2730
2731         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2732         EmitContext.EmitAddressOfParameter): Routines to support
2733         parameters (not completed at this point). 
2734         
2735         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2736         will also remove the parameters.
2737
2738         * convert.cs (Convert): Define a `ConstantEC' which points to a
2739         null.  This is just to prefity some code that uses
2740         ImplicitStandardConversion code and do not have an EmitContext
2741         handy.
2742
2743         The idea is to flag explicitly that at that point in time, it is
2744         known that the conversion will not trigger the delegate checking
2745         code in implicit conversions (which requires a valid
2746         EmitContext). 
2747
2748         Everywhere: pass new EmitContext parameter since
2749         ImplicitStandardConversionExists now requires it to check for
2750         anonymous method conversions. 
2751
2752         (Convert.ImplicitStandardConversionExists): If the type of an
2753         expression is the anonymous_method_type, and the type is a
2754         delegate, we invoke the AnonymousMethod.Compatible method to check
2755         whether an implicit conversion is possible. 
2756
2757         (Convert.ImplicitConversionStandard): Only do implicit method
2758         group conversions if the language level is not ISO_1.
2759
2760         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2761         MethodInfo for the Invoke method.  used by Delegate and
2762         AnonymousDelegate.
2763
2764         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2765         method conversions if the target type is a delegate.
2766
2767         Removed extra debugging nops.
2768
2769         (LocalVariableReference): Turn the `local_info' into a public
2770         field. 
2771
2772         Add `prepared' field, the same hack used for FieldExprs to cope
2773         with composed assignments, as Local variables do not necessarily
2774         operate purely on the stack as they used to: they can be captured
2775         fields. 
2776
2777         Add `temp' for a temporary result, like fields.
2778
2779         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2780
2781         It now copes with Local variables that are captured and emits the
2782         proper instance variable to load it from a field in the captured
2783         case. 
2784
2785         (ParameterReference.DoResolveBase): During the resolve phase,
2786         capture parameters if we are in an anonymous method.
2787
2788         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2789         anonymous method, use the EmitContext helper routines to emit the
2790         parameter reference.
2791
2792         * iterators.cs: Set RemapToProxy to true/false during the
2793         EmitDispose class.
2794
2795         * parameters.cs (GetParameterByName): New helper method. 
2796
2797         * typemanager.cs (anonymous_method_type) a new type that
2798         represents an anonyous method.  This is always an internal type,
2799         used as a fencepost to test against the anonymous-methodness of an
2800         expression. 
2801         
2802 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2803
2804         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2805         561 report.
2806         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2807
2808 2004-10-18  Martin Baulig  <martin@ximian.com>
2809
2810         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2811         `Type' directly, but call ResolveType() on it.
2812         (Catch.Resolve): Likewise.
2813         (Foreach.Resolve): Likewise.
2814
2815 2004-10-18  Martin Baulig  <martin@ximian.com>
2816
2817         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2818         `Type' directly, but call ResolveType() on it.
2819         (Probe.DoResolve): Likewise.
2820         (ArrayCreation.LookupType): Likewise.
2821         (TypeOf.DoResolve): Likewise.
2822         (SizeOf.DoResolve): Likewise.
2823
2824 2004-10-18  Martin Baulig  <martin@ximian.com>
2825
2826         * expression.cs (Invocation.BetterFunction): Put back
2827         TypeManager.TypeToCoreType().
2828
2829 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2830
2831         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2832         the ResolveType.
2833
2834 2004-10-18  Martin Baulig  <martin@ximian.com>
2835
2836         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
2837         `Type' directly, but call ResolveType() on it.
2838
2839 2004-10-18  Martin Baulig  <martin@ximian.com>
2840
2841         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2842         `Type' directly, but call ResolveType() on it.
2843         (MemberBase.DoDefine): Likewise.
2844
2845         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2846         `Type' directly, but call ResolveType() on it.
2847         (ComposedCast.DoResolveAsTypeStep): Likewise.
2848
2849         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2850         `Type' directly, but call ResolveType() on it.
2851
2852 2004-10-17  John Luke  <john.luke@gmail.com>
2853
2854         * class.cs (Operator.GetSignatureForError): use CSharpName
2855
2856         * parameter.cs (Parameter.GetSignatureForError): Returns
2857         correct name even if was not defined.
2858
2859 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2860
2861         Fix #65816.
2862         * class.cs (TypeContainer.EmitContext): New property.
2863         (DefineNestedTypes): Create an emitcontext for each part.
2864         (MethodCore.DoDefineParameters): Use container's emitcontext.
2865         Pass type array to InternalParameters.
2866         (MemberBase.DoDefine): Use container's emitcontext.
2867         (FieldMember.Define): Likewise.
2868         (Event.Define): Likewise.
2869         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2870         Pass type array to InternalParameters.
2871         (SetIndexerMethod.GetParameterInfo): Likewise.
2872         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2873         * delegate.cs (Define): Pass emitcontext to
2874         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2875         array to InternalParameters.
2876         * expression.cs (ParameterReference.DoResolveBase): Pass
2877         emitcontext to GetParameterInfo.
2878         (ComposedCast.DoResolveAsTypeStep): Remove check on
2879         ec.ResolvingTypeTree.
2880         * parameter.cs (Parameter.Resolve): Change argument to
2881         EmitContext.  Use ResolveAsTypeTerminal.
2882         (Parameter.GetSignature): Change argument to EmitContext.
2883         (Parameters.ComputeSignature): Likewise.
2884         (Parameters.ComputeParameterTypes): Likewise.
2885         (Parameters.GetParameterInfo): Likewise.
2886         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2887         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2888         * support.cs (InternalParameters..ctor): Remove variant that takes
2889         a DeclSpace.
2890         * typemanager.cs (system_intptr_expr): New.
2891         (InitExpressionTypes): Initialize it.
2892
2893 2004-10-12  Chris Toshok  <toshok@ximian.com>
2894
2895         * cs-parser.jay: fix location for try_statement and catch_clause.
2896
2897 2004-10-11  Martin Baulig  <martin@ximian.com>
2898
2899         * report.cs: Don't make --fatal abort on warnings, we have
2900         -warnaserror for that.
2901
2902 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2903
2904         More DeclSpace.ResolveType avoidance.
2905         * decl.cs (MemberCore.InUnsafe): New property.
2906         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2907         with newly created EmitContext.
2908         (FieldMember.Define): Likewise.
2909         * delegate.cs (Delegate.Define): Likewise.
2910         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2911         only if normal name-lookup fails.
2912         (TypeExpr.DoResolve): Enable error-checking.
2913         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2914         (SizeOf.DoResolve): Likewise.
2915         (ComposedCast.DoResolveAsTypeStep): Likewise.
2916         (StackAlloc.DoResolve): Likewise.
2917         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2918         (Block.Unsafe): New property.
2919         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2920         (Unsafe): Set 'unsafe' flag of contained block.
2921         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2922         (Fixed.Resolve): Likewise.
2923         (Catch.Resolve): Likewise.
2924         (Using.ResolveLocalVariableDecls): Likewise.
2925         (Foreach.Resolve): Likewise.
2926
2927 2004-10-05  John Luke <john.luke@gmail.com>
2928
2929         * cs-parser.jay: add location to error CS0175
2930
2931 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2932
2933         * ecore.cs (Expression.Constantity): Add support for turning null
2934         into a constant.
2935
2936         * const.cs (Const.Define): Allow constants to be reference types
2937         as long as the value is Null.
2938
2939 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2940
2941         * namespace.cs (NamespaceEntry.Using): No matter which warning
2942         level is set, check if this namespace name has already been added.
2943
2944 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2945
2946         * expression.cs: reftype [!=]= null should always use br[true,false].
2947         # 67410
2948
2949 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2950
2951         Fix #67108
2952         * attribute.cs: Enum conversion moved to 
2953         GetAttributeArgumentExpression to be applied to the all
2954         expressions.
2955
2956 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2957
2958         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2959         * class.c (TypeContainer.DefineType): Flag error if
2960         base types aren't accessible due to access permissions.
2961         * decl.cs (DeclSpace.ResolveType): Move logic to
2962         Expression.ResolveAsTypeTerminal.
2963         (DeclSpace.ResolveTypeExpr): Thin layer over
2964         Expression.ResolveAsTypeTerminal.
2965         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2966         Refactor code into NestedAccess.  Use it.
2967         (DeclSpace.NestedAccess): New.
2968         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2969         argument to silence errors.  Check access permissions.
2970         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2971         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2972         (Cast.DoResolve): Likewise.
2973         (New.DoResolve): Likewise.
2974         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2975         (TypeOf.DoResolve): Likewise.
2976
2977         * expression.cs (Invocation.BetterConversion): Return the Type of
2978         the better conversion.  Implement section 14.4.2.3 more faithfully.
2979         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2980         section 14.4.2.2 explicit.
2981         (Invocation.OverloadResolve): Update.
2982         (Invocation): Remove is_base field.
2983         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2984         (Invocation.Emit): Likewise.
2985
2986 2004-09-27  Raja R Harinath  <rharinath@novell.com>
2987
2988         * README: Update to changes.
2989
2990 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2991
2992         * cs-parser.jay: Reverted 642 warning fix.
2993
2994 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2995
2996         Fix bug #66615
2997         * decl.cs (FindMemberWithSameName): Indexer can have more than
2998         1 argument.
2999
3000 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3001
3002         * expression.cs (LocalVariableReference.DoResolveLValue):
3003         Do not report warning 219 for out values.
3004         (EmptyExpression.Null): New member to avoid extra allocations.
3005
3006 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3007
3008         * cs-parser.jay: Fix wrong warning 642 report.
3009
3010         * cs-tokenizer.cs (CheckNextToken): New helper;
3011         Inspect next character if is same as expected.
3012
3013 2004-09-23  Martin Baulig  <martin@ximian.com>
3014
3015         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
3016         (Convert.ImplicitReferenceConversionExists): Likewise.
3017
3018 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3019
3020         * class.cs (Operator.Define): Add error 448 and 559 report.
3021
3022 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3023
3024         * class.cs (MemberBase.IsTypePermitted): New protected
3025         method for checking error CS0610.
3026
3027 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3028
3029         * class.cs (TypeContainer.HasExplicitLayout): New property
3030         Returns whether container has StructLayout attribute set Explicit.
3031         (FieldMember): New abstract class for consts and fields.
3032         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
3033         (Field): Reuse FieldMember.
3034
3035         * const.cs (Const): Reuse FieldMember.
3036
3037         * rootcontext.cs: EmitConstants call moved to class.
3038
3039 2004-09-22  Martin Baulig  <martin@ximian.com>
3040
3041         Thanks to Peter Sestoft for this bug report.
3042
3043         * expression.cs (Conditional): If both the `trueExpr' and the
3044         `falseExpr' is a NullLiteral, return a NullLiteral.
3045
3046 2004-09-22  Martin Baulig  <martin@ximian.com>
3047
3048         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
3049         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
3050         for the "get_Current" call.
3051
3052 2004-09-22  Martin Baulig  <martin@ximian.com>
3053
3054         Marek and me just fixed one of our oldest bugs: #28562 :-)
3055
3056         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
3057
3058         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
3059         we're an EnumConstant, just return that.
3060         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
3061         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
3062         to get the value which'll actually be written into the attribute.
3063         However, we have to use GetValue() to access the attribute's value
3064         in the compiler.        
3065
3066 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3067
3068         * constant.cs (Constant.IsNegative): New abstract property
3069         IsNegative.
3070
3071         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
3072         (StackAlloc.DoResolve): Reused IsNegative.
3073
3074 2004-09-21  Martin Baulig  <martin@ximian.com>
3075
3076         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
3077         if we're used in an iterator, we may be called from different
3078         methods.
3079
3080         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
3081         we actually have an exception block.
3082
3083 2004-09-20  John Luke <jluke@cfl.rr.com>
3084
3085         * class.cs, cs-parser.jay: Improve the error report for 1520:
3086         report the actual line where the error happens, not where the
3087         class was declared.
3088
3089         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
3090         Pass location information that was available elsewhere.
3091
3092 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
3093
3094         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
3095         runtime to delay sign assemblies.
3096
3097 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
3098
3099         * cs-parser.jay: Do not report the stack trace, this is barely
3100         used nowadays.
3101
3102 2004-08-22  John Luke  <john.luke@gmail.com>
3103  
3104         * driver.cs : check that a resource id is not already used
3105         before adding it, report CS1508 if it is, bug #63637
3106
3107 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
3108
3109         * ecore.cs: Removed dead code.
3110
3111 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
3112
3113         * class.cs: Do not report warning CS0067 on the interfaces.
3114
3115 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3116
3117         * cs-parser.jay: Add error 504 report.
3118
3119 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3120
3121         * rootcontext.cs: WarningLevel is 4 by default now.
3122
3123         * statement.cs (Fixed.Resolve): Do not null
3124         VariableInfo.
3125
3126 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3127
3128         Fixed bug #55780
3129         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
3130         deep search when property is not virtual.
3131         (PropertyExpr.ResolveAccessors): Make one call for both
3132         accessors.
3133
3134 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3135
3136         Fixed bug #65766
3137         * statement.cs: Error 152 report constains also location.
3138
3139 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3140
3141         Fixed bug #65766
3142         * const.cs: Explicitly set constant as static.
3143
3144 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3145
3146         Fixed bug #64226
3147         * cs-parser.jay: Add error 1017 report.
3148
3149 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3150
3151         Fixed bug #59980, #64224
3152         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
3153
3154         * typemanager.cs (IsSpecialMethod): Simplified
3155
3156 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3157
3158         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
3159         condition with better params.
3160
3161 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3162
3163         Fixed bug #65238
3164         * attribute.cs (Resolve): Property has to have both
3165         accessors.
3166
3167 2004-09-14  Martin Baulig  <martin@ximian.com>
3168
3169         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
3170
3171 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3172
3173         Fixed bug #61902
3174         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
3175         called and is obsolete then this member suppress message
3176         when call is inside next [Obsolete] method or type.
3177
3178         * expression.cs: Use TestObsoleteMethodUsage member.
3179
3180 2004-09-14  Martin Baulig  <martin@ximian.com>
3181
3182         * cs-parser.jay: Sync a bit with the GMCS version.
3183
3184 2004-09-14  Martin Baulig  <martin@ximian.com>
3185
3186         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
3187         (CSharpParser.yacc_verbose_flag): New public field.
3188
3189         * genericparser.cs: Removed.
3190
3191 2004-09-14  Raja R Harinath  <rharinath@novell.com>
3192
3193         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
3194
3195 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
3196
3197         * class.cs (MethodCore.CheckBase): Fix bug #65757.
3198
3199 2004-09-10  Martin Baulig  <martin@ximian.com>
3200
3201         Backported my MemberName changes from GMCS into MCS.
3202
3203         - we are now using a special `MemberName' class instead of using
3204         strings; in GMCS, the `MemberName' also contains the type
3205         arguments.
3206
3207         - changed the grammar rules a bit:
3208           * the old `member_name' is now a `namespace_or_type_name':
3209             The rule is that we use `namespace_or_type_name' everywhere
3210             where we expect either a "member name" (GetEnumerator) or a
3211             "member name" with an explicit interface name
3212             (IEnumerable.GetEnumerator).
3213             In GMCS, the explicit interface name may include type arguments
3214             (IEnumerable<T>.GetEnumerator).
3215           * we use `member_name' instead of just `IDENTIFIER' for
3216             "member names":
3217             The rule is that we use `member_name' wherever a member may
3218             have type parameters in GMCS.       
3219
3220         * decl.cs (MemberName): New public class.
3221         (MemberCore.MemberName): New public readonly field.
3222         (MemberCore.ctor): Take a `MemberName' argument, not a string.
3223         (DeclSpace): Likewise.
3224
3225         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
3226         * enum.cs (Enum.ctor): Likewise.
3227
3228         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
3229         MemberName.     
3230         (AliasEntry.ctor): Take a MemberName, not an Expression.
3231         (AliasEntry.UsingAlias): Likewise.
3232
3233         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
3234         (IMethodData.MemberName): Changed type from string to MemberName.
3235         (MemberBase.ExplicitInterfaceName): Likewise.
3236         (AbstractPropertyEventMethod.SetupName): Make this private.
3237         (AbstractPropertyEventMethod.ctor): Added `string prefix'
3238         argument; compute the member name here.
3239         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
3240         on the `member.MemberName' and the `prefix'.
3241
3242         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
3243         not `type_name'.
3244         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
3245         thus, we get a `MemberName' instead of a `string'.  These
3246         declarations may have type parameters in GMCS.
3247         (interface_method_declaration, delegate_declaration): Likewise.
3248         (class_declaration, interface_declaration): Likewise.
3249         (method_header): Use `namespace_or_type_name' instead of
3250         `member_name'.  We may be an explicit interface implementation.
3251         (property_declaration, event_declaration): Likewise.
3252         (member_name): This is now just an `IDENTIFIER', not a
3253         `namespace_or_type_name'.
3254         (type_name, interface_type): Removed.
3255         (namespace_or_type_name): Return a MemberName, not an Expression.
3256         (primary_expression): Use `member_name' instead of `IDENTIFIER';
3257         call GetTypeExpression() on the MemberName to get an expression.
3258         (IndexerDeclaration.interface_type): Changed type from string to
3259         MemberName.
3260         (MakeName): Operate on MemberName's instead of string's.
3261
3262 2004-09-13  Raja R Harinath  <rharinath@novell.com>
3263
3264         Fix bug #55770.
3265         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
3266         (NamespaceEntry.Lookup): Add new argument to flag if we want the
3267         lookup to avoid symbols introduced by 'using'.
3268         * rootcontext.cs (NamespaceLookup): Update.
3269
3270 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
3271
3272         * class.cs (TypeContainer.DoDefineMembers): Do not call
3273         DefineDefaultConstructor for static classes.
3274
3275 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
3276
3277         * attribute.cs (Attribute.Resolve): Add error 653 report.
3278
3279         * class.cs (Class.ApplyAttributeBuilder): Add error 641
3280         report.
3281         (Method.ApplyAttributeBuilder): Add error 685 report.
3282         (Operator.Define): Add error 564 report.
3283
3284         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
3285
3286         * expression.cs (Invocation.DoResolve): Add error
3287         245 and 250 report.
3288
3289         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
3290         error 674 report.
3291
3292 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3293
3294         * class.cs (ConstructorInitializer.Resolve):
3295         Wrong error number (515->516).
3296
3297 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3298
3299         * class.cs (Indexer.Define): Add error 631 report.
3300
3301 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3302
3303         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
3304
3305 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3306
3307         * expression.cs (Probe.DoResolve): Add error CS0241 report.
3308
3309 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
3310
3311         * cs-parser.jay: Added error CS0241 report.
3312
3313 2004-09-10  Raja R Harinath  <rharinath@novell.com>
3314
3315         * cs-parser.jay (fixed_statement): Introduce a scope for the
3316         declaration in the 'fixed' statement.
3317
3318 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3319
3320         * cs-parser.jay: Added CS0230 error report.
3321
3322 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3323
3324         * cs-parser.jay: Added errors CS0231 and CS0257 report.
3325
3326 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3327
3328         * expression.cs (Argument.Resolve): Added error CS0192 and
3329         CS0199 report.
3330
3331 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3332
3333         C# 2.0 #pragma warning feature
3334
3335         * cs-tokenizer.cs (PreProcessPragma): New method; 
3336         Handles #pragma directive.
3337
3338         * report.cs (WarningRegions): New class; Support
3339         class for #pragma warning directive. It tests whether
3340         warning is enabled for a given line.
3341
3342 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
3343
3344         * const.cs: Add more descriptive error report, tahnks to
3345         Sebastien. 
3346
3347 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
3348
3349         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
3350
3351 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
3352
3353         * expression.cs: Apply patch from Ben: Remove dead code from
3354         ArrayCreation, and remove the TurnintoConstant call in const.cs,
3355         as that code just threw an exception anwyays.
3356
3357         * const.cs: Remove the call to the turnintoconstant, for details
3358         see bug: #63144
3359         
3360         * literal.cs: The type of the null-literal is the null type;  So
3361         we use a placeholder type (literal.cs:System.Null, defined here)
3362         for it.
3363
3364         * expression.cs (Conditional.DoResolve): Remove some old code that
3365         is no longer needed, conversions have been fixed.
3366
3367         (ArrayCreationExpression.DoResolve): Return false if we fail to
3368         resolve the inner expression.
3369
3370 2004-09-07  Raja R Harinath  <rharinath@novell.com>
3371
3372         Fix test-290.cs.
3373         * cs-parser.jay (delegate_declaration): Record a delegate
3374         declaration as a type declaration.
3375         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
3376
3377 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
3378
3379         * parameter.cs: Do not crash if the type can not be resolved. 
3380
3381         * expression.cs: Report errors with unsafe pointers, fixes #64896
3382
3383 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3384
3385         * expression.cs: Pointer arith always needs to do a conv.i
3386         if the operand is a long. fix 65320
3387
3388 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3389
3390         Fixed cs0619-37.cs, cs0619-38.cs
3391
3392         * enum.cs (GetObsoleteAttribute): Removed.
3393
3394         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
3395         on Enum member is double staged. The first is tested member
3396         and then enum.
3397
3398 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3399
3400         Fixed #56986, #63631, #65231
3401
3402         * class.cs: (TypeContainer.AddToMemberContainer): New method,
3403         adds member to name container.
3404         (TypeContainer.AddToTypeContainer): New method, adds type to
3405         name container.
3406         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
3407         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
3408         AddOperator): Simplified by reusing AddToMemberContainer.
3409         (TypeContainer.UserDefinedStaticConstructor): Changed to property
3410         instead of field.
3411         (Method.CheckForDuplications): Fixed implementation to test all
3412         possibilities.
3413         (MemberBase): Detection whether member is explicit interface
3414         implementation is now in constructor.
3415         (MemberBase.UpdateMemberName): Handles IndexerName.
3416         (Accessor): Changed to keep also location information.
3417         (AbstractPropertyEventMethod): Is derived from MemberCore.
3418         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
3419         will be emited or not.
3420         (PropertyBase.AreAccessorsDuplicateImplementation):
3421         Tests whether accessors are not in collision with some method.
3422         (Operator): Is derived from MethodCore to simplify common
3423         operations.
3424
3425         * decl.cs (Flags.TestMethodDuplication): Test for duplication
3426         must be performed.
3427         (DeclSpace.AddToContainer): Adds the member to defined_names
3428         table. It tests for duplications and enclosing name conflicts.
3429
3430         * enum.cs (EnumMember): Clean up to reuse the base structures
3431
3432 2004-09-03  Martin Baulig  <martin@ximian.com>
3433
3434         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3435         into TypeContainer, to make partial classes work again.
3436
3437 2004-09-03  Martin Baulig  <martin@ximian.com>
3438
3439         * rootcontext.cs (RootContext.V2): Removed.
3440
3441 2004-03-23  Martin Baulig  <martin@ximian.com>
3442
3443         * expression.cs (Invocation.OverloadResolve): Added `bool
3444         may_fail' argument and use it instead of the Location.IsNull() hack.
3445
3446 2004-09-03  Martin Baulig  <martin@ximian.com>
3447
3448         Merged latest changes into gmcs.  Please keep this comment in
3449         here, it makes it easier for me to see what changed in MCS since
3450         the last time I merged.
3451
3452 2004-09-03  Raja R Harinath  <rharinath@novell.com>
3453
3454         Fix #61128.
3455         * expression.cs (BetterConversion): Don't allow either conversion 
3456         to be null.  Remove redundant implicit conversion test when 'q ==
3457         null' -- when this function is invoked, we already know that the
3458         implicit conversion exists.
3459         (BetterFunction): Assume that 'best' is non-null.  Remove
3460         redundant reimplementation of IsApplicable when 'best' is null.
3461         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
3462         number of arguments.
3463         (IsAncestralType): Extract from OverloadResolve.
3464         (OverloadResolve): Make robust to the MethodGroupExpr being
3465         unsorted.  Implement all the logic of Section 14.5.5.1, and
3466         support overloading of methods from multiple applicable types.
3467         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
3468
3469         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3470         (RealError, Warning): Append type of report to related symbol.
3471
3472 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
3473
3474         * enum.cs: Fixed CLS-Compliance checks for enum members.
3475         Error tests cs3008-8.cs, cs3014-8.cs
3476
3477 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3478
3479         Fixed bug #62342, #63102
3480         * class.cs: ImplementIndexer uses member.IsExplicitImpl
3481         like ImplementMethod.
3482
3483 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3484
3485         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3486         Fixed bug #65170.
3487
3488 2004-09-02  Martin Baulig  <martin@ximian.com>
3489
3490         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3491         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3492         on the MethodBase.
3493
3494 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3495
3496         C# 2.0 Static classes implemented
3497
3498         * class.cs (TypeContainer): instance_constructors,
3499         initialized_fields, initialized_static_fields,
3500         default_constructor, base_inteface_types are protected to be
3501         accessible from StaticClass.
3502         (TypeContainer.DefineDefaultConstructor): New virtual method
3503         for custom default constructor generating
3504         (StaticClass): New class to handle "Static classes" feature.
3505
3506         * cs-parser.jay: Handle static keyword on class like instance
3507         of StaticClass.
3508
3509         * driver.cs: Added "/langversion" command line switch with two
3510         options (iso-1, default).
3511
3512 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3513
3514         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3515
3516 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3517
3518         * delegate.cs: Style.
3519
3520 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3521
3522         * delegate.cs: Add seperate instance expr field for miguel.
3523
3524 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3525
3526         * PointerArithmetic (Resolve): make sure we are not doing
3527         pointer arith on void*. Also, make sure we are resolved
3528         by not setting eclass until resolve.
3529
3530         All callers: Make sure that PointerArithmetic gets resolved.
3531
3532 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3533
3534         * ArrayCreation (LookupType): If the type does not resolve 
3535         to an array, give an error.
3536
3537 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3538
3539         * statement.cs (Try.Resolve): Fixed bug #64222
3540
3541 2004-08-27  Martin Baulig  <martin@ximian.com>
3542
3543         * class.cs
3544         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3545         crash here.     
3546
3547 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3548
3549         * ecore.cs (Constantify): Get underlying type via
3550         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3551         Windows in special cases.
3552
3553 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3554
3555         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3556         for obtaining also private methods.
3557         (GetRemoveMethod): Used GetRemoveMethod (true)
3558         for obtaining also private methods.
3559
3560 2004-08-24  Martin Baulig  <martin@ximian.com>
3561
3562         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3563         MethodAttributes.HideBySig for operators.
3564
3565 2004-08-23  Martin Baulig  <martin@ximian.com>
3566
3567         Back to the old error reporting system :-)
3568
3569         * report.cs (Message): Removed.
3570         (Report.MessageData, ErrorData, WarningData): Removed.
3571         (Report.Error, Warning): Back to the old system.
3572
3573 2004-08-23  Martin Baulig  <martin@ximian.com>
3574
3575         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3576
3577         * class.cs (TypeContainer.ParentContainer): New public virtual
3578         method; replaces the explicit interface implementation.
3579         (ClassPart.ParentContainer): Override.
3580
3581 2004-08-23  Martin Baulig  <martin@ximian.com>
3582
3583         * statement.cs (Switch): Added support for constant switches; see
3584         #59428 or test-285.cs.
3585
3586 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3587
3588         Fixed bug #62740.
3589         * statement.cs (GetEnumeratorFilter): Removed useless
3590         logic because C# specs is strict. GetEnumerator must be
3591         public.
3592
3593 2004-08-22  Martin Baulig  <martin@ximian.com>
3594
3595         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3596         a switch and may break, reset the barrier.  Fixes #59867.
3597
3598 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3599
3600         CLS-Compliance speed up (~5% for corlib)
3601
3602         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3603         New method. Tests container for CLS-Compliant names
3604
3605         * class.cs (TypeContainer.VerifyClsName): New method.
3606         Checks whether container name is CLS Compliant.
3607         (Constructor): Implements IMethodData.
3608
3609         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3610         low-case table for CLS Compliance test.
3611         (MemberCache.VerifyClsParameterConflict): New method.
3612         Checks method parameters for CS3006 error.
3613
3614         * enum.cs (EnumMember): Is derived from MemberCore.
3615         (Enum.VerifyClsName): Optimized for better performance.
3616
3617 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3618
3619         * report.cs: Renamed Error_T to Error and changed all
3620         references.
3621
3622 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3623
3624         * class.cs (TypeContainer.IndexerArrayList): New inner class
3625         container for indexers.
3626         (TypeContainer.DefaultIndexerName): New constant for default
3627         indexer name. Replaced all "Item" with this constant.
3628         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3629
3630         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3631         DefaultMemberAttribute constructor.
3632
3633 2004-08-05  Martin Baulig  <martin@ximian.com>
3634
3635         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3636         Fix bug #59429.
3637
3638 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3639
3640         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3641         multi platforms problem.
3642
3643         * compiler.csproj: Included shared files.
3644
3645 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3646
3647         Fix bug 60333, 55971 in the more general way
3648         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3649         Added arg_type argument for constant conversion.
3650         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3651
3652 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3653
3654         Fix bug #59760
3655         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3656         OperatorArrayList, MethodCoreArrayList for typecontainer
3657         containers. Changed class member types to these new types.
3658         (MethodArrayList.DefineMembers): Added test for CS0659.
3659
3660 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3661
3662         * cfold.cs: Synchronize the folding with the code in expression.cs
3663         Binary.DoNumericPromotions for uint operands.
3664
3665         * attribute.cs: Revert patch from Raja, it introduced a regression
3666         while building Blam-1.2.1 (hard to isolate a test case).
3667
3668 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3669
3670         Fix for #55382
3671         * class.cs:
3672         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3673         name collision.
3674         (MethodCore.parent_method): New member. The method we're overriding
3675         if this is an override method.
3676         (MethodCore.CheckBase): Moved from Method class and made common.
3677         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3678         private.
3679         (MethodCore.CheckForDuplications): New abstract method. For custom
3680         member duplication search in a container
3681         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3682         method and its return type.
3683         (Event.conflict_symbol): New member. Symbol with same name in the
3684         parent class.
3685
3686         * decl.cs:
3687         (MemberCache.FindMemberWithSameName): New method. The method
3688         is looking for conflict with inherited symbols.
3689
3690 2004-08-04  Martin Baulig  <martin@ximian.com>
3691
3692         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3693
3694         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3695
3696 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3697
3698         * report.cs (Message): New enum for better error, warning reference in
3699         the code.
3700         (MessageData): New inner abstract class. It generally handles printing of
3701         error and warning messages.
3702         Removed unused Error, Warning, Message methods.
3703
3704 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3705
3706         Fix for cs0592-8.cs test
3707         * attribute.cs
3708         (Attributable.ValidAttributeTargets): Made public.
3709         (Attribute.ExplicitTarget): New member for explicit target value.
3710         (Attribute.CheckTargets): Now we translate explicit attribute
3711         target to Target here.
3712
3713 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3714
3715         * ecore.cs (MethodGroupExpr): new IsBase property.
3716
3717         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3718
3719         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3720         rather than an instance expr.
3721
3722         (DelegateCreation.Emit): Use the method group rather than
3723         the instance expression. Also, if you have base.Foo as the
3724         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3725
3726         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3727
3728         (NewDelegate.DoResolve): Only check for the existance of Invoke
3729         if the method is going to be needed. Use MethodGroupExpr.
3730
3731         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3732
3733         * expression.cs: For pointer arith., make sure to use
3734         the size of the type, not the size of the pointer to
3735         the type.
3736
3737 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3738
3739         Fix for #60722
3740         * class.cs (Class): Added error CS0502 test.
3741
3742 2004-08-03  John Luke  <jluke@cfl.rr.com>
3743             Raja R Harinath  <rharinath@novell.com>
3744
3745         Fix for #60997.
3746         * attribute.cs (Attribute.complained_before): New flag.
3747         (Attribute.ResolveType, Attribute.Resolve),
3748         (Attribute.DefinePInvokeMethod): Set it.
3749         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3750         
3751 2004-08-03  Martin Baulig  <martin@ximian.com>
3752
3753         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3754         use a user-defined operator; we still need to do numeric
3755         promotions in case one argument is a builtin type and the other
3756         one has an implicit conversion to that type.  Fixes #62322.
3757
3758 2004-08-02  Martin Baulig  <martin@ximian.com>
3759
3760         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3761         (LocalInfo.IsThis): New public property.
3762         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3763
3764 2004-08-01  Martin Baulig  <martin@ximian.com>
3765
3766         * class.cs (TypeContainer.GetClassBases): Don't set the default
3767         here since we may get called from GetPartialBases().
3768         (TypeContainer.DefineType): If GetClassBases() didn't return a
3769         parent, use the default one.
3770
3771 2004-07-30  Duncan Mak  <duncan@ximian.com>
3772
3773         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
3774
3775 2004-07-30  Martin Baulig  <martin@ximian.com>
3776
3777         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3778
3779         * class.cs (SourceMethod): New public class, derive from the
3780         symbol writer's ISourceMethod.
3781         (Method): Use the new symbol writer API.
3782
3783         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3784         as argument and use the new symbol writer.
3785
3786         * location.cs
3787         (SourceFile): Implement the symbol writer's ISourceFile.
3788         (Location.SymbolDocument): Removed.
3789         (Location.SourceFile): New public property.
3790
3791         * symbolwriter.cs: Use the new symbol writer API.
3792
3793 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3794
3795         * Makefile (install-local): Remove.  Functionality moved to
3796         executable.make.
3797
3798 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3799
3800         * Makefile: Install mcs.exe.config file together with mcs.exe.
3801         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3802         correct runtime version.
3803         
3804 2004-07-25  Martin Baulig  <martin@ximian.com>
3805
3806         * class.cs
3807         (TypeContainer.RegisterOrder): Removed, this was unused.
3808         (TypeContainer, interface_order): Removed.
3809         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3810         TypeContainer as argument since we can also be called with a
3811         `PartialContainer' for a partial class/struct/interface.
3812         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3813         of checking whether we're an `Interface' - we could be a
3814         `PartialContainer'.
3815         (PartialContainer.Register): Override; call
3816         AddClass()/AddStruct()/AddInterface() on our parent.
3817
3818         * cs-parser.jay (interface_member_declaration): Add things to the
3819         `current_container', not the `current_class'.
3820
3821         * rootcontext.cs (RegisterOrder): The overloaded version which
3822         takes an `Interface' was unused, removed.
3823
3824         * typemanager.cs (TypeManager.LookupInterface): Return a
3825         `TypeContainer', not an `Interface'.
3826         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3827         contain a `PartialContainer' for an interface, so check it's
3828         `Kind' to figure out what it is.
3829
3830 2004-07-25  Martin Baulig  <martin@ximian.com>
3831
3832         * class.cs (Class.DefaultTypeAttributes): New public constant.
3833         (Struct.DefaultTypeAttributes): Likewise.
3834         (Interface.DefaultTypeAttributes): Likewise.
3835         (PartialContainer.TypeAttr): Override this and add the
3836         DefaultTypeAttributes.
3837
3838 2004-07-25  Martin Baulig  <martin@ximian.com>
3839
3840         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3841         we can just use the `Parent' field instead.
3842
3843 2004-07-25  Martin Baulig  <martin@ximian.com>
3844
3845         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3846
3847 2004-07-25  Martin Baulig  <martin@ximian.com>
3848
3849         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3850         our parts before defining any methods.
3851         (TypeContainer.VerifyImplements): Make this virtual.
3852         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3853         on our PartialContainer.
3854
3855 2004-07-25  Martin Baulig  <martin@ximian.com>
3856
3857         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3858
3859         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3860         argument, we can just use the `Parent' field instead.
3861
3862         * class.cs
3863         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3864         (MemberBase.DoDefine): Likewise.
3865
3866 2004-07-24  Martin Baulig  <martin@ximian.com>
3867
3868         * decl.cs (MemberCore.Parent): New public field.
3869         (DeclSpace.Parent): Moved to MemberCore.
3870
3871         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3872         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3873         parent's .ctor.
3874         (FieldBase, Field, Operator): Likewise.
3875         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3876         (EventField, Event): Likewise.
3877
3878 2004-07-23  Martin Baulig  <martin@ximian.com>
3879
3880         * class.cs (PartialContainer): New public class.
3881         (ClassPart): New public class.
3882         (TypeContainer): Added support for partial classes.
3883         (TypeContainer.GetClassBases): Splitted some of the functionality
3884         out into GetNormalBases() and GetPartialBases().
3885
3886         * cs-tokenizer.cs (Token.PARTIAL): New token.
3887         (Tokenizer.consume_identifier): Added some hacks to recognize
3888         `partial', but only if it's immediately followed by `class',
3889         `struct' or `interface'.
3890
3891         * cs-parser.jay: Added support for partial clases.
3892
3893 2004-07-23  Martin Baulig  <martin@ximian.com>
3894
3895         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3896         a `DeclSpace' and also made it readonly.
3897         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3898         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3899         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3900
3901         * cs-parser.jay: Pass the `current_class', not the
3902         `current_container' (at the moment, this is still the same thing)
3903         to a new Method, Property, Event, Indexer or Constructor.
3904
3905 2004-07-23  Martin Baulig  <martin@ximian.com>
3906
3907         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3908         and removed the `current_interface' one.
3909         (struct_declaration, class_declaration, interface_declaration):
3910         Set `current_class' to the newly created class/struct/interface;
3911         set their `Bases' and call Register() before parsing their body.
3912
3913 2004-07-23  Martin Baulig  <martin@ximian.com>
3914
3915         * class.cs (Kind): New public enum.
3916         (TypeContainer): Made this class abstract.
3917         (TypeContainer.Kind): New public readonly field.
3918         (TypeContainer.CheckDef): New public method; moved here from
3919         cs-parser.jay.
3920         (TypeContainer.Register): New public abstract method.
3921         (TypeContainer.GetPendingImplementations): New public abstract
3922         method.
3923         (TypeContainer.GetClassBases): Removed the `is_class' and
3924         `is_iface' parameters.
3925         (TypeContainer.DefineNestedTypes): Formerly known as
3926         DoDefineType().
3927         (ClassOrStruct): Made this class abstract.
3928
3929         * tree.cs (RootTypes): New public type. 
3930
3931 2004-07-20  Martin Baulig  <martin@ximian.com>
3932
3933         * tree.cs (Tree.RecordNamespace): Removed.
3934         (Tree.Namespaces): Removed.
3935
3936         * rootcontext.cs (RootContext.IsNamespace): Removed.
3937
3938         * cs-parser.jay (namespace_declaration): Just create a new
3939         NamespaceEntry here.
3940
3941 2004-07-20  Martin Baulig  <martin@ximian.com>
3942
3943         * statement.cs (ExceptionStatement): New abstract class.  This is
3944         now used as a base class for everyone who's using `finally'.
3945         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
3946         our local variables before using them.
3947
3948         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
3949         virtual method.  This is used by Yield.Resolve() to "steal" an
3950         outer block's `finally' clauses.
3951         (FlowBranchingException): The .ctor now takes an ExceptionStatement
3952         argument.
3953
3954         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
3955         version which takes an ExceptionStatement.  This version must be
3956         used to create exception branchings.
3957
3958         * iterator.cs
3959         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
3960         (Iterator.EmitMoveNext): Added exception support; protect the
3961         block with a `fault' clause, properly handle 'finally' clauses.
3962         (Iterator.EmitDispose): Run all the `finally' clauses here.
3963
3964 2004-07-20  Martin Baulig  <martin@ximian.com>
3965
3966         * iterator.cs: This is the first of a set of changes in the
3967         iterator code.  Match the spec more closely: if we're an
3968         IEnumerable, then GetEnumerator() must be called.  The first time
3969         GetEnumerator() is called, it returns the current instance; all
3970         subsequent invocations (if any) must create a copy.
3971
3972 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
3973
3974         * expression.cs: Resolve the constant expression before returning
3975         it. 
3976
3977 2004-07-19  Martin Baulig  <martin@ximian.com>
3978
3979         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
3980         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
3981         the return type of the new EmitContext.
3982
3983 2004-07-18  Martin Baulig  <martin@ximian.com>
3984
3985         * class.cs (Property.Define): Fix iterators.
3986
3987         * iterators.cs (Iterator.Define): Moved the
3988         `container.AddInterator (this)' call here from the .ctor; only do
3989         it if we resolved successfully.
3990
3991 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
3992
3993         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
3994         `true' for preprocessing directives that we parse.  The return
3995         value indicates whether we should return to regular tokenizing or
3996         not, not whether it was parsed successfully.
3997
3998         In the past if we were in: #if false ... #line #endif, we would
3999         resume parsing after `#line'.  See bug 61604.
4000
4001         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
4002         building: IsEnumType should return true only for enums, not for
4003         enums or System.Enum itself.  This fixes #61593.
4004
4005         Likely what happened is that corlib was wrong: mcs depended on
4006         this bug in some places.  The bug got fixed, we had to add the
4007         hack, which caused bug 61593.
4008
4009         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
4010         that was a workaround for the older conditions.
4011
4012 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
4013
4014         * assign.cs: IAssignMethod has a new interface, as documented
4015         inline. All assignment code now uses this new api.
4016
4017         * ecore.cs, expression.cs: All classes which implement
4018         IAssignMethod now use the new interface.
4019
4020         * expression.cs (Invocation): add a hack to EmitCall so that
4021         IndexerAccess can be the target of a compound assignment without
4022         evaluating its arguments twice.
4023
4024         * statement.cs: Handle changes in Invocation api.
4025
4026 2004-07-16  Martin Baulig  <martin@ximian.com>
4027
4028         * iterators.cs: Rewrote this.  We're now using one single Proxy
4029         class for both the IEnumerable and the IEnumerator interface and
4030         `Iterator' derives from Class so we can use the high-level API.
4031
4032         * class.cs (TypeContainer.AddIterator): New method.
4033         (TypeContainer.DoDefineType): New protected virtual method, which
4034         is called from DefineType().
4035         (TypeContainer.DoDefineMembers): Call DefineType() and
4036         DefineMembers() on all our iterators.
4037         (TypeContainer.Emit): Call Emit() on all our iterators.
4038         (TypeContainer.CloseType): Call CloseType() on all our iterators.
4039
4040         * codegen.cs (EmitContext.CurrentIterator): New public field.
4041
4042 2004-07-15  Martin Baulig  <martin@ximian.com>
4043
4044         * typemanager.cs
4045         (TypeManager.not_supported_exception_type): New type.   
4046
4047 2004-07-14  Martin Baulig  <martin@ximian.com>
4048
4049         * iterators.cs: Use real error numbers.
4050
4051 2004-07-14  Martin Baulig  <martin@ximian.com>
4052
4053         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
4054         requires this to be a System.Collection.IEnumerable and not a
4055         class implementing that interface.
4056         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
4057
4058 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
4059
4060         * class.cs: Fixed previous fix, it broke some error tests.
4061
4062 2004-07-12  Martin Baulig  <martin@ximian.com>
4063
4064         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
4065         Fixes #61293.
4066
4067 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
4068
4069         * assign.cs (LocalTemporary): Add new argument: is_address,If
4070         `is_address' is true, then the value that we store is the address
4071         to the real value, and not the value itself.
4072         
4073         * ecore.cs (PropertyExpr): use the new local temporary
4074         stuff to allow us to handle X.Y += z (where X is a struct)
4075
4076 2004-07-08  Martin Baulig  <martin@ximian.com>
4077
4078         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
4079         not always return, just like we're doing in Using.Resolve().
4080
4081 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
4082
4083         * cs-parser.jay (fixed_statement): flag this as Pinned.
4084
4085 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
4086
4087         * typemanager.cs (TypeManager): Removed MakePinned method, this
4088         mechanism is replaced with the .NET 2.x compatible mechanism of
4089         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
4090
4091         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
4092         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
4093         `IsFixed' property which has a different meaning.
4094
4095 2004-07-02  Raja R Harinath  <rharinath@novell.com>
4096
4097         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
4098         visible from inside a nested class, not just the names of the
4099         immediately enclosing class.
4100         Fix for bug #60730.
4101
4102 2004-06-24  Raja R Harinath  <rharinath@novell.com>
4103
4104         * expression.cs (BetterConversion): Remove buggy special-case
4105         handling of "implicit constant expression conversions".  At this
4106         point, we already know that the conversion is possible -- we're
4107         only checking to see which is better.
4108
4109 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4110
4111         * cs-parser.jay: Added error CS0210 test.
4112
4113 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4114
4115         * cs-parser.jay: Added error CS0134 test.
4116
4117 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4118
4119         Fix bug #52507
4120         * cs-parser.jay: Added error CS0145 test.
4121
4122 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4123
4124         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
4125
4126 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
4127         
4128         * expression.cs (StackAlloc.Resolve): The argument may not
4129         be a constant; deal with this case.
4130         
4131 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
4132
4133         * attribute.cs (IndexerName_GetIndexerName): Renamed to
4134         GetIndexerAttributeValue.
4135         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
4136
4137         * class.cs (Indexer.Define): Added error tests for CS0415,
4138         CS0609.
4139
4140 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
4141
4142         * attribute.cs (Attribute.Resolve): Keep field code in sync with
4143         property code.
4144
4145 2004-06-23  Martin Baulig  <martin@ximian.com>
4146
4147         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
4148         neither return nor throw, reset the barrier as well.  Fixes #60457.
4149
4150 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
4151
4152         * class.cs : EventAttributes is now set to None by default.
4153           This fixes bug #60459.
4154
4155 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4156
4157         Fix bug #60219
4158         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4159         Don't throw exception but return null (it's sufficient now).
4160
4161 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4162
4163         * typemanager.cs (GetArgumentTypes): Faster implementation.
4164
4165 2004-06-18  Martin Baulig  <martin@ximian.com>
4166
4167         * attribute.cs (Attribute.Resolve): Check whether we're an
4168         EmptyCast which a Constant child.  Fixes #60333.
4169
4170 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
4171
4172         * statement.cs (EmitCollectionForeach): Account for the fact that
4173         not all valuetypes are in areas which we can take the address of.
4174         For these variables, we store to a temporary variable. Also, make
4175         sure that we dont emit a `callvirt' on a valuetype method.
4176
4177 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4178
4179         * expression.cs (StackAlloc.DoReSolve): Added test for
4180         negative parameter (CS0247).
4181
4182 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4183
4184         Fix bug #59792
4185         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
4186
4187 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4188
4189         Fix bug #59781
4190         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
4191         ulong.
4192
4193 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4194
4195         Fix bug #58254 & cs1555.cs, cs1556.cs
4196         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
4197
4198 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4199
4200         * cs-parser.jay: Added error CS1669 test for indexers.
4201
4202 2004-06-11  Martin Baulig  <martin@ximian.com>
4203
4204         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
4205         call this twice: for params and varargs methods.
4206
4207 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4208
4209         * class.cs:
4210         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
4211
4212 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4213
4214         * attribute.cs (Attribute.GetValidTargets): Made public.
4215
4216         * class.cs: 
4217         (AbstractPropertyEventMethod): New class for better code sharing.
4218         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
4219         CS1667 report.
4220         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
4221
4222 2004-06-11  Raja R Harinath  <rharinath@novell.com>
4223
4224         Fix bug #59477.
4225         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
4226         that the call to Resolve is part of a MemberAccess.
4227         (Expression.Resolve): Use it for SimpleName resolution.
4228         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
4229         Add 'intermediate' boolean argument.
4230         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
4231         error message when the SimpleName can be resolved ambiguously
4232         between an expression and a type.
4233         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
4234         public.
4235         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
4236         call on the left-side.
4237
4238 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4239
4240         * class.cs:
4241         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
4242
4243 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4244
4245         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
4246
4247 2004-06-11  Martin Baulig  <martin@ximian.com>
4248
4249         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
4250         varargs methods if applicable.
4251
4252 2004-06-11  Martin Baulig  <martin@ximian.com>
4253
4254         * expression.cs (Invocation.EmitCall): Don't use
4255         `method.CallingConvention == CallingConventions.VarArgs' since the
4256         method could also have `CallingConventions.HasThis'.
4257
4258 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4259
4260         * class.cs (Event.GetSignatureForError): Implemented.
4261         Fixed crash in error test cs3010.cs
4262
4263 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
4264
4265         * cs-tokenizer.cs: Change the way we track __arglist to be
4266         consistent with the other keywords.
4267
4268 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
4269
4270         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
4271         tomorrow.
4272
4273 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
4274
4275         * codegen.cs: Check that all referenced assemblies have a strongname
4276         before strongnaming the compiled assembly. If not report error CS1577.
4277         Fix bug #56563. Patch by Jackson Harper.
4278         * typemanager.cs: Added a method to return all referenced assemblies.
4279         Fix bug #56563. Patch by Jackson Harper.
4280
4281 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
4282
4283         * class.cs:
4284         (Method.ApplyAttributeBuilder): Moved and added conditional
4285         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
4286
4287         * delegate.cs:
4288         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
4289
4290 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
4291
4292         Fixed #59640
4293         * class.cs: (EventField.attribute_targets): Changed default target.
4294
4295 2004-06-08  Martin Baulig  <martin@ximian.com>
4296
4297         * expression.cs (Invocation.EmitCall): Enable varargs methods.
4298
4299 2004-06-08  Martin Baulig  <martin@ximian.com>
4300
4301         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
4302
4303 2004-06-07  Martin Baulig  <martin@ximian.com>
4304
4305         Added support for varargs methods.
4306
4307         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
4308         keyword.
4309
4310         * cs-parser.jay: Added support for `__arglist'.
4311
4312         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
4313
4314         * expression.cs (Argument.AType): Added `ArgList'.
4315         (Invocation): Added support for varargs methods.
4316         (ArglistAccess): New public class.
4317         (Arglist): New public class.
4318
4319         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
4320
4321         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
4322         a method's top-level block if the method has varargs.
4323
4324         * support.cs (ReflectionParameters, InternalParameters): Added
4325         support for varargs methods.    
4326
4327 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
4328
4329         * class.cs: Provide location in indexer error report.
4330
4331         * driver.cs: Use standard names.
4332
4333         * namespace.cs: Catch the use of using after a namespace has been
4334         declared also on using aliases.
4335
4336 2004-06-03  Raja R Harinath  <rharinath@novell.com>
4337
4338         Bug #50820.
4339         * typemanager.cs (closure_private_ok, closure_invocation_type)
4340         (closure_qualifier_type, closure_invocation_assembly)
4341         (FilterWithClosure): Move to ...
4342         (Closure): New internal nested class.
4343         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
4344         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
4345         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
4346         (MemberLookup, MemberLookupFailed): Use it.
4347         * expression.cs (New.DoResolve): Treat the lookup for the
4348         constructor as being qualified by the 'new'ed type.
4349         (Indexers.GetIndexersForTypeOrInterface): Update.
4350
4351 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
4352
4353         * attribute.cs
4354         (GetConditionalAttributeValue): New method. Returns
4355         condition of ConditionalAttribute.
4356         (SearchMulti): New method.  Returns all attributes of type 't'.
4357         Use it when attribute is AllowMultiple = true.
4358         (IsConditionalMethodExcluded): New method.
4359
4360         * class.cs
4361         (Method.IsExcluded): Implemented. Returns true if method has conditional
4362         attribute and the conditions is not defined (method is excluded).
4363         (IMethodData): Extended interface for ConditionalAttribute support.
4364         (PropertyMethod.IsExcluded): Implemented.
4365
4366         * decl.cs
4367         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
4368
4369         * expression.cs
4370         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
4371         on the method.
4372
4373 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4374
4375         * expression.cs (ArrayCreationExpression): Make this just an
4376         `expression'. It can't be a statement, so the code here was
4377         dead.
4378
4379 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
4380
4381         Fixed #59072
4382         * typemanager.cs (GetFullNameSignature): New method for
4383         MethodBase types.
4384
4385 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
4386
4387         Fixed #56452
4388         * class.cs (MemberBase.GetSignatureForError): New virtual method.
4389         Use this method when MethodBuilder is null.
4390         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
4391         Added test for error CS0626 (MONO reports error for this situation).
4392         (IMethodData.GetSignatureForError): Extended interface.
4393
4394 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4395
4396         * attribute.cs
4397         (AttributeTester.GetObsoleteAttribute): Returns instance of
4398         ObsoleteAttribute when type is obsolete.
4399
4400         * class.cs
4401         (TypeContainer.VerifyObsoleteAttribute): Override.
4402         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4403         (MethodCode.VerifyObsoleteAttribute): Override.
4404         (MemberBase.VerifyObsoleteAttribute): Override.
4405
4406         * decl.cs
4407         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4408         and report proper error.
4409
4410         *delegate.cs
4411         Delegate.VerifyObsoleteAttribute): Override.
4412
4413         * ecore.cs
4414         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4415         and report proper error.
4416         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4417
4418         * enum.cs
4419         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4420         and enum member.
4421
4422         * expression.cs
4423         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4424         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4425         Added test for ObsoleteAttribute.
4426
4427         * statement.cs
4428         (Catch): Derived from Statement.
4429
4430 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4431  
4432         Fixed bug #59071 & cs0160.cs
4433  
4434         * statement.cs (Try.Resolve): Check here whether order of catch
4435         clauses matches their dependencies.
4436
4437 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
4438
4439         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
4440         caused a regression: #59343.  Referencing nested classes from an
4441         assembly stopped working.
4442
4443 2004-05-31  Martin Baulig  <martin@ximian.com>
4444
4445         MCS is now frozen for beta 2.
4446
4447 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4448
4449         * convert.cs: add a trivial cache for overload operator resolution.
4450
4451 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4452
4453         * decl.cs: If possible, use lookuptypedirect here. We can only do
4454         this if there is no `.' after the namespace. Avoids using
4455         LookupType, which does lots of slow processing.
4456         (FindNestedType) New method, does what it says :-).
4457         * namespace.cs: use LookupTypeDirect.
4458         * rootcontext.cs: use membercache, if possible.
4459         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4460
4461 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4462
4463         * expression.cs:
4464         According to the spec, 
4465
4466         In a member access of the form E.I, if E is a single identifier,
4467         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4468         field, property, localvariable, or parameter with the same type as
4469         the meaning of E as a type-name (§3.8), then both possible
4470         meanings of E are permitted.
4471
4472         We did not check that E as a simple-name had the same type as E as
4473         a type name.
4474
4475         This trivial check gives us 5-7% on bootstrap time.
4476
4477 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4478
4479         * expression.cs (Invocation.OverloadResolve): Avoid the
4480         use of hashtables and boxing here by allocating on demand.
4481
4482 2004-05-30  Martin Baulig  <martin@ximian.com>
4483
4484         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4485         we're doing a silent lookup.  Don't try to lookup nested types in
4486         TypeManager.object_type (thanks to Ben Maurer).
4487
4488 2004-05-30  Martin Baulig  <martin@ximian.com>
4489
4490         Committing a patch from Ben Maurer.
4491
4492         * rootcontext.cs (RootContext.LookupType): Cache negative results.
4493
4494 2004-05-29  Martin Baulig  <martin@ximian.com>
4495
4496         * class.cs (IMethodData.ShouldIgnore): New method.
4497
4498         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4499         `Location' argument, we don't need it anywhere.  Use
4500         `IMethodData.ShouldIgnore ()' instead of
4501         `MethodData.GetMethodFlags ()'.
4502         (TypeManager.AddMethod): Removed.
4503         (TypeManager.AddMethod2): Renamed to AddMethod.
4504
4505 2004-05-29  Martin Baulig  <martin@ximian.com>
4506
4507         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4508
4509         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4510         converting from a class type S to an interface type and we already
4511         have an object on the stack, don't box it again.  Fixes #52578.
4512
4513 2004-05-29  Martin Baulig  <martin@ximian.com>
4514
4515         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4516         Added support for `params' parameters.  Fixes #59267.
4517
4518 2004-05-29  Martin Baulig  <martin@ximian.com>
4519
4520         * literal.cs (NullPointer): Provide a private .ctor which sets
4521         `type' to TypeManager.object_type.  Fixes #59048.
4522
4523 2004-05-29  Martin Baulig  <martin@ximian.com>
4524
4525         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4526         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4527
4528         * ecore.cs (EventExpr.instance_expr): Make the field private.
4529
4530 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4531
4532         Fixed bug #50080 & cs0214-2.cs
4533         * expression.cs (Cast.DoResolve): Check unsafe context here.
4534         
4535         * statement.cs (Resolve.DoResolve): Likewise.
4536
4537 2004-05-26  Martin Baulig  <martin@ximian.com>
4538
4539         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4540
4541         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4542         (RootContext.LookupType): Pass down the `silent' flag.
4543
4544 2004-05-25  Martin Baulig  <martin@ximian.com>
4545
4546         * expression.cs
4547         (MethodGroupExpr.IdenticalTypeName): New public property.
4548         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4549         expression actually refers to a type.
4550
4551 2004-05-25  Martin Baulig  <martin@ximian.com>
4552
4553         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4554         for #56176 and made it actually work.
4555
4556 2004-05-25  Martin Baulig  <martin@ximian.com>
4557
4558         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4559         (FieldExpr, PropertyExpr): Override and implement
4560         CacheTemporaries.  Fixes #52279.
4561
4562 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4563
4564         * location.cs: In the new compiler listing a file twice is a
4565         warning, not an error.
4566
4567 2004-05-24  Martin Baulig  <martin@ximian.com>
4568
4569         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4570         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4571
4572 2004-05-24  Martin Baulig  <martin@ximian.com>
4573
4574         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4575         walking the `using' list.  Fixes #53921.
4576
4577 2004-05-24  Martin Baulig  <martin@ximian.com>
4578
4579         * const.cs (Const.LookupConstantValue): Added support for
4580         EmptyCast's; fixes #55251.
4581
4582 2004-05-24  Martin Baulig  <martin@ximian.com>
4583
4584         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4585         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4586         which does the CS0135 check.  The reason is that we first need to
4587         check whether the variable actually exists.
4588
4589 2004-05-24  Martin Baulig  <martin@ximian.com>
4590
4591         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4592         than RootContext.LookupType() to find the explicit interface
4593         type.  Fixes #58584.
4594
4595 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4596
4597         * Makefile: Simplify.  Use executable.make.
4598         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4599
4600 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4601
4602         * decl.cs:
4603         * enum.cs:
4604         Use the invariant culture when doing String.Compare for CLS case
4605         sensitivity.
4606         
4607 2004-05-23  Martin Baulig  <martin@ximian.com>
4608
4609         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4610         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4611
4612         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4613         
4614 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4615
4616         * class.cs (MemberBase.Define): Reuse MemberType member for 
4617         resolved type. Other methods can use it too.
4618
4619 2004-05-23  Martin Baulig  <martin@ximian.com>
4620
4621         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4622         the variable also exists in the current block (otherwise, we need
4623         to report a CS0103).  Fixes #58670.
4624
4625 2004-05-23  Martin Baulig  <martin@ximian.com>
4626
4627         * flowanalysis.cs (Reachability.Reachable): Compute this
4628         on-the-fly rather than storing it as a field.
4629
4630 2004-05-23  Martin Baulig  <martin@ximian.com>
4631
4632         * flowanalysis.cs (Reachability.And): Manually compute the
4633         resulting `barrier' from the reachability.      
4634        
4635 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4636
4637         Fix bug #57835
4638         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4639         instance of ObsoleteAttribute when symbol is obsolete.
4640
4641         * class.cs
4642         (IMethodData): Extended interface for ObsoleteAttribute support.
4643
4644 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4645
4646         * attribute.cs: Fix bug #55970
4647
4648 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4649
4650         Fix bug #52705
4651         * attribute.cs
4652         (GetObsoleteAttribute): New method. Creates the instance of
4653         ObsoleteAttribute.
4654         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4655         ObsoleteAttribute when member is obsolete.
4656         (AttributeTester.Report_ObsoleteMessage): Common method for
4657         Obsolete error/warning reporting.
4658
4659         * class.cs
4660         (TypeContainer.base_classs_type): New member for storing parent type.
4661
4662         * decl.cs
4663         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4664         for this MemberCore.
4665
4666 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4667
4668         * attribute.cs, const.cs: Fix bug #58590
4669
4670 2004-05-21  Martin Baulig  <martin@ximian.com>
4671
4672         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4673         out parameters if the end of the method is unreachable.  Fixes
4674         #58098. 
4675
4676 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4677
4678         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4679         Hari was right, why extra method.
4680
4681 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4682
4683         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4684
4685 2004-05-20  Martin Baulig  <martin@ximian.com>
4686
4687         Merged this back from gmcs to keep the differences to a minumum.
4688
4689         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
4690         instead of a Declspace.
4691         (Attribute.ResolveType): Likewise.
4692         (Attributes.Search): Likewise.
4693         (Attributes.Contains): Likewise.
4694         (Attributes.GetClsCompliantAttribute): Likewise.
4695
4696         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
4697         argument.
4698         (MethodData.ApplyAttributes): Take an EmitContext instead of a
4699         DeclSpace.
4700
4701 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4702
4703         Fix bug #58688 (MCS does not report error when the same attribute
4704         is assigned twice)
4705
4706         * attribute.cs (Attribute.Emit): Distinction between null and default.
4707
4708 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4709
4710         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4711         of a top-level attribute without an attribute target.
4712         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4713         Make non-static.
4714         (Attribute.Conditional_GetConditionName), 
4715         (Attribute.Obsolete_GetObsoleteMessage): Update.
4716         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4717         part of ScanForIndexerName.
4718         (Attribute.CanIgnoreInvalidAttribute): New function.
4719         (Attribute.ScanForIndexerName): Move to ...
4720         (Attributes.ScanForIndexerName): ... here.
4721         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4722         (Attributes.Search): New internal variant that can choose not to
4723         complain if types aren't resolved.  The original signature now
4724         complains.
4725         (Attributes.GetClsCompliantAttribute): Use internal variant, with
4726         complaints suppressed.
4727         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4728         only if it not useful.
4729         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4730         top-level for attributes that are shared between the assembly
4731         and a top-level class.
4732         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4733         * class.cs: Update to reflect changes.
4734         (DefineIndexers): Fuse loops.
4735         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4736         a couple more variants of attribute names.
4737
4738 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4739
4740         Fix bug #52585 (Implemented explicit attribute declaration)
4741
4742         * attribute.cs:
4743         (Attributable.ValidAttributeTargets): New abstract method. It gets
4744         list of valid attribute targets for explicit target declaration.
4745         (Attribute.Target): It holds target itself.
4746         (AttributeSection): Removed.
4747         (Attribute.CheckTargets): New method. It checks whether attribute
4748         target is valid for the current element.
4749
4750         * class.cs:
4751         (EventProperty): New class. For events that are declared like
4752         property (with add and remove accessors).
4753         (EventField): New class. For events that are declared like field.
4754         class.cs
4755
4756         * cs-parser.jay: Implemented explicit attribute target declaration.
4757
4758         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4759         Override ValidAttributeTargets.
4760
4761         * parameter.cs:
4762         (ReturnParameter): Class for applying custom attributes on 
4763         the return type.
4764         (ParameterAtribute): New class. Class for applying custom
4765         attributes on the parameter type.
4766
4767 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4768
4769         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4770         definitions. 
4771
4772         (Method): Allow UNSAFE here.
4773
4774         * modifiers.cs: Support unsafe reporting.
4775
4776 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4777
4778         * decl.cs: Fix bug #58478.
4779
4780 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4781
4782         * statement.cs: When checking for unreachable code on an EmptyStatement,
4783         set the location. Fixes bug #58488.
4784
4785 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4786
4787         * driver.cs: Add -pkg handling.
4788
4789         From Gonzalo: UseShelLExecute=false
4790
4791 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4792
4793         * attribute.cs:
4794         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4795         for attribute.
4796         (Attribute.IsClsCompliaceRequired): Moved to base for better
4797         accesibility.
4798         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4799         when attribute is AttributeUsageAttribute.
4800         (Attribute.GetValidTargets): Simplified.
4801         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4802         attribute for this type.
4803         (Attribute.ApplyAttributes): Method renamed to Emit and make
4804         non-static.
4805         (GlobalAttributeSection): New class for special handling of global
4806         attributes (assembly, module).
4807         (AttributeSection.Emit): New method.
4808
4809         * class.cs: Implemented Attributable abstract methods.
4810         (MethodCore.LabelParameters): Moved to Parameter class.
4811         (Accessor): Is back simple class.
4812         (PropertyMethod): Implemented Attributable abstract class.
4813         (DelegateMethod): Implemented Attributable abstract class.
4814         (Event): New constructor for disctintion between normal Event
4815         and Event with accessors.
4816
4817         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4818
4819         * codegen.cs, const.cs, decl.cs, delegate.cs:
4820         (CommonAssemblyModulClass): Implemented Attributable abstract class
4821         and simplified.
4822
4823         * enum.cs: Implement IAttributeSupport interface.
4824         (EnumMember): New class for emum members. Implemented Attributable
4825         abstract class
4826
4827         * parameter.cs:
4828         (ParameterBase): Is abstract.
4829         (ReturnParameter): New class for easier [return:] attribute handling.
4830
4831         * typemanager.cs: Removed builder_to_attr.
4832
4833 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4834
4835         Fix bug #57151.
4836         * attribute.cs (Attribute.GetPositionalValue): New function.
4837         * class.cs (TypeContainer.VerifyMembers): New function.
4838         (TypeContainer.Emit): Use it.
4839         (ClassOrStruct): New base class for Class and Struct.
4840         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4841         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4842         class.
4843         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4844         then each non-static field should have a FieldOffset attribute.
4845         Otherwise, none of the fields should have a FieldOffset attribute.
4846         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4847         and FieldOffset attributes.
4848         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4849         (TypeManager.field_offset_attribute_type): New core types.
4850         (TypeManager.InitCoreTypes): Initialize them.
4851
4852 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4853
4854         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4855         Return correct type.
4856         From bug #58270.
4857
4858 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4859
4860         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4861         be implicitly converted to ulong.
4862         
4863         * expression.cs: The logic for allowing operator &, | and ^ worked
4864         was wrong, it worked before because we did not report an error in
4865         an else branch.  Fixes 57895.
4866
4867         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4868         allow volatile fields to be reference types.
4869
4870 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4871
4872         * driver.cs: Add support for /debug-
4873
4874 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4875
4876         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4877         Add a 'complain' parameter to silence errors.
4878         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4879         silently overlooked type-resolutions.
4880         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4881         to reflect changes.
4882         (Attributes.Search): New function.
4883         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4884         (Attributes.GetAttributeFullName): Remove hack.
4885         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4886         Update to reflect changes.
4887         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4888         Use Attributes.Search instead of nested loops.
4889
4890 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4891
4892         * decl.cs:
4893         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4894         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4895         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4896
4897         * report.cs: (Report.Warning): Renamed to Warning_T because of
4898         parameter collision.
4899
4900 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4901
4902         * expression.cs (MemberAccess.ResolveMemberAccess):
4903         Exit with non-zero status after Report.Error.
4904         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4905         Likewise.
4906         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4907
4908 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4909
4910         * support.cs: Don't hang when the file is empty.
4911
4912 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4913
4914         * support.cs: In SeekableStreamReader, compute the preamble size of the
4915           underlying stream. Position changes should take into account that initial
4916           count of bytes.
4917
4918 2004-05-03  Todd Berman  <tberman@sevenl.net>
4919
4920         * driver.cs: remove unused GetSysVersion function.
4921
4922 2004-05-03  Todd Berman  <tberman@sevenl.net>
4923
4924         * driver.cs: Remove the hack from saturday, as well as the hack
4925         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4926         link_paths to get that bit proper.
4927
4928 2004-05-01  Todd Berman  <tberman@sevenl.net>
4929
4930         * driver.cs: Try a LoadFrom before a Load, this checks the current
4931         path. This is currently a bug in mono that is be fixed, however, this
4932         provides a workaround for now. This will be removed when the bug
4933         is fixed.
4934
4935 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4936
4937         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4938         incomplete key pairs (#57941).
4939
4940 2004-05-01  Todd Berman  <tberman@sevenl.net>
4941
4942         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4943         from the GAC
4944
4945 2004-04-30  Jackson Harper  <jackson@ximian.com>
4946
4947         * codegen.cs: Open keys readonly.
4948         
4949 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4950
4951         * typemanager.cs: don't report cyclic struct layout when a struct
4952         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4953         which has 2 Pango.Rectangle fields.
4954
4955 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4956
4957         * expression.cs: Handle IntPtr comparisons with IL code
4958         rather than a method call.
4959
4960 2004-04-29  Martin Baulig  <martin@ximian.com>
4961
4962         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4963         the list of PropertyInfo's in class hierarchy and find the
4964         accessor.  Fixes #56013.
4965
4966 2004-04-29  Martin Baulig  <martin@ximian.com>
4967
4968         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4969
4970 2004-04-29  Martin Baulig  <martin@ximian.com>
4971
4972         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4973
4974         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4975
4976 2004-04-29  Martin Baulig  <martin@ximian.com>
4977
4978         * class.cs (ConstructorInitializer.Resolve): Check whether the
4979         parent .ctor is accessible.  Fixes #52146.
4980
4981 2004-04-29  Martin Baulig  <martin@ximian.com>
4982
4983         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4984
4985         * statement.cs (Using.EmitLocalVariableDecls): Use
4986         TypeManager.idisposable_type, not typeof (IDisposable).
4987         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4988
4989 2004-04-29  Martin Baulig  <martin@ximian.com>
4990
4991         * class.cs (Event.Define): Don't emit the field and don't set
4992         RTSpecialName and SpecialName for events on interfaces.  Fixes
4993         #57703. 
4994
4995 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4996
4997         Refactor Attribute.ApplyAttributes.
4998         * attribute.cs (Attributable): New base class for objects that can
4999         have Attributes applied on them.
5000         (Attribute): Make AttributeUsage fields public.
5001         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
5002         (Attribute.IsInternalCall): New property.
5003         (Attribute.UsageAttr): Convert to a public read-only property.
5004         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
5005         (Attribute.ResolveType, Attribute.Resolve)
5006         (Attribute.ScanForIndexerName): Update to reflect changes.
5007         (Attribute.CheckAttributeTarget): Re-format.
5008         (Attribute.ApplyAttributes): Refactor, to various
5009         Attributable.ApplyAttributeBuilder methods.
5010         * decl.cs (MemberCore): Make Attributable.
5011         * class.cs (Accessor): Make Attributable.
5012         (MethodData.ApplyAttributes): Use proper attribute types, not
5013         attribute names.
5014         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
5015         (TypeContainer.ApplyAttributeBuilder)
5016         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
5017         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
5018         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
5019         (Operator.ApplyAttributeBuilder): New factored-out methods.
5020         * const.cs (Const.ApplyAttributeBuilder): Likewise.
5021         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
5022         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
5023         * parameter.cs (ParameterBase): New Attributable base class
5024         that can also represent Return types.
5025         (Parameter): Update to the changes.
5026
5027 2004-04-29  Jackson Harper  <jackson@ximian.com>
5028
5029         * driver.cs: Prefer the corlib system version when looking for
5030         assemblies in the GAC. This is still a hack, but its a better hack
5031         now.
5032         
5033 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
5034
5035         * decl.cs, enum.cs: Improved error 3005 reporting.
5036   
5037         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
5038         (related_symbols): New private member for list of symbols
5039         related to reported error/warning.
5040         
5041         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
5042
5043 2004-04-29  Martin Baulig  <martin@ximian.com>
5044
5045         * ecore.cs (Expression.Constantify): If we're an enum and
5046         TypeManager.TypeToCoreType() doesn't give us another type, use
5047         t.UnderlyingSystemType.  Fixes #56178.  
5048
5049 2004-04-29  Martin Baulig  <martin@ximian.com>
5050
5051         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
5052         interfaces and for each interface, only add members directly
5053         declared in that interface.  Fixes #53255.
5054
5055 2004-04-28  Martin Baulig  <martin@ximian.com>
5056
5057         * expression.cs (ConditionalLogicalOperator): Use a temporary
5058         variable for `left' to avoid that we evaluate it more than once;
5059         bug #52588.
5060
5061 2004-04-28  Martin Baulig  <martin@ximian.com>
5062
5063         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
5064         `void[]' (CS1547).
5065
5066 2004-04-28  Martin Baulig  <martin@ximian.com>
5067
5068         * statement.cs (LocalInfo.Resolve): Check whether the type is not
5069         void (CS1547).
5070
5071         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
5072         whether the type is not void (CS1547).
5073
5074 2004-04-28  Martin Baulig  <martin@ximian.com>
5075
5076         * expression.cs (Unary.DoResolveLValue): Override this and report
5077         CS0131 for anything but Operator.Indirection.
5078
5079 2004-04-28  Martin Baulig  <martin@ximian.com>
5080
5081         Committing a patch from Ben Maurer; see bug #50820.
5082
5083         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5084         check for classes.
5085
5086         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5087         classes.        
5088
5089 2004-04-28  Martin Baulig  <martin@ximian.com>
5090
5091         Committing a patch from Ben Maurer; see bug #50820.
5092
5093         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5094         check for classes.
5095
5096         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5097         classes.        
5098
5099 2004-04-28  Martin Baulig  <martin@ximian.com>
5100
5101         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
5102         (Block.AddLabel): Call DoLookupLabel() to only search in the
5103         current block.
5104
5105 2004-04-28  Martin Baulig  <martin@ximian.com>
5106
5107         * cfold.cs (ConstantFold.BinaryFold): Added special support for
5108         comparing StringConstants and NullLiterals in Equality and Inequality.
5109
5110 2004-04-28  Jackson Harper  <jackson@ximian.com>
5111
5112         * driver.cs: Attempt to load referenced assemblies from the
5113         GAC. This is the quick and dirty version of this method that
5114         doesnt take into account versions and just takes the first
5115         canidate found. Will be good enough for now as we will not have more
5116         then one version installed into the GAC until I update this method.
5117
5118 2004-04-28  Martin Baulig  <martin@ximian.com>
5119
5120         * typemanager.cs (TypeManager.CheckStructCycles): New public
5121         static method to check for cycles in the struct layout.
5122
5123         * rootcontext.cs (RootContext.PopulateTypes): Call
5124         TypeManager.CheckStructCycles() for each TypeContainer.
5125         [Note: We only need to visit each type once.]
5126
5127 2004-04-28  Martin Baulig  <martin@ximian.com>
5128
5129         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
5130
5131         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
5132         success and added `out object value'.  Use a `bool resolved' field
5133         to check whether we've already been called rather than
5134         `ConstantValue != null' since this breaks for NullLiterals.
5135
5136 2004-04-28  Raja R Harinath  <rharinath@novell.com>
5137
5138         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
5139         setting of this flag, since the 'set' method may be non-public.
5140
5141 2004-04-28  Raja R Harinath  <rharinath@novell.com>
5142
5143         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
5144         check on current_vector.Block.
5145
5146 2004-04-27  Martin Baulig  <martin@ximian.com>
5147
5148         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
5149         a field initializer.  Fixes #56459.
5150
5151 2004-04-27  Martin Baulig  <martin@ximian.com>
5152
5153         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
5154         we're not attempting to use an indexer.  Fixes #52154.
5155
5156 2004-04-27  Martin Baulig  <martin@ximian.com>
5157
5158         * statement.cs (Return): Don't create a return label if we don't
5159         need it; reverts my change from January 20th.  Thanks to Ben
5160         Maurer for this.
5161
5162 2004-04-27  Martin Baulig  <martin@ximian.com>
5163
5164         According to the spec, `goto' can only leave a nested scope, but
5165         never enter it.
5166
5167         * statement.cs (Block.LookupLabel): Only lookup in the current
5168         block, don't recurse into parent or child blocks.
5169         (Block.AddLabel): Check in parent and child blocks, report
5170         CS0140/CS0158 if we find a duplicate.
5171         (Block): Removed this indexer for label lookups.
5172         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
5173         this already does the error reporting for us.
5174
5175         * flowanalysis.cs
5176         (FlowBranching.UsageVector.Block): New public variable; may be null.
5177         (FlowBranching.CreateSibling): Added `Block' argument.
5178         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
5179         label for the target of a `goto' and check whether we're not
5180         leaving a `finally'.
5181
5182 2004-04-27  Martin Baulig  <martin@ximian.com>
5183
5184         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5185         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
5186         just for returns).
5187
5188 2004-04-27  Martin Baulig  <martin@ximian.com>
5189
5190         * statement.cs (Block.AddLabel): Also check for implicit blocks
5191         and added a CS0158 check.
5192
5193 2004-04-27  Martin Baulig  <martin@ximian.com>
5194
5195         * flowanalysis.cs (FlowBranchingLoop): New class.
5196         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
5197         UsageVector's instead of an ArrayList.
5198         (FlowBranching.Label): Likewise.
5199         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
5200         (FlowBranching.AddBreakVector): New method.
5201
5202 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
5203
5204         * attribute.cs: Small regression fix: only convert the type if we
5205         the type is different, fixes System.Drawing build.
5206
5207 2004-04-27  Martin Baulig  <martin@ximian.com>
5208
5209         * attribute.cs (Attribute.Resolve): If we have a constant value
5210         for a named field or property, implicity convert it to the correct
5211         type.
5212
5213 2004-04-27  Raja R Harinath  <rharinath@novell.com>
5214
5215         * statement.cs (Block.Block): Implicit blocks share
5216         'child_variable_names' fields with parent blocks.
5217         (Block.AddChildVariableNames): Remove.
5218         (Block.AddVariable): Mark variable as "used by a child block" in
5219         every surrounding block.
5220         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
5221         been used in a child block, complain about violation of "Invariant
5222         meaning in blocks" rule.
5223         * cs-parser.jay (declare_local_variables): Don't use
5224         AddChildVariableNames.
5225         (foreach_statement): Don't create an implicit block: 'foreach'
5226         introduces a scope.
5227
5228 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
5229
5230         * convert.cs (ImplicitNumericConversion): 0 is also positive when
5231         converting from 0L to ulong.  Fixes 57522.
5232
5233 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5234
5235         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
5236         derived class hides via 'new' keyword field from base class (test-242.cs).
5237         TODO: Handle this in the more general way.
5238         
5239         * class.cs (CheckBase): Ditto.
5240
5241 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5242
5243         * decl.cs (caching_flags): New member for storing cached values
5244         as bit flags.
5245         (MemberCore.Flags): New enum where bit flags for caching_flags
5246         are defined.
5247         (MemberCore.cls_compliance): Moved to caching_flags.
5248         (DeclSpace.Created): Moved to caching_flags.
5249
5250         * class.cs: Use caching_flags instead of DeclSpace.Created
5251         
5252 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
5253
5254         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
5255         if we are only a derived class, not a nested class.
5256
5257         * typemanager.cs: Same as above, but do this at the MemberLookup
5258         level (used by field and methods, properties are handled in
5259         PropertyExpr).   Allow for the qualified access if we are a nested
5260         method. 
5261
5262 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
5263
5264         * class.cs: Refactoring.
5265         (IMethodData): New inteface; Holds links to parent members
5266         to avoid member duplication (reduced memory allocation).
5267         (Method): Implemented IMethodData interface.
5268         (PropertyBase): New inner classes for get/set methods.
5269         (PropertyBase.PropertyMethod): Implemented IMethodData interface
5270         (Event): New inner classes for add/remove methods.
5271         (Event.DelegateMethod): Implemented IMethodData interface.
5272
5273         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
5274         EmitContext (related to class.cs refactoring).
5275
5276 2004-04-21  Raja R Harinath  <rharinath@novell.com>
5277
5278         * delegate.cs (Delegate.VerifyApplicability): If the number of
5279         arguments are the same as the number of parameters, first try to
5280         verify applicability ignoring  any 'params' modifier on the last
5281         parameter.
5282         Fixes #56442.
5283
5284 2004-04-16  Raja R Harinath  <rharinath@novell.com>
5285
5286         * class.cs (TypeContainer.AddIndexer): Use
5287         'ExplicitInterfaceName' to determine if interface name was
5288         explicitly specified.  'InterfaceType' is not initialized at this time.
5289         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
5290         Indexers array is already in the required order.  Initialize
5291         'IndexerName' only if there are normal indexers.
5292         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
5293         (TypeContainer.Emit): Emit DefaultMember attribute only if
5294         IndexerName is initialized.
5295         Fixes #56300.
5296
5297 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
5298
5299         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
5300         Fixes #57007
5301
5302 2004-04-15  Raja R Harinath  <rharinath@novell.com>
5303
5304         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
5305         attributes.
5306         Fix for #56456.
5307
5308         * attribute.cs (Attribute.Resolve): Check for duplicate named
5309         attributes.
5310         Fix for #56463.
5311
5312 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
5313
5314         * iterators.cs (MarkYield): track whether we are in an exception,
5315         and generate code accordingly.  Use a temporary value to store the
5316         result for our state.
5317
5318         I had ignored a bit the interaction of try/catch with iterators
5319         since their behavior was not entirely obvious, but now it is
5320         possible to verify that our behavior is the same as MS .NET 2.0
5321
5322         Fixes 54814
5323
5324 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
5325
5326         * iterators.cs: Avoid creating temporaries if there is no work to
5327         do. 
5328
5329         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
5330         Enumerations, use TypeManager.EnumToUnderlying and call
5331         recursively. 
5332
5333         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
5334         bug #57013
5335
5336         (This.Emit): Use EmitContext.EmitThis to emit our
5337         instance variable.
5338
5339         (This.EmitAssign): Ditto.
5340
5341         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
5342         codepaths, we will move all the functionality into
5343         Mono.CSharp.This 
5344
5345         (FieldExpr.EmitAssign): Ditto.
5346
5347         This fixes several hidden bugs that I uncovered while doing a code
5348         review of this today.
5349
5350         * codegen.cs (EmitThis): reworked so the semantics are more clear
5351         and also support value types "this" instances.
5352
5353         * iterators.cs: Changed so that for iterators in value types, we
5354         do not pass the value type as a parameter.  
5355
5356         Initialization of the enumerator helpers is now done in the caller
5357         instead of passing the parameters to the constructors and having
5358         the constructor set the fields.
5359
5360         The fields have now `assembly' visibility instead of private.
5361
5362 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
5363
5364         * expression.cs (Argument.Resolve): Check if fields passed as ref
5365         or out are contained in a MarshalByRefObject.
5366
5367         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
5368         another compiler type.
5369
5370 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5371
5372         * class.cs (Indexer.Define): use the new name checking method.
5373         Also, return false on an error.
5374         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
5375         (is_identifier_[start/part]_character): make static.
5376
5377 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
5378
5379         * expression.cs (Binary.ResolveOperator): Do no append strings
5380         twice: since we can be invoked more than once (array evaluation)
5381         on the same concatenation, take care of this here.  Based on a fix
5382         from Ben (bug #56454)
5383
5384 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5385
5386         * codegen.cs: Fix another case where CS1548 must be reported (when 
5387         delay-sign isn't specified and no private is available #56564). Fix
5388         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
5389         error when MCS is used on the MS runtime and we need to delay-sign 
5390         (which seems unsupported by AssemblyBuilder - see #56621).
5391
5392 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
5393
5394         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
5395         (TypeManager.ComputeNamespaces): Faster implementation for
5396         Microsoft runtime.
5397
5398         * compiler.csproj: Updated AssemblyName to mcs.
5399
5400 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5401
5402         * rootcontext.cs: Add new types to the boot resolution.
5403
5404         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5405         MulticastDelegate is not allowed.
5406
5407         * typemanager.cs: Add new types to lookup: System.TypedReference
5408         and ArgIterator.
5409
5410         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5411         check for TypedReference or ArgIterator, they are not allowed. 
5412
5413         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5414         makes us properly catch 1510 in some conditions (see bug 56016 for
5415         details). 
5416
5417 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5418
5419         * CryptoConvert.cs: update from corlib version
5420         with endian fixes.
5421
5422 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5423
5424         * class.cs (Indexer.Define): Check indexername declaration
5425
5426 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5427
5428         * attribute.cs (IsClsCompliant): Fixed problem with handling
5429         all three states (compliant, not-compliant, undetected).
5430
5431 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5432
5433         * attribute.cs (Attribute): Location is now public.
5434         (Resolve): Store resolved arguments (pos_values) in attribute class.
5435         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5436         (GetClsCompliantAttributeValue): New method that gets
5437         CLSCompliantAttribute value.
5438         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5439         if exists else null.
5440         (AttributeTester): New class for CLS-Compliant verification routines.
5441
5442         * class.cs (Emit): Add CLS-Compliant verification.
5443         (Method.GetSignatureForError): Implemented.
5444         (Constructor.GetSignatureForError): Implemented
5445         (Constructor.HasCompliantArgs): Returns if constructor has
5446         CLS-Compliant arguments.
5447         (Constructor.Emit): Override.
5448         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5449         is needed to test only parameters.
5450         (FieldBase.GetSignatureForError): Implemented.
5451         (TypeContainer): New member for storing base interfaces.
5452         (TypeContainer.FindMembers): Search in base interfaces too.
5453
5454         * codegen.cs (GetClsComplianceAttribute): New method that gets
5455         assembly or module CLSCompliantAttribute value.
5456         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5457         for assembly.
5458         (ModuleClass.Emit): Add error 3012 test.
5459
5460         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5461
5462         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5463         state for all decl types.
5464         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5465         if CLS-Compliant tests are required.
5466         (IsClsCompliaceRequired): New method. Analyze whether code
5467         must be CLS-Compliant.
5468         (IsExposedFromAssembly): New method. Returns true when MemberCore
5469         is exposed from assembly.
5470         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5471         value or gets cached value.
5472         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5473         is explicitly marked with CLSCompliantAttribute.
5474         (IsIdentifierClsCompliant): New abstract method. This method is
5475         used to testing error 3005.
5476         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5477         for identifier and parameters CLS-Compliant testing.
5478         (VerifyClsCompliance): New method. The main virtual method for
5479         CLS-Compliant verifications.
5480         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5481         null. I don't know why is null (too many public members !).
5482         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5483         and get value of first CLSCompliantAttribute that found.
5484
5485         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5486         (VerifyClsCompliance): Override and add extra tests.
5487
5488         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5489         clscheck- disable CLS-Compliant verification event if assembly is has
5490         CLSCompliantAttribute(true).
5491
5492         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5493         ApllyAttribute is now called in emit section as in the other cases.
5494         Possible future Emit integration.
5495         (IsIdentifierClsCompliant): New override.
5496         (VerifyClsCompliance): New override.
5497         (GetEnumeratorName): Returns full enum name.
5498
5499         * parameter.cs (GetSignatureForError): Implemented.
5500
5501         * report.cs (WarningData): New struct for Warning message information.
5502         (LocationOfPreviousError): New method.
5503         (Warning): New method. Reports warning based on the warning table.
5504         (Error_T): New method. Reports error based on the error table.
5505
5506         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5507         verifications are done here.
5508
5509         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5510
5511         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5512         CLSCompliantAttribute.
5513         (all_imported_types): New member holds all imported types from other
5514         assemblies.
5515         (LoadAllImportedTypes): New method fills static table with exported types
5516         from all referenced assemblies.
5517         (Modules): New property returns all assembly modules.
5518
5519 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5520
5521         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5522         throwing a parser error.
5523
5524         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5525         which removes the hardcoded get_/set_ prefixes for properties, as
5526         IL allows for the properties to be named something else.  
5527
5528         Bug #56013
5529
5530         * expression.cs: Do not override operand before we know if it is
5531         non-null.  Fix 56207
5532
5533 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5534
5535         * typemanager.cs: support for pinned variables.
5536
5537 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5538
5539         * decl.cs, typemanager.cs: Avoid using an arraylist
5540         as a buffer if there is only one result set.
5541
5542 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5543
5544         * expression.cs: Make sure you cant call a static method
5545         with an instance expression, bug #56174.
5546
5547 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5548
5549         * class.cs (IsDuplicateImplementation): Improve error reporting to
5550         flag 663 (method only differs in parameter modifier).
5551
5552         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5553         in preprocessor directives.
5554
5555         * location.cs (LookupFile): Allow for the empty path.
5556
5557         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5558         better approach for some of that patch, but its failing with the
5559         CharSet enumeration.  For now try/catch will do.
5560
5561         * typemanager.cs: Do not crash if a struct does not have fields.
5562         Fixes 56150.
5563
5564 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5565
5566         * expression.cs: cs0213, cant fix a fixed expression.
5567         fixes 50231.
5568
5569 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5570
5571         * cs-parser.jay: detect invalid embeded statements gracefully.
5572         bug #51113.
5573
5574 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5575
5576         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5577         As a regex:
5578         s/
5579         the invocation type may not be a subclass of the tye of the item/
5580         The type of the item must be a subclass of the invocation item.
5581         /g
5582
5583         Fixes bug #50820.
5584
5585 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5586
5587         * attribute.cs: Added methods to get a string and a bool from an
5588         attribute. Required to information from AssemblyKeyFileAttribute,
5589         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5590         * codegen.cs: Modified AssemblyName creation to include support for
5591         strongnames. Catch additional exceptions to report them as CS1548.
5592         * compiler.csproj: Updated include CryptoConvert.cs.
5593         * compiler.csproj.user: Removed file - user specific configuration.
5594         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5595         Mono.Security assembly. The original class is maintained and tested in
5596         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5597         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5598         like CSC 8.0 (C# v2) supports.
5599         * Makefile: Added CryptoConvert.cs to mcs sources.
5600         * rootcontext.cs: Added new options for strongnames.
5601
5602 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5603
5604         * driver.cs: For --expect-error, report error code `2'
5605         if the program compiled with no errors, error code `1' if
5606         it compiled with an error other than the one expected.
5607
5608 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5609
5610         * compiler.csproj: Updated for Visual Studio .NET 2003.
5611         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5612         * compiler.sln: Updated for Visual Studio .NET 2003.
5613
5614 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5615
5616         * expression.cs: Fix bug #47234. We basically need to apply the
5617         rule that we prefer the conversion of null to a reference type
5618         when faced with a conversion to 'object' (csc behaviour).
5619
5620 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5621
5622         * statement.cs: Shorter form for foreach, eliminates
5623         a local variable. r=Martin.
5624
5625 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5626
5627         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5628         checks if we can use brtrue/brfalse to test for 0.
5629         * expression.cs: use the above in the test for using brtrue/brfalse.
5630         cleanup code a bit.
5631
5632 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5633
5634         * expression.cs: Rewrite string concat stuff. Benefits:
5635
5636         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5637         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5638         rather than a concat chain.
5639
5640         * typemanager.cs: Add lookups for more concat overloads.
5641
5642 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5643
5644         * expression.cs: Emit shorter il code for array init.
5645
5646         newarr
5647         dup
5648         // set 1
5649
5650         // set 2
5651
5652         newarr
5653         stloc.x
5654
5655         ldloc.x
5656         // set 1
5657
5658         ldloc.x
5659         // set 2
5660
5661 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5662
5663         * statement.cs: Before, two switch blocks would be merged if the
5664         total size of the blocks (end_item - begin_item + 1) was less than
5665         two times the combined sizes of the blocks.
5666
5667         Now, it will only merge if after the merge at least half of the
5668         slots are filled.
5669
5670         fixes 55885.
5671
5672 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5673
5674         * class.cs : csc build fix for GetMethods(). See bug #52503.
5675
5676 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5677
5678         * expression.cs: Make sure fp comparisons work with NaN.
5679         This fixes bug #54303. Mig approved this patch a long
5680         time ago, but we were not able to test b/c the runtime
5681         had a related bug.
5682
5683 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5684
5685         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5686
5687 2004-03-19  Martin Baulig  <martin@ximian.com>
5688
5689         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5690         error here and not in our caller.
5691
5692 2004-03-19  Martin Baulig  <martin@ximian.com>
5693
5694         * interface.cs: Completely killed this file.
5695         (Interface): We're now a TypeContainer and live in class.cs.
5696
5697         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5698         argument; we're now also called for interfaces.
5699         (TypeContainer.DefineMembers): Allow this method being called
5700         multiple times.
5701         (TypeContainer.GetMethods): New public method; formerly known as
5702         Interface.GetMethod().  This is used by PendingImplementation.
5703         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5704         it's now private and non-static.
5705         (Interface): Moved this here; it's now implemented similar to
5706         Class and Struct.
5707         (Method, Property, Event, Indexer): Added `bool is_interface'
5708         argument to their .ctor's.
5709         (MemberBase.IsInterface): New public field.
5710
5711         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5712         instances instead of InterfaceMethod, InterfaceProperty, etc.
5713         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5714         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5715
5716 2004-03-19  Martin Baulig  <martin@ximian.com>
5717
5718         * class.cs (MethodCore.IsDuplicateImplementation): New private
5719         method which does the CS0111 checking.
5720         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5721         Use IsDuplicateImplementation().
5722
5723 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5724
5725         * decl.cs (FindMemberToOverride): New method to find the correct
5726         method or property to override in the base class.
5727         * class.cs
5728             - Make Method/Property use the above method to find the
5729               version in the base class.
5730             - Remove the InheritableMemberSignatureCompare as it is now
5731               dead code.
5732
5733         This patch makes large code bases much faster to compile, as it is
5734         O(n) rather than O(n^2) to do this validation.
5735
5736         Also, it fixes bug 52458 which is that nested classes are not
5737         taken into account when finding the base class member.
5738
5739         Reviewed/Approved by Martin.
5740
5741 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5742
5743         * interface.cs: In all interface classes removed redundant
5744         member initialization.
5745
5746 2004-03-16  Martin Baulig  <martin@ximian.com>
5747
5748         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5749
5750 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5751
5752         * decl.cs (DefineTypeAndParents): New helper method to define a
5753         type's containers before the type itself is defined;  This is a
5754         bug exposed by the recent changes to Windows.Forms when an
5755         implemented interface was defined inside a class that had not been
5756         built yet.   
5757
5758         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5759
5760         (Check): Loop correctly to report errors modifiers
5761         (UNSAFE was not in the loop, since it was the same as TOP).
5762
5763         * interface.cs: Every interface member now takes a ModFlags,
5764         instead of a "is_new" bool, which we set on the base MemberCore. 
5765
5766         Every place where we called "UnsafeOk" in the interface, now we
5767         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5768         the unsafe settings from the member declaration instead of the
5769         container interface. 
5770
5771         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5772
5773         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5774         `set_indexer_name' to the pending bits (one per type).
5775
5776         We fixed a bug today that was picking the wrong method to
5777         override, since for properties the existing InterfaceMethod code
5778         basically ignored the method name.  Now we make sure that the
5779         method name is one of the valid indexer names.
5780
5781 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5782  
5783         * support.cs (SeekableStreamReader): Keep track of stream byte
5784         positions and don't mix them with character offsets to the buffer.
5785
5786         Patch from Gustavo Giráldez
5787
5788 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5789
5790         * interface.cs (InterfaceSetGetBase): Removed double member
5791         initialization, base class does it as well.
5792
5793 2004-03-13  Martin Baulig  <martin@ximian.com>
5794
5795         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5796         when compiling corlib.
5797
5798 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5799
5800         * convert.cs (ExplicitConversion): We were reporting an error on
5801         certain conversions (object_type source to a value type, when the
5802         expression was `null') before we had a chance to pass it through
5803         the user defined conversions.
5804
5805         * driver.cs: Replace / and \ in resource specifications to dots.
5806         Fixes 50752
5807
5808         * class.cs: Add check for duplicate operators.  Fixes 52477
5809
5810 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5811
5812         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5813         that are in the middle of the statements, not only at the end.
5814         Fixes #54987
5815
5816         * class.cs (TypeContainer.AddField): No longer set the
5817         `HaveStaticConstructor' flag, now we call it
5818         `UserDefineStaticConstructor' to diferentiate the slightly
5819         semantic difference.
5820
5821         The situation is that we were not adding BeforeFieldInit (from
5822         Modifiers.TypeAttr) to classes that could have it.
5823         BeforeFieldInit should be set to classes that have no static
5824         constructor. 
5825
5826         See:
5827
5828         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5829
5830         And most importantly Zoltan's comment:
5831
5832         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5833
5834         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5835          before its static fields are used', i.e. initialization does not need
5836          to be triggered by the first access to the type. Setting this flag
5837          helps the JIT to compile better code, since it can run the static
5838          constructor at JIT time, and does not need to generate code to call it
5839          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5840          this flag for lots of classes like String. 
5841          
5842          csc sets this flag if the type does not have an explicit static 
5843          constructor. The reasoning seems to be that if there are only static
5844          initalizers for a type, and no static constructor, then the programmer
5845          does not care when this initialization happens, so beforefieldinit
5846          can be used.
5847          
5848          This bug prevents the AOT compiler from being usable, since it 
5849          generates so many calls to mono_runtime_class_init that the AOT code
5850          is much slower than the JITted code. The JITted code is faster, 
5851          because it does not generate these calls if the vtable is type is
5852          already initialized, which is true in the majority of cases. But the
5853          AOT compiler can't do this."
5854
5855 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5856
5857         * class.cs (MethodData.Emit): Refactor the code so symbolic
5858         information is generated for destructors;  For some reasons we
5859         were taking a code path that did not generate symbolic information
5860         before. 
5861
5862 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5863
5864         * class.cs: Create a Constructor.CheckBase method that
5865         takes care of all validation type code. The method
5866         contains some code that was moved from Define.
5867
5868         It also includes new code that checks for duplicate ctors.
5869         This fixes bug #55148.
5870
5871 2004-03-09  Joshua Tauberer <tauberer@for.net>
5872
5873         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5874         a { ... }-style array creation invokes EmitStaticInitializers
5875         which is not good for reference-type arrays.  String, decimal
5876         and now null constants (NullCast) are not counted toward
5877         static initializers.
5878
5879 2004-03-05  Martin Baulig  <martin@ximian.com>
5880
5881         * location.cs (SourceFile.HasLineDirective): New public field;
5882         specifies whether the file contains or is referenced by a "#line"
5883         directive.
5884         (Location.DefineSymbolDocuments): Ignore source files which
5885         either contain or are referenced by a "#line" directive.        
5886
5887 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5888
5889         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5890         direct access to our parent, so check the method inline there.
5891
5892 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5893
5894         * expression.cs (Invocation.EmitCall): Miguel's last commit
5895         caused a regression. If you had:
5896
5897             T t = null;
5898             t.Foo ();
5899
5900         In Foo the implict this would be null.
5901
5902 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5903
5904         * expression.cs (Invocation.EmitCall): If the method is not
5905         virtual, do not emit a CallVirt to it, use Call.
5906
5907         * typemanager.cs (GetFullNameSignature): Improve the method to
5908         cope with ".ctor" and replace it with the type name.
5909
5910         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5911         as an argument the ConstructorBuilder where it is being defined,
5912         to catch the recursive constructor invocations.
5913
5914 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5915
5916         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5917         routines to check if a type is an enumerable/enumerator allow
5918         classes that implement the IEnumerable or IEnumerator interfaces.
5919
5920         * class.cs (Property, Operator): Implement IIteratorContainer, and
5921         implement SetYields.
5922
5923         (Property.Define): Do the block swapping for get_methods in the
5924         context of iterators.   We need to check if Properties also
5925         include indexers or not.
5926
5927         (Operator): Assign the Block before invoking the
5928         OperatorMethod.Define, so we can trigger the Iterator code
5929         replacement. 
5930
5931         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5932         Property and Operator classes are not created when we parse the
5933         declarator but until we have the block completed, so we use a
5934         singleton SimpleIteratorContainer.Simple to flag whether the
5935         SetYields has been invoked.
5936
5937         We propagate this setting then to the Property or the Operator to
5938         allow the `yield' to function.
5939
5940 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5941
5942         * codegen.cs: Implemented attribute support for modules.
5943         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5944         Assembly/Module functionality.
5945
5946         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5947         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5948         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5949
5950 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5951
5952         * interface.cs (FindMembers): The operation is performed on all base
5953         interfaces and not only on the first. It is required for future CLS Compliance patch.
5954
5955 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5956
5957         * statement.cs, codegen.cs:
5958         This patch deals with patterns such as:
5959
5960         public class List : IEnumerable {
5961
5962                 public MyEnumerator GetEnumerator () {
5963                         return new MyEnumerator(this);
5964                 }
5965
5966                 IEnumerator IEnumerable.GetEnumerator () {
5967                         ...
5968                 }
5969                 
5970                 public struct MyEnumerator : IEnumerator {
5971                         ...
5972                 }
5973         }
5974
5975         Before, there were a few things we did wrong:
5976         1) we would emit callvirt on a struct, which is illegal
5977         2) we emited ldarg when we needed to emit ldarga
5978         3) we would mistakenly call the interface methods on an enumerator
5979         type that derived from IEnumerator and was in another assembly. For example:
5980
5981         public class MyEnumerator : IEnumerator
5982
5983         Would have the interface methods called, even if there were public impls of the
5984         method. In a struct, this lead to invalid IL code.
5985
5986 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5987
5988         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5989           renamed to Emit.
5990
5991         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5992
5993 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5994
5995         * cs-parser.jay: Fix small regression: we were not testing V2
5996         compiler features correctly.
5997
5998         * interface.cs: If the emit context is null, then create one
5999
6000 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6001
6002         * decl.cs (GetSignatureForError): New virtual method to get full name
6003           for error messages.
6004
6005         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6006           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6007
6008         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6009           Duplicated members and code in these classes has been removed.
6010           Better encapsulation in these classes.
6011
6012 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6013
6014         * assign.cs (Assign.DoResolve): When dealing with compound
6015         assignments, there is a new rule in ECMA C# 2.4 (might have been
6016         there before, but it is documented here) that states that in:
6017
6018         a op= b;
6019
6020         If b is of type int, and the `op' is a shift-operator, then the
6021         above is evaluated as:
6022
6023         a = (int) a op b 
6024
6025         * expression.cs (Binary.ResolveOperator): Instead of testing for
6026         int/uint/long/ulong, try to implicitly convert to any of those
6027         types and use that in pointer arithmetic.
6028
6029         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6030         method to print information for from the type, not from the
6031         null-method we were given.
6032
6033 2004-02-01  Duncan Mak  <duncan@ximian.com>
6034
6035         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6036         parsing for cmd, fixes bug #53694.
6037
6038 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6039
6040         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6041         in the member name duplication tests. Property and operator name duplication
6042         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6043
6044 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6045
6046         * interface.cs (PopulateMethod): Fixed crash when interface method
6047         returns not existing type (error test cs0246-3.cs).
6048
6049 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6050
6051         * cs-parser.jay (interface_accessors): Re-write actions to also
6052         store attributes attached to get and set methods. Fix spelling
6053         while at it.
6054
6055         (inteface_property_declaration): Modify accordingly.
6056
6057         (InterfaceAccessorInfo): New helper class to store information to pass
6058         around between rules that use interface_accessors.
6059
6060         * interface.cs (Emit): Apply attributes on the get and set
6061         accessors of properties and indexers too.
6062
6063         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6064         right MethodBuilder when applying attributes to the get and set accessors.
6065
6066 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6067
6068         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6069
6070 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6071
6072         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6073
6074 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6075
6076         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6077         changes that treat `yield' specially when present before `break'
6078         or `return' tokens.
6079
6080         * cs-tokenizer.cs: yield is no longer a keyword.
6081
6082 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6083
6084         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6085         setting for default constructors.
6086         For default constructors are almost every time set wrong Modifier. The
6087         generated IL code has been alright. But inside mcs this values was
6088         wrong and this was reason why several of my CLS Compliance tests
6089         failed.
6090
6091 2004-01-22  Martin Baulig  <martin@ximian.com>
6092
6093         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6094         not a QualifiedIdentifier.  This is what `type_name_expression'
6095         was previously doing.
6096         (type_name_expression): Removed; the code is now in
6097         `namespace_or_type_name'.
6098         (qualified_identifier): Removed, use `namespace_or_type_name'
6099         instead.
6100         (QualifiedIdentifier): Removed this class.      
6101
6102 2004-01-22  Martin Baulig  <martin@ximian.com>
6103
6104         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6105         not a string as alias name.
6106
6107 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6108
6109         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6110         #52730 bug, and instead compute correctly the need to use a
6111         temporary variable when requesting an address based on the
6112         static/instace modified of the field and the constructor.
6113  
6114 2004-01-21  Martin Baulig  <martin@ximian.com>
6115
6116         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6117         class and namespace before looking up aliases.  Fixes #52517.
6118
6119 2004-01-21  Martin Baulig  <martin@ximian.com>
6120
6121         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6122         assinged in a 'try'; fixes exception4.cs.
6123
6124 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6125         * class.cs : Implemented parameter-less constructor for TypeContainer
6126
6127         * decl.cs: Attributes are now stored here. New property OptAttributes
6128
6129         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6130
6131         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6132
6133 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6134
6135         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6136           (CSharpSignature): New method for indexer and property signature.
6137
6138 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6139
6140         * pending.cs (IsVirtualFilter): Faster implementation.
6141
6142 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6143
6144         * typemanager.cs: Avoid inclusion of same assembly more than once.
6145
6146 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6147
6148         * cs-parser.jay: Fixed problem where the last assembly attribute
6149           has been applied also to following declaration (class, struct, etc.)
6150           
6151 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6152
6153         * class.cs: Added error CS0538, CS0539 reporting.
6154         Fixed crash on Microsoft runtime when field type is void.
6155
6156         * cs-parser.jay: Added error CS0537 reporting.
6157
6158         * pending.cs: Added error CS0535 reporting.
6159         Improved error report for errors CS0536, CS0534.
6160
6161 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6162
6163         Merge a few bits from the Anonymous Method MCS tree.
6164
6165         * statement.cs (ToplevelBlock): New class for toplevel methods,
6166         will hold anonymous methods, lifted variables.
6167
6168         * cs-parser.jay: Create toplevel blocks for delegates and for
6169         regular blocks of code. 
6170
6171 2004-01-20  Martin Baulig  <martin@ximian.com>
6172
6173         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6174         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6175         and `NeedExplicitReturn'; added `IsLastStatement'.
6176         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6177         have a `ReturnLabel' or we're not unreachable.
6178
6179         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6180         child's reachability; don't just override ours with it.  Fixes
6181         #58058 (lluis's example).
6182         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6183         InFinally(), InLoop(), InSwitch() and
6184         BreakCrossesTryCatchBoundary() methods.
6185
6186         * statement.cs (Return): Do all error checking in Resolve().
6187         Unless we are the last statement in a top-level block, always
6188         create a return label and jump to it.
6189         (Break, Continue): Do all error checking in Resolve(); also make
6190         sure we aren't leaving a `finally'.
6191         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6192         statement in a top-level block.
6193         (Block.Flags): Added `IsDestructor'.
6194         (Block.IsDestructor): New public property.
6195
6196 2004-01-20  Martin Baulig  <martin@ximian.com>
6197
6198         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6199
6200 2004-01-20  Martin Baulig  <martin@ximian.com>
6201
6202         * statement.cs (Statement.ResolveUnreachable): New public method.
6203         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6204         (Block.Resolve): Resolve unreachable statements.
6205
6206 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6207
6208         * expression.cs: We need to fix the case where we do
6209         not have a temp variable here.
6210
6211         * assign.cs: Only expression compound assignments need
6212         temporary variables.
6213
6214 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6215
6216         * flowanalysis.cs: Reduce memory allocation in a few ways:
6217           - A block with no variables should not allocate a bit
6218             vector for itself.
6219           - A method with no out parameters does not need any tracking
6220             for assignment of the parameters, so we need not allocate
6221             any data for it.
6222           - The arrays:
6223                 public readonly Type[] VariableTypes;
6224                 public readonly string[] VariableNames;
6225             Are redundant. The data is already stored in the variable
6226             map, so we need not allocate another array for it.
6227           - We need to add alot of checks for if (params | locals) == null
6228             due to the first two changes.
6229
6230 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6231
6232         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6233         implement IMemoryLocation, we store a copy on a local variable and
6234         take the address of it.  Patch from Benjamin Jemlich
6235
6236         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6237         to use a special "type_name_expression" rule which reduces the
6238         number of "QualifiedIdentifier" classes created, and instead
6239         directly creates MemberAccess expressions.
6240
6241 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6242
6243         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6244         that fixes #52853.  Null literal assignment to ValueType
6245
6246         * class.cs (MethodData.Emit): Instead of checking the name of the
6247         method to determine if its a destructor, create a new derived
6248         class from Method called Destructor, and test for that.  
6249
6250         * cs-parser.jay: Create a Destructor object instead of a Method.  
6251
6252         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6253
6254         Fixes: 52933
6255
6256 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6257
6258         * expression.cs (Binary.ResolveOperator): Perform an implicit
6259         conversion from MethodGroups to their delegate types on the
6260         Addition operation.
6261
6262         * delegate.cs: Introduce a new class DelegateCreation that is the
6263         base class for `NewDelegate' and `ImplicitDelegateCreation',
6264         factor some code in here.
6265
6266         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6267         conversion from MethodGroups to compatible delegate types. 
6268
6269         * ecore.cs (Expression.Resolve): Do not flag error 654
6270         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6271         we allow conversions from MethodGroups to delegate types now.
6272
6273         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6274         assignments in v2 either.
6275
6276 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6277
6278         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6279         static read-only fields in ctors.
6280
6281         Applied patch from Benjamin Jemlich 
6282
6283         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6284
6285 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6286
6287         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6288         here to return true, as they can be used like this:
6289
6290                 (XXX) int.MEMBER ()
6291
6292         Fixed 49836 and all the other dups
6293
6294 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6295
6296         * driver.cs: Implement /win32res and /win32icon.
6297
6298 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6299
6300         * cs-parser.jay: Add a rule to improve error handling for the
6301         common mistake of placing modifiers after the type.
6302
6303 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6304
6305         * cs-parser.jay (interface_event_declaration): Catch
6306         initialization of events on interfaces, and report cs0068
6307
6308         * cs-parser.jay (interface_event_declaration): Catch
6309         initialization of events. 
6310
6311         * ecore.cs: Better report missing constructors.
6312
6313         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6314         the error reporting done in the wrong place.  Fix.
6315
6316         * expression.cs (Binary.ResolveOperator): Catch the 
6317         operator + (E x, E y) error earlier, and later allow for implicit
6318         conversions in operator +/- (E e, U x) from U to the underlying
6319         type of E.
6320
6321         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6322         52596, if the container class is abstract, the default constructor
6323         is protected otherwise its public (before, we were always public).
6324
6325         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6326         fixed statement.
6327
6328         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6329         Jemlich that fixes bug #52597, MCS was generating invalid code for
6330         idisposable structs.   Thanks to Ben for following up with this
6331         bug as well.
6332
6333 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * driver.cs: Allow assemblies without code to be generated, fixes
6336         52230.
6337
6338 2004-01-07  Nick Drochak <ndrochak@gol.com>
6339
6340         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6341
6342 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6343
6344         * cs-parser.jay: Add rules to improve error reporting if fields or
6345         methods are declared at the namespace level (error 116)
6346
6347         * Add rules to catch event add/remove
6348
6349 2004-01-04  David Sheldon <dave-mono@earth.li>
6350
6351   * expression.cs: Added matching ")" to error message for 
6352   CS0077
6353
6354 2004-01-03 Todd Berman <tberman@gentoo.org>
6355
6356         * ecore.cs, attribute.cs:
6357         Applying fix from #52429.
6358
6359 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6360
6361         * ecore.cs, expression.cs, statement.cs:
6362         Total rewrite of how we handle branching. We
6363         now handle complex boolean expressions with fewer
6364         jumps. As well if (x == 0) no longer emits a ceq.
6365
6366         if (x is Foo) is much faster now, because we generate
6367         better code.
6368
6369         Overall, we get a pretty big improvement on our benchmark
6370         tests. The code we generate is smaller and more readable.
6371
6372         I did a full two-stage bootstrap. The patch was reviewed
6373         by Martin and Miguel.
6374
6375 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6376
6377         * cs-parser.jay: Make primary_expression not take a QI.
6378         we dont need this because the member_access rule covers
6379         us here. So we replace the rule with just IDENTIFIER.
6380
6381         This has two good effects. First, we remove a s/r conflict.
6382         Second, we allocate many fewer QualifiedIdentifier objects.
6383
6384 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6385
6386         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6387         set the correct information via SRE. This prevents
6388         hanging on the MS runtime. Fixes #29374.
6389
6390 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6391
6392         * convert.cs: correctly handle conversions to value types
6393         from Enum and ValueType as unboxing conversions.
6394
6395         Fixes bug #52569. Patch by Benjamin Jemlich.
6396
6397 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6398
6399         * expression.cs (BetterConversion): Prefer int -> uint
6400         over int -> ulong (csc's behaviour). This fixed bug #52046.
6401
6402 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6403
6404         * decl.cs (MemberCache.FindMembers): now returns a
6405         MemberInfo [].
6406
6407         * typemanager.cs: In general, go with with ^^.
6408         (CopyNewMethods): take an IList.
6409         (RealMemberLookup): Only allocate an arraylist
6410         if we copy from two sets of methods.
6411
6412         This change basically does two things:
6413         1) Fewer array lists allocated due to CopyNewMethods.
6414         2) the explicit cast in MemberList costed ALOT.
6415
6416 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6417
6418         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6419         a hashtable to avoid needless string allocations when an identifier is
6420         used more than once (the common case).
6421
6422 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6423
6424         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6425         is broken, it will not return anything. So, we
6426         have to use the information we have in mcs to
6427         do the task.
6428
6429         * typemanager.cs: Add a cache for GetInterfaces,
6430         since this will now be used more often (due to ^^)
6431
6432         (GetExplicitInterfaces) New method that gets the
6433         declared, not effective, interfaces on a type
6434         builder (eg, if you have interface IFoo, interface
6435         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6436         { IBar }.
6437
6438         This patch makes MCS able to bootstrap itself on
6439         Windows again.
6440
6441 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6442
6443         * expression.cs: Remove the Nop's that Miguel put
6444         in by mistake.
6445
6446 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6447
6448         * report.cs, codegen.cs: Give the real stack trace to
6449         the error when an exception is thrown.
6450
6451 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6452
6453         * decl.cs: only allocate hashtables for ifaces if 
6454         it is an iface!
6455
6456 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6457
6458         * expression.cs: fix the error from cs0121-2.cs
6459         (a parent interface has two child interfaces that
6460         have a function with the same name and 0 params
6461         and the function is called through the parent).
6462
6463 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6464
6465         * class.cs, rootcontext.cs, typmanager.cs: do not
6466         leak pointers.
6467
6468 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6469
6470         * codegen.cs: remove stack for the ec flow branching.
6471         It is already a linked list, so no need.
6472
6473 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6474
6475         * Makefile: Allow custom profiler here.
6476
6477 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6478
6479         * typemanager.cs (LookupType):
6480           - Use a static char [], because split takes
6481             a param array for args, so it was allocating
6482             every time.
6483           - Do not store true in a hashtable, it boxes.
6484
6485 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6486
6487         * flowanalysis.cs: bytify common enums.
6488
6489 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6490
6491         * modifiers.cs: Add a new set of flags for the
6492         flags allowed on explicit interface impls.
6493         * cs-parser.jay: catch the use of modifiers in
6494         interfaces correctly.
6495         * class.cs: catch private void IFoo.Blah ().
6496
6497         All related to bug #50572.
6498
6499 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6500
6501         * decl.cs: Rewrite the consistant accessability checking.
6502         Accessability is not linear, it must be implemented in
6503         a tableish way. Fixes #49704.
6504
6505 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6506
6507         * expression.cs: Handle negation in a checked context.
6508         We must use subtraction from zero. Fixes #38674.
6509
6510 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6511
6512         * class.cs: Ignore static void main in DLLs.
6513         * rootcontext.cs: Handle the target type here,
6514         since we are have to access it from class.cs
6515         * driver.cs: account for the above.
6516
6517 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6518
6519         * report.cs: Give line numbers and files if available.
6520
6521 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6522
6523         * driver.cs: Implement /addmodule.
6524
6525         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6526         ModuleBuilders.
6527
6528 2003-12-20  Martin Baulig  <martin@ximian.com>
6529
6530         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6531         (FieldBase.IsAssigned): Removed this field.
6532         (FieldBase.SetAssigned): New public method.
6533         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6534
6535 2003-12-20  Martin Baulig  <martin@ximian.com>
6536
6537         * expression.cs (LocalVariableReference.DoResolve): Don't set
6538         `vi.Used' if we're called from DoResolveLValue().
6539
6540         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6541         returns the usage vector it just merged into the current one -
6542         pass this one to UsageWarning().
6543         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6544         of the `EmitContext', don't call this recursively on our children.
6545
6546 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6547
6548         * driver.cs: Implement /target:module.
6549
6550 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6551
6552         * support.cs (CharArrayHashtable): New helper class.
6553
6554         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6555         char arrays, not strings, so we can avoid creating a string in
6556         consume_identifier if the identifier is a keyword.
6557
6558 2003-12-16  Martin Baulig  <martin@ximian.com>
6559
6560         * statement.cs (LocalInfo.Assigned): Removed this property.
6561         (LocalInfo.Flags): Removed `Assigned'.
6562         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6563         and uses flow analysis.
6564         (Block.UsageWarning): Made this method private.
6565         (Block.Resolve): Call UsageWarning() if appropriate.
6566
6567         * expression.cs (LocalVariableReference.DoResolve): Always set
6568         LocalInfo.Used here.
6569
6570 2003-12-13  Martin Baulig  <martin@ximian.com>
6571
6572         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6573         any value here; we're now using flow analysis to figure out
6574         whether a statement/block returns a value.
6575
6576 2003-12-13  Martin Baulig  <martin@ximian.com>
6577
6578         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6579         working again.
6580         (FlowBranching.MergeFinally): Don't call
6581         `branching.CheckOutParameters()' here, this is called in
6582         MergeTopBlock().
6583         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6584         when adding the `finally' vector.       
6585
6586 2003-12-13  Martin Baulig  <martin@ximian.com>
6587
6588         * flowanalysis.cs
6589         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6590         actually work and also fix #48962.
6591
6592 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6593
6594         * decl.cs: Do not check System.Object for nested types,
6595         since we know it does not have any. Big bang for buck:
6596
6597         BEFORE:
6598            Run 1:   8.35 seconds
6599            Run 2:   8.32 seconds
6600            corlib:  17.99 seconds
6601         AFTER:
6602            Run 1:   8.17 seconds
6603            Run 2:   8.17 seconds
6604            corlib:  17.39 seconds
6605
6606 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6607
6608         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6609         time we are returning 0 members, so we save alot here.
6610
6611 2003-12-11  Martin Baulig  <martin@ximian.com>
6612
6613         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6614         `MergeChild()', also just take the `FlowBranching' as argument;
6615         call Merge() on it and return the result.
6616         (FlowBranching.Merge): We don't need to do anything if we just
6617         have one sibling.
6618
6619 2003-12-11  Martin Baulig  <martin@ximian.com>
6620
6621         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6622         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6623         Maurer for this idea.
6624
6625 2003-12-11  Martin Baulig  <martin@ximian.com>
6626
6627         * flowanalysis.cs (MergeResult): This class is now gone; we now
6628         use the `UsageVector' for this.  The reason for this is that if a
6629         branching just has one sibling, we don't need to "merge" them at
6630         all - that's the next step to do.
6631         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6632         `MergeResult'.
6633
6634 2003-12-11  Martin Baulig  <martin@ximian.com>
6635
6636         Reworked flow analyis and made it more precise and bug-free.  The
6637         most important change is that we're now using a special `Reachability'
6638         class instead of having "magic" meanings of `FlowReturns'.  I'll
6639         do some more cleanups and optimizations and also add some more
6640         documentation this week.
6641
6642         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6643         largely reworked this class.
6644         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6645         the new `Reachability' class instead of having "magic" values here.
6646         (FlowBranching): We're now using an instance of `Reachability'
6647         instead of having separate `Returns', `Breaks' etc. fields.
6648
6649         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6650         based on flow analysis; ignore the return value of block.Emit ().
6651
6652 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6653
6654         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6655         if they are private.
6656
6657 2003-12-09  Martin Baulig  <martin@ximian.com>
6658
6659         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6660         call them directly on the UsageVector.
6661
6662 2003-12-09  Martin Baulig  <martin@ximian.com>
6663
6664         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6665         Changed return type from `FlowReturns' to `Reachability'.
6666
6667 2003-12-09  Martin Baulig  <martin@ximian.com>
6668
6669         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6670         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6671         `Reachable' fields with a single `Reachability' one.
6672
6673 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6674
6675         * class.cs (FindMembers): Remove foreach's.
6676
6677         Bootstrap times:
6678
6679         BEFORE
6680                 Run 1:   8.74 seconds
6681                 Run 2:   8.71 seconds
6682
6683         AFTER
6684                 Run 1:   8.64 seconds
6685                 Run 2:   8.58 seconds
6686
6687
6688 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6689
6690         * cs-parser.jay:
6691         * gen-treedump.cs:
6692         * statement.cs:
6693         This patch does a few things:
6694                 1. EmptyStatement is now a singleton, so it is never reallocated.
6695                 2. All blah is EmptyStatement constructs have been changed to
6696                    blah == EmptyStatement.Value, which is much faster and valid
6697                    now that EmptyStatement is a singleton.
6698                 3. When resolving a block, rather than allocating a new array for
6699                    the non-empty statements, empty statements are replaced with
6700                    EmptyStatement.Value
6701                 4. Some recursive functions have been made non-recursive.
6702         Mainly the performance impact is from (3), however (1) and (2) are needed for
6703         this to work. (4) does not make a big difference in normal situations, however
6704         it makes the profile look saner.
6705
6706         Bootstrap times:
6707
6708         BEFORE
6709         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6710         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6711         Total memory allocated: 56397 KB
6712
6713         AFTER
6714         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6715         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6716         Total memory allocated: 55666 KB
6717
6718 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6719
6720         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6721         than the hashtable in a hashtable version
6722
6723         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6724         we always end up concating a string. This results in a huge perf
6725         loss, because many strings have to be tracked by the GC. In this
6726         patch, we first use a hashtable that works with two keys, so that
6727         the strings do not need to be concat'ed.
6728
6729         Bootstrap times:
6730         BEFORE
6731                 Run 1:   8.74 seconds
6732                 Run 2:   8.71 seconds
6733
6734         AFTER
6735                 Run 1:   8.65 seconds
6736                 Run 2:   8.56 seconds
6737
6738 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6739
6740         * Makefile: Add a new target `do-time' that does a quick and simple
6741         profile, leaving easy to parse output.
6742
6743 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6744
6745         * codegen.cs (Init): Create the dynamic assembly with 
6746         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6747
6748 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6749
6750         * support.cs: Make the PtrHashtable use only one
6751         instance of its comparer.
6752
6753 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6754
6755         * typemanager.cs: Fix lookup of GetNamespaces.
6756
6757 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6758
6759         * expression.cs: Removed redundant line.
6760
6761         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6762         ArrayLists, use for loops with bounds.  
6763
6764         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6765         arraylist.
6766
6767         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6768         arraylists, use for loop with bounds.
6769
6770         The above three changes give us a 0.071 second performance
6771         improvement out of 3.294 seconds down to 3.223.  On my machine
6772         the above changes reduced the memory usage by 1,387 KB during
6773         compiler bootstrap.
6774
6775         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6776         QualifiedIdentifiers.  Before we created a new string through
6777         concatenation, and mostly later on, the result would be
6778         manipulated by DecomposeQI through string manipulation.
6779
6780         This reduced the compiler memory usage for bootstrapping from
6781         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6782         compile times in 0.05 seconds.
6783
6784 2003-11-28  Dick Porter  <dick@ximian.com>
6785
6786         * support.cs: Do string compares with the Invariant culture.
6787
6788         * rootcontext.cs: 
6789         * gen-treedump.cs: 
6790         * expression.cs: 
6791         * driver.cs: 
6792         * decl.cs: 
6793         * codegen.cs: 
6794         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6795         the comparison is done with the Invariant culture.
6796
6797 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6798
6799         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6800         GetEnumerator method.
6801
6802         (ProbeCollectionType): Iterate starting at the most specific type
6803         upwards looking for a GetEnumerator
6804
6805         * expression.cs: Shift count can be up to 31 for int/uint and 63
6806         for long/ulong.
6807
6808 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6809
6810         * statement.cs (Block.LookupLabel): Also look for the label on the
6811         children blocks.  Use a hash table to keep track of visited
6812         nodes. 
6813
6814         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6815         we actually did transform the other operand, otherwise fall back
6816         to the common codepath that casts to long.
6817
6818         * cs-tokenizer.cs: Use the same code pattern as the int case.
6819         Maybe I should do the parsing myself, and avoid depending on the
6820         Parse routines to get this done.
6821
6822 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6823
6824         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6825         which fixes bug 51347.  This time test it.
6826
6827         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6828         attributes for example can not tell the difference between these.
6829         The difference was only a syntax feature of the language. 
6830
6831         * attribute.cs: Apply attributes to delegates.
6832
6833         * delegate.cs: Call the apply attributes method.
6834
6835 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6836
6837         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6838         comparing 0 vs Byte.MinValue, not the value
6839
6840         (ImplicitConversionRequired): When reporting a conversion error,
6841         use error 31 to print out the constant error instead of the
6842         simpler 29.
6843
6844         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6845         which fixes bug 51347.
6846
6847 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6848
6849         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6850         which fixes the -warnaserror command line option.
6851
6852 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6853
6854         * cfold.cs (DoNumericPromotions): During constant folding of
6855         additions on UIntConstant, special case intconstants with
6856         IntConstants like we do on the expression binary operator. 
6857
6858 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6859
6860         * convert.cs (ImplicitReferenceConversion): We were missing a case
6861         (System.Enum are not value types or class types, so we need to
6862         classify them separatedly).
6863
6864         * driver.cs: We do not support error 2007.
6865
6866 2003-11-12 Jackson Harper <jackson@ximian.com>
6867
6868         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6869         system directory. Also use the full file name so users can
6870         libraries names mscorlib-o-tron.dll in a non system dir.
6871
6872 2003-11-10  Martin Baulig  <martin@ximian.com>
6873
6874         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6875         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6876         calling `ResolveType()' on them, directly assign their `Type'.
6877
6878 2003-11-08  Martin Baulig  <martin@ximian.com>
6879
6880         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6881         return value and the `out parent' parameter.
6882         (TypeContainer.DefineType): Moved the CS0644 check into
6883         GetClassBases().  Don't pass the interface types to the
6884         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6885         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6886
6887         * ecore.cs (TypeExpr.IsAttribute): New property.
6888         (TypeExpr.GetInterfaces): New method.
6889
6890         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6891         TypeExpr instead of a Type.
6892         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6893         (Interface.DefineType): Don't pass the interface types to the
6894         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6895         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6896
6897         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6898         instead of a `Type[]'.
6899         (TypeManager.RegisterBuilder): Likewise.
6900         (TypeManager.AddUserInterface): Likewise.
6901         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6902         `Type[]' and also return a `TypeExpr[]'.
6903         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6904
6905 2003-11-08  Martin Baulig  <martin@ximian.com>
6906
6907         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6908         Expression.     
6909
6910 2003-11-08  Martin Baulig  <martin@ximian.com>
6911
6912         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6913         TypeManager.ResolveExpressionTypes().
6914
6915         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6916         instead of an Expression.
6917         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6918         (TypeExpression): New public class; formerly known as `TypeExpr'.
6919
6920         * expression.cs (ComposedCast): Derive from TypeExpr.
6921
6922         * typemanager.cs (TypeManager.system_*_expr): These are now
6923         TypExpr's instead of Expression's.
6924         (TypeManager.ResolveExpressionTypes): New public static function;
6925         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6926         of them.        
6927
6928 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6929
6930         * expression.cs (New.DoResolve): Do not dereference value that
6931         might be a null return.
6932
6933         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6934         sure that the constant value has the right type.  Fixes an
6935         unreported bug, similar to 50425.
6936
6937         * const.cs (Const.LookupConstantValue): Call
6938         ImplicitStandardConversionExists before doing a conversion to
6939         avoid havng the TypeManager.ChangeType do conversions.
6940
6941         Reduced the number of casts used
6942
6943         (Const.ChangeType): New routine to enable reuse of the constant
6944         type changing code from statement.
6945
6946         * typemanager.cs (ChangeType): Move common initialization to
6947         static global variables.
6948
6949         Fixes #50425.
6950
6951         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6952         every value type to go through, even if it was void.  Fix that. 
6953
6954         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6955         character of the define, and the is_identifier_part_character for
6956         the rest of the string.
6957
6958 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6959
6960         * expression.cs (UnaryMutator.EmitCode): When I updated
6961         LocalVariableReference.DoResolve, I overdid it, and dropped an
6962         optimization done on local variable references.
6963
6964 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6965
6966         * ecore.cs: Convert the return from Ldlen into an int.
6967
6968 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6969
6970         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6971         the accessibility, this is a special case for toplevel non-public
6972         classes (internal for instance).
6973
6974 2003-10-20  Nick Drochak <ndrochak@gol.com>
6975
6976         * ecore.cs: Fix typo and build.  Needed another right paren.
6977
6978 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6979
6980         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6981         `internal' case regular and protected, but not allowing protected
6982         to be evaluated later.  Bug 49840
6983
6984 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6985
6986         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6987         to kb.Nlast, and not the kb.nFirst to isolate the switch
6988         statement.
6989
6990         Extract the underlying type, so enumerations of long/ulong are
6991         treated like long/ulong.
6992
6993 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6994
6995         * expression.cs (New): Overload the meaning of RequestedType to
6996         track the possible creation of the NewDelegate type, since
6997         DoResolve is invoked more than once for new constructors on field
6998         initialization.
6999
7000         See bugs: #48800 and #37014
7001
7002         * cs-parser.jay (declare_local_constants): Take an arraylist
7003         instead of a single constant.
7004
7005         (local_constant_declaration): It should take a
7006         constant_declarators, not a constant_declarator.  Fixes 49487
7007
7008         * convert.cs: Fix error report.
7009
7010 2003-10-13 Jackson Harper <jackson@ximian.com>
7011
7012         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7013         bug #49611
7014
7015 2003-10-09  Martin Baulig  <martin@ximian.com>
7016
7017         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7018         to the .ctor.
7019         (MethodCore.DoDefineParameters): Removed the TypeContainer
7020         argument; use the DeclSpace which was passed to the .ctor instead.
7021         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7022         TypeContainer; we only need a DeclSpace here.
7023
7024 2003-10-09  Martin Baulig  <martin@ximian.com>
7025
7026         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7027         to the .ctor.
7028         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7029         EmitContext's .ctor.    
7030
7031 2003-10-09  Martin Baulig  <martin@ximian.com>
7032
7033         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7034         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7035         AsAccessible(), moved them as well.
7036
7037         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7038
7039 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7040
7041         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7042
7043 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7044
7045         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7046         generation for >=, as spotted by Paolo, bug 48679.  
7047         Patch from David Waite.
7048
7049         * cs-tokenizer.cs: Add handling for #pragma.
7050
7051         * cs-parser.jay: Allow for both yield and yield return in the
7052         syntax.  The anti-cobolization of C# fight will go on!
7053
7054         * class.cs (TypeBuilder.DefineType): Catch error condition here
7055         (Parent.DefineType erroring out and returning null).
7056
7057         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7058         coping with enumerations variables, we were mistakenly processing
7059         them as a regular value type instead of built-in types.  Fixes the
7060         bug #48063
7061
7062         * typemanager.cs (IsBuiltinOrEnum): New method.
7063
7064 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7065
7066         * cs-parser.jay: Upgrade: yield now needs the return clause.
7067
7068 2003-09-19  Martin Baulig  <martin@ximian.com>
7069
7070         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7071         `MemberCache parent' argument.  Normally, an interface doesn't
7072         have a parent type except System.Object, but we use this in gmcs
7073         for generic type parameters.
7074
7075 2003-09-18  Martin Baulig  <martin@ximian.com>
7076
7077         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7078         on `type.IsInterface'; don't check whether the type has a parent
7079         to determine whether it's an interface.
7080
7081 2003-09-15  Martin Baulig  <martin@ximian.com>
7082
7083         * class.cs (TypeContainer.DefineType): Added an error flag to
7084         avoid reporting duplicate CS0146's ("class definition is
7085         circular.").
7086
7087         * driver.cs (Driver.MainDriver): Abort if
7088         RootContext.ResolveTree() reported any errors.
7089
7090 2003-09-07  Martin Baulig  <martin@ximian.com>
7091
7092         * report.cs (Error, Warning): Added overloaded versions which take
7093         a `params object[] args' and call String.Format().
7094
7095 2003-09-07  Martin Baulig  <martin@ximian.com>
7096
7097         * decl.cs (DeclSpace..ctor): Don't call
7098         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7099         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7100         (DeclSpace.RecordDecl): New method.
7101
7102         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7103
7104 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7105
7106         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7107         value attributes to be applied to ParameterBuilders.
7108
7109         * class.cs (MethodCore.LabelParameters): Make static and more
7110         generic so that it can be used from other places - like interface
7111         methods, for instance.
7112
7113         * interface.cs (Interface.Emit): Call LabelParameters before
7114         emitting attributes on the InterfaceMethod.
7115
7116 2003-08-26  Martin Baulig  <martin@ximian.com>
7117
7118         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7119         resolving aliases; fixes #47927.
7120
7121 2003-08-26  Martin Baulig  <martin@ximian.com>
7122
7123         * statement.cs (Using.DoResolve): This is internally emitting a
7124         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7125         do not always return.  Fixes #47681.
7126
7127 2003-08-26  Martin Baulig  <martin@ximian.com>
7128
7129         * decl.cs (MemberCore): Moved WarningNotHiding(),
7130         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7131         into MemberBase.
7132         (AdditionResult): Make this nested in DeclSpace.
7133         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7134         argument; call NamespaceEntry.Define() unless we're nested in a
7135         class or struct.
7136
7137         * namespace.cs (Namespace.DefineName): New public function.  This
7138         is called from DeclSpace's .ctor to add 
7139         (Namespace.Lookup): Include DeclSpaces in the lookup.
7140
7141         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7142
7143         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7144
7145 2003-08-25  Martin Baulig  <martin@ximian.com>
7146
7147         * convert.cs (Convert.ExplicitReferenceConversion): When
7148         converting from an interface type to a class, unbox if the target
7149         type is a struct type.  Fixes #47822.
7150
7151 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7152
7153         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7154         #47854.
7155
7156 2003-08-22  Martin Baulig  <martin@ximian.com>
7157
7158         * class.cs (TypeManager.DefineType): When defining a nested type,
7159         call DefineType() on our parent; fixes #47801.
7160
7161 2003-08-22  Martin Baulig  <martin@ximian.com>
7162
7163         * class.cs (MethodData.Define): While checking if a method is an
7164         interface implementation, improve the test a bit more to fix #47654.
7165
7166 2003-08-22  Martin Baulig  <martin@ximian.com>
7167
7168         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7169         correctly; fixes #47722.
7170
7171 2003-08-22  Martin Baulig  <martin@ximian.com>
7172
7173         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7174         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7175
7176         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7177
7178 2003-08-22  Martin Baulig  <martin@ximian.com>
7179
7180         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7181         can only be assigned in static constructors.  Fixes #47161.
7182
7183 2003-08-22  Martin Baulig  <martin@ximian.com>
7184
7185         Rewrote and improved the flow analysis code.
7186
7187         * flowbranching.cs (FlowBranching): Make this class abstract.
7188         (FlowBranching.CreateBranching): New static function to create a
7189         new flow branching.
7190         (FlowBranchingBlock, FlowBranchingException): New classes.
7191         (FlowBranching.UsageVector.Type): New public readonly field.
7192         (FlowBranching.UsageVector.Breaks): Removed the setter.
7193         (FlowBranching.UsageVector.Returns): Removed the setter.
7194         (FlowBranching.UsageVector): Added Break(), Return(),
7195         NeverReachable() and Throw() methods to modify the reachability.
7196         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7197         done by FlowBranching.Merge().
7198         (FlowBranching.UsageVector.MergeChild): New method; merges the
7199         merge result into the current vector.
7200         (FlowBranching.Merge): New abstract method to merge a branching.
7201
7202 2003-08-12  Martin Baulig  <martin@ximian.com>
7203
7204         * expression.cs (Indirection.CacheTemporaries): Create the
7205         LocalTemporary with the pointer type, not its element type.
7206
7207 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7208
7209         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7210         token was a keyword or not.
7211
7212         Add `error' options where an IDENTIFIER was expected;  Provide
7213         CheckToken and CheckIdentifierToken convenience error reporting
7214         functions. 
7215
7216         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7217
7218         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7219         NameSpaceEntry NameSpaceEntry.
7220
7221         (LookupInterfaceOrClass): Avoid creating a full qualified name
7222         from namespace and name: avoid doing lookups when we know the
7223         namespace is non-existant.   Use new Tree.LookupByNamespace which
7224         looks up DeclSpaces based on their namespace, name pair.
7225
7226         * driver.cs: Provide a new `parser verbose' to display the
7227         exception thrown during parsing.  This is turned off by default
7228         now, so the output of a failure from mcs is more graceful.
7229
7230         * namespace.cs: Track all the namespaces defined in a hashtable
7231         for quick lookup.
7232
7233         (IsNamespace): New method
7234
7235 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7236
7237         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7238         we know that we need to concatenate (full typename can never be
7239         null). 
7240
7241         * class.cs: ditto.
7242
7243         * statement.cs: Use a bitfield;  Do not initialize to null things
7244         which are done by the constructor by default.
7245
7246         * cs-parser.jay: bug fix, parameter was 4, not 3.
7247
7248         * expression.cs: Just use the property;
7249
7250         * statement.cs: No need for GetVariableInfo method.
7251
7252 2003-08-08  Martin Baulig  <martin@ximian.com>
7253
7254         * flowanalysis.cs (FlowReturns): This is now nested in the
7255         `FlowBranching' class.
7256         (MyBitVector): Moved this here from statement.cs.
7257         (FlowBranching.SiblingType): New enum type.
7258         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7259
7260 2003-08-07  Martin Baulig  <martin@ximian.com>
7261
7262         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7263         `FlowBranching' class and called `BranchingType'.
7264
7265 2003-08-07  Martin Baulig  <martin@ximian.com>
7266
7267         * flowanalysis.cs: Moved all the control flow analysis code into
7268         its own file.
7269
7270 2003-08-07  Martin Baulig  <martin@ximian.com>
7271
7272         * assign.cs (Assign.DoResolve): `target' must either be an
7273         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7274         #37319.
7275
7276 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7277
7278         * expression.cs (BinaryMethod): This kind of expression is created by the
7279         Binary class if it determines that the operator has to be handled
7280         by a method.
7281
7282         (BinaryDelegate): This kind of expression is created if we are
7283         dealing with a + or - operator on delegates.
7284
7285         (Binary): remove method, argumetns, and DelegateOperator: when
7286         dealing with methods, 
7287
7288         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7289
7290         * statement.cs (Block): use bitfields for the three extra booleans
7291         we had in use.   Remove unused topblock parameter.
7292
7293         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7294
7295         * assign.cs: Drop extra unneeded tests.
7296
7297 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7298
7299         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7300
7301         * statement.cs (Foreach): Use VariableStorage instead of
7302         LocalBuilders.   
7303
7304         * codegen.cs (VariableStorage): New class used by clients that
7305         require a variable stored: locals or fields for variables that
7306         need to live across yield.
7307
7308         Maybe provide a convenience api for EmitThis+EmitLoad?
7309
7310         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7311         these bad boys.
7312
7313 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7314
7315         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7316         RemapParameterLValue): New methods that are used to turn a
7317         precomputed FieldInfo into an expression like this:
7318
7319                 instance.FieldInfo
7320
7321         The idea is to use this instead of making LocalVariableReference
7322         have more than one meaning.
7323
7324         * cs-parser.jay: Add error production to BASE.
7325
7326         * ecore.cs: Deal with TypeManager.GetField returning null, which
7327         is now a valid return value.
7328
7329         (FieldExprNoAddress): New expression for Fields whose address can
7330         not be taken.
7331
7332         * expression.cs (LocalVariableReference): During the resolve
7333         phases, create new expressions if we are in a remapping context.
7334         Remove code that dealt with remapping here.
7335
7336         (ParameterReference): same.
7337
7338         (ProxyInstance): New expression, like the `This' expression, but
7339         it is born fully resolved.  We know what we are doing, so remove
7340         the errors that are targeted to user-provided uses of `this'.
7341
7342         * statement.cs (Foreach): our variable is now stored as an
7343         Expression;  During resolution, follow the protocol, dont just
7344         assume it will return this.
7345
7346 2003-08-06  Martin Baulig  <martin@ximian.com>
7347
7348         * support.cs (SeekableStreamReader.cs): New public class.
7349
7350         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7351         SeekableStreamReader instead of the normal StreamReader.
7352
7353 2003-08-04  Martin Baulig  <martin@ximian.com>
7354
7355         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7356         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7357         deambiguate casts and delegate invocations.
7358         (parenthesized_expression): Use the new tokens to ensure this is
7359         not a cast of method invocation.
7360
7361         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7362         when reading a `)' and Deambiguate_CloseParens () was previously
7363         called.
7364
7365         * expression.cs (ParenthesizedExpression): New class.  This is
7366         just used for the CS0075 test.
7367         (Binary.DoResolve): Check for CS0075.   
7368
7369 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7370
7371         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7372         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7373         reference comparison.
7374
7375         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7376         examine the ReturnType for equality - this is necessary in the
7377         cases of implicit and explicit operators whose signature also
7378         includes the return type.
7379
7380 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7381
7382         * namespace.cs: Cache the result of the namespace computation,
7383         instead of computing it every time.
7384
7385 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7386
7387         * decl.cs: Use a global arraylist that we reuse over invocations
7388         to avoid excesive memory consumption.  Reduces memory usage on an
7389         mcs compile by one meg (45 average).
7390
7391         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7392         private, work around that.
7393
7394 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7395
7396         * literal.cs (IntLiteral): Define Zero and One static literals. 
7397
7398         * cs-parser.jay (integer_literal): use static literals to reduce
7399         memory usage for the most used literals (0, 1 and -1).  211kb
7400         reduced in memory usage.
7401
7402         Replace all calls to `new ArrayList' with `new
7403         ArrayList(4)' which is a good average number for most allocations,
7404         and also requires only 16 bytes of memory for its buffer by
7405         default. 
7406
7407         This reduced MCS memory usage in seven megabytes for the RSS after
7408         bootstrapping.
7409
7410 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7411
7412         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7413         handle params methods the correct way by forming only one
7414         applicable set with params and normal methods in them. Earlier we
7415         were looking at params methods only if we found no normal methods
7416         which was not the correct thing to do.
7417
7418         (Invocation.BetterFunction): Take separate arguments indicating
7419         when candidate and the best method are params methods in their
7420         expanded form.
7421
7422         This fixes bugs #43367 and #46199.
7423
7424         * attribute.cs: Documentation updates.
7425
7426         (CheckAttribute): Rename to CheckAttributeTarget.
7427         (GetValidPlaces): Rename to GetValidTargets.
7428
7429         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7430         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7431
7432         Fixes bug #44468.
7433
7434 2003-07-28  Martin Baulig  <martin@ximian.com>
7435
7436         * class.cs (TypeContainer.DefineMembers): Use the base type's full
7437         name when looking up the base class of a nested class.  Fixes #46977.
7438
7439 2003-07-26  Martin Baulig  <martin@ximian.com>
7440
7441         * expression.cs (Indexers.Indexer): New nested struct; contains
7442         getter, setter and the indexer's type.
7443         (Indexers.Properties): This is now an ArrayList of
7444         Indexers.Indexer's.
7445         (IndexerAccess.DoResolveLValue): Correctly set the type if the
7446         indexer doesn't have any getters.
7447
7448         * assign.cs (Assign.DoResolve): Also do the implicit conversions
7449         for embedded property and indexer assignments.
7450
7451 2003-07-26  Martin Baulig  <martin@ximian.com>
7452
7453         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
7454         preprocessor directive is not the first non-whitespace character
7455         on a line.
7456
7457 2003-07-26  Martin Baulig  <martin@ximian.com>
7458
7459         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
7460         namespace parsing, follow the spec more closely.
7461
7462         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
7463         NamespaceEntry.Lookup().
7464
7465 2003-07-25  Martin Baulig  <martin@ximian.com>
7466
7467         * MethodCore.cs (OverridesSomething): New public field; it's set
7468         from TypeContainer.DefineMembers if this method overrides
7469         something (which doesn't need to be a method).  Fix #39462.
7470
7471 2003-07-25  Ravi Pratap  <ravi@ximian.com>
7472
7473         * typemanager.cs (GetMembers): Ensure that the list of members is
7474         reversed. This keeps things in sync.
7475
7476         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
7477         find an AttributeUsage attribute.
7478
7479         * expression.cs (Invocation.OverloadResolve): Perform the check
7480         which disallows Invoke to be directly called on a Delegate.
7481
7482         (Error_InvokeOnDelegate): Report error cs1533.
7483
7484 2003-07-25  Martin Baulig  <martin@ximian.com>
7485
7486         * expression.cs (Indexers.GetIndexersForType): Only look in the
7487         interface hierarchy if the requested type is already an
7488         interface.  Fixes #46788 while keeping #46502 fixed.
7489
7490 2003-07-25  Martin Baulig  <martin@ximian.com>
7491
7492         * class.cs (TypeContainer.DefineMembers): Check whether all
7493         readonly fields have been assigned and report warning CS0649 if
7494         not.
7495
7496         * statement.cs (LocalInfo.IsFixed): Always return true if this is
7497         a valuetype.
7498
7499 2003-07-24  Ravi Pratap  <ravi@ximian.com>
7500
7501         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
7502         returned from GetMethods to make things consistent with the
7503         assumptions MCS makes about ordering of methods.
7504
7505         This should comprehensively fix bug #45127 and it does :-)
7506
7507         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
7508         ordering is actually reverse.
7509
7510         * Clean up some debug messages I left lying around.
7511
7512         * interface.cs (Populate*): Get rid of code which emits attributes
7513         since the stage in which we emit attributes is the 'Emit' stage,
7514         not the define stage.
7515
7516         (Emit): Move attribute emission for interface members here.
7517
7518 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7519
7520         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7521         closely: we eliminate methods in base types when we have an
7522         applicable method in a top-level type.
7523
7524         Please see section 14.5.5.1 for an exact description of what goes
7525         on. 
7526
7527         This fixes bug #45127 and a host of other related to corlib compilation.
7528
7529         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7530         array is the method corresponding to the top-level type (this is
7531         because of the changes made to icall.c) so we change this
7532         accordingly.
7533
7534         (MethodGroupExpr.Name): This too.
7535
7536         * typemanager.cs (GetElementType): New method which does the right
7537         thing when compiling corlib. 
7538
7539         * everywhere: Make use of the above in the relevant places.
7540
7541 2003-07-22  Martin Baulig  <martin@ximian.com>
7542
7543         * cs-parser.jay (invocation_expression): Moved
7544         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7545         `cast_expression', but create a InvocationOrCast which later
7546         resolves to either an Invocation or a Cast.
7547
7548         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7549         method; call this before EmitStatement() to make sure that this
7550         expression can be used as a statement.
7551
7552         * expression.cs (InvocationOrCast): New class; resolves to either
7553         an Invocation or a Cast.
7554
7555         * statement.cs (StatementExpression): Call ResolveStatement() on
7556         the ExpressionStatement before emitting it.
7557
7558 2003-07-21  Martin Baulig  <martin@ximian.com>
7559
7560         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7561         `ref' and `out' attributes match; fixes #46220.
7562         (MemberAccess.ResolveMemberAccess): You can't reference a type
7563         through an expression; fixes #33180.
7564         (Indexers.GetIndexersForType): Don't return the indexers from
7565         interfaces the class implements; fixes #46502.
7566
7567 2003-07-21  Martin Baulig  <martin@ximian.com>
7568
7569         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7570         CS0661 checks; fixes bug #30442.
7571
7572 2003-07-21  Martin Baulig  <martin@ximian.com>
7573
7574         * decl.cs (AdditionResult): Added `Error'.
7575
7576         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7577
7578         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
7579         makes cs0031.cs actually work.
7580
7581 2003-07-20  Martin Baulig  <martin@ximian.com>
7582
7583         * namespace.cs: Fixed that bug which caused a crash when compiling
7584         the debugger's GUI.
7585
7586 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7587
7588         * typemanager.cs (LookupTypeReflection): Never expose types which
7589         are NotPublic, NestedPrivate, NestedAssembly, or
7590         NestedFamANDAssem.  We used to return these, and later do a check
7591         that would report a meaningful error, but the problem is that we
7592         would not get the real match, if there was a name override.
7593
7594 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7595
7596         * namespace.cs (Namespace, Name): Do not compute the namespace
7597         name dynamically, compute it in the constructor.  This reduced
7598         memory usage by 1697 KB.
7599
7600         * driver.cs: Use --pause to pause at the end.
7601
7602 2003-07-17  Peter Williams  <peter@newton.cx>
7603
7604         * Makefile: Change the name of the test target so that it doesn't
7605         conflict with the recursive test target.
7606
7607 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7608
7609         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7610         AddressOf): Do not use EmitThis, that was wrong, use the actual
7611         this pointer.
7612
7613 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7614
7615         * class.cs (MethodData.Define): While checking if a method is an
7616         interface implementation, improve the test: If we are not public
7617         (use new test here: use the computed MethodAttributes directly,
7618         instead of the parsed modifier flags) check if the `implementing'
7619         method comes from an interface or not.
7620
7621         * pending.cs (VerifyPendingMethods): Slightly better error
7622         message.
7623
7624         * makefile: add test target that does the mcs bootstrap.
7625
7626 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7627
7628         * interface.cs (Define): Do nothing here since there are no
7629         members to populate etc. Move the attribute emission out of here
7630         since this was just totally the wrong place to put it. Attribute
7631         application happens during the 'Emit' phase, not in the 'Define'
7632         phase.
7633
7634         (Emit): Add this method and move the attribute emission here
7635
7636         * rootcontext.cs (EmitCode): Call the Emit method on interface
7637         types too.
7638
7639 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7640
7641         * expression.cs (OverloadResolve): Report error only if Location
7642         is not 'Null' which means that there was a probe going on.
7643
7644 2003-07-14  Martin Baulig  <martin@ximian.com>
7645
7646         * expression.cs (ConditionalLogicalOperator): New public class to
7647         implement user defined conditional logical operators.
7648         This is section 14.11.2 in the spec and bug #40505.
7649
7650 2003-07-14  Martin Baulig  <martin@ximian.com>
7651
7652         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7653
7654 2003-07-14  Martin Baulig  <martin@ximian.com>
7655
7656         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7657
7658         * ecore.cs (IVariable.VerifyFixed): New interface method.
7659
7660         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7661         operator, check whether the variable is actually fixed.  Fixes bug
7662         #36055.  Set a variable definitely assigned when taking its
7663         address as required by the spec.
7664
7665         * statement.cs (LocalInfo.IsFixed): New field.
7666         (LocalInfo.MakePinned): Set `IsFixed' to true.
7667
7668 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7669
7670         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7671         for .ctors, ensure that we only ask for members declared in the
7672         attribute type (BindingFlags.DeclaredOnly).
7673
7674         Fixes bug #43632.
7675
7676         * expression.cs (Error_WrongNumArguments): Report error 1501
7677         correctly the way CSC does.
7678
7679 2003-07-13  Martin Baulig  <martin@ximian.com>
7680
7681         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7682         lookup on the fully qualified name, to make things like "X.X" work
7683         where "X.X" is a fully qualified type name, but we also have a
7684         namespace "X" in the using list.  Fixes #41975.
7685
7686 2003-07-13  Martin Baulig  <martin@ximian.com>
7687
7688         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7689         function. If we're a CompoundAssign, we need to create an embedded
7690         CompoundAssign, not an embedded Assign.
7691         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7692         Fixes #45854.
7693
7694 2003-07-13  Martin Baulig  <martin@ximian.com>
7695
7696         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7697         work to fix bug #46088.
7698
7699 2003-07-13  Ravi Pratap <ravi@ximian.com>
7700
7701         * class.cs (Operator.Emit): Do not emit attributes here - it is
7702         taken care of by the Method class that we delegate too. This takes
7703         care of bug #45876.
7704
7705 2003-07-10  Martin Baulig  <martin@ximian.com>
7706
7707         * expression.cs (TypeOfVoid): New class.
7708         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7709
7710 2003-07-10  Martin Baulig  <martin@ximian.com>
7711
7712         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7713         bug #35957.
7714
7715 2003-07-10  Martin Baulig  <martin@ximian.com>
7716
7717         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7718         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7719
7720         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7721
7722         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7723
7724 2003-07-10  Martin Baulig  <martin@ximian.com>
7725
7726         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7727         of decimal.  Fixes #42850.
7728
7729         NOTE: I also fixed the created byte blob, but this doesn't work on
7730         the MS runtime and csc never produces any byte blobs for decimal
7731         arrays.
7732
7733 2003-07-10  Martin Baulig  <martin@ximian.com>
7734
7735         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7736         structs; fixes #32068.
7737         (Block.AddChildVariableNames): Fixed #44302.
7738
7739 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7740
7741         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7742
7743 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7744
7745         * attribute.cs: And this test is onger needed.
7746
7747 2003-07-08  Martin Baulig  <martin@ximian.com>
7748
7749         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7750         inaccessible types.  Fixes #36313.
7751
7752         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7753
7754         * namespace.cs (NamespaceEntry): Create implicit entries for all
7755         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7756         implicit entries for N1.N2 and N1.
7757
7758 2003-07-08  Martin Baulig  <martin@ximian.com>
7759
7760         Rewrote the handling of namespaces to fix a lot of the issues
7761         wrt. `using' aliases etc.
7762
7763         * namespace.cs (Namespace): Splitted this class into a
7764         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7765
7766         * typemanager.cs (TypeManager.IsNamespace): Removed.
7767         (TypeManager.ComputeNamespaces): Only compute namespaces from
7768         loaded assemblies here, not the namespaces from the assembly we're
7769         currently compiling.
7770
7771 2003-07-08  Martin Baulig  <martin@ximian.com>
7772
7773         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7774
7775 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7776
7777         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7778         already fixed it.  
7779
7780         I thought about the memory savings here, but LookupTypeReflection
7781         is used under already very constrained scenarios.  Compiling
7782         corlib or mcs only exposes one hit, so it would not really reduce
7783         any memory consumption.
7784
7785 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7786
7787         * typemanager.cs: fixes bug #45889 by only adding public types from
7788         other assemblies to the list of known types.
7789
7790 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7791
7792         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7793         on the type we resolved.
7794
7795 2003-07-05  Martin Baulig  <martin@ximian.com>
7796
7797         * pending.cs (PendingImplementation.ParentImplements): Don't
7798         create the proxy if the parent is abstract.
7799
7800         * class.cs (TypeContainer.DefineIndexers): Process explicit
7801         interface implementations first.  Fixes #37714.
7802
7803 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7804
7805         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7806         defined recursively;  but since we modify the input parameters
7807         (left is set to `this' temporarily), we reset this value if the
7808         left_is_explicit is false, which gives the original semantics to
7809         the code.  
7810
7811         * literal.cs (NullPointer): new class used to represent a null
7812         literal in a pointer context.
7813
7814         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7815         type is a pointer, use a NullPointer object instead of a
7816         NullLiteral.   Closes 43687
7817
7818         (ExplicitConversion): Convert pointer values using
7819         the conv opcode to the proper type.
7820
7821         * ecore.cs (New): change ValueTypeVariable property into a method,
7822         that returns whether the valuetype is suitable for being used.
7823
7824         * expression.cs (Binary.DoNumericPromotions): Only return if we
7825         the int constant was a valid uint, and we can return both left and
7826         right as uints.  If not, we continue processing, to trigger the
7827         type conversion.  This fixes 39018.
7828
7829         * statement.cs (Block.EmitMeta): During constant resolution, set
7830         the CurrentBlock property on the emitcontext, so that we resolve
7831         constants propertly.
7832
7833 2003-07-02  Martin Baulig  <martin@ximian.com>
7834
7835         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7836         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7837
7838         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7839         than emitting it here.
7840
7841         * statement.cs: Fixed some more flow analysis bugs.
7842
7843 2003-07-02  Martin Baulig  <martin@ximian.com>
7844
7845         * class.cs (MethodData.Define): When implementing interface
7846         methods, set Final unless we're Virtual.
7847
7848         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7849         check work for interface methods.
7850
7851 2003-07-01  Martin Baulig  <martin@ximian.com>
7852
7853         * ecore.cs (EmitContext.This): Replaced this property with a
7854         GetThis() method which takes a Location argument.  This ensures
7855         that we get the correct error location for a CS0188.
7856
7857 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7858
7859         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7860         ImplicitStandardConversion.
7861
7862         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7863
7864 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7865
7866         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7867         optimization.
7868
7869 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7870
7871         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7872         constructors.
7873
7874         (MethodData.Define): Turn off initlocals for unsafe methods.
7875
7876 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7877
7878         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7879         complete;  Fixes #37521.
7880
7881         * delegate.cs: Use Modifiers.TypeAttr to compute the
7882         TypeAttributes, instead of rolling our own.  This makes the flags
7883         correct for the delegates.
7884
7885 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7886
7887         * class.cs (Constructor.Define): Set the private flag for static
7888         constructors as well.
7889
7890         * cs-parser.jay (statement_expression): Set the return value to
7891         null, to avoid a crash when we catch an error.
7892
7893 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7894
7895         * cs-parser.jay: Applied patch from Jackson that adds support for
7896         extern and unsafe modifiers to destructor declarations.
7897
7898         * expression.cs: Report error 21 if the user is trying to index a
7899         System.Array.
7900
7901         * driver.cs: Add an error message, suggested by the bug report.
7902
7903         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7904         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7905
7906 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7907
7908         * namespace.cs: Add some information to reduce FAQs.
7909
7910 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7911
7912         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7913         underlying enumeration types.  Fixes #43915.
7914
7915         * expression.cs: Treat ushort/short as legal values to be used in
7916         bitwise operations.
7917
7918 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7919
7920         * delegate.cs: transfer custom attributes for paramenters from
7921         the delegate declaration to Invoke and BeginInvoke.
7922
7923 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7924
7925         * attribute.cs: handle custom marshalers and emit marshal info
7926         for fields, too.
7927
7928 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7929
7930         * makefile.gnu: Added anonymous.cs to the compiler sources.
7931
7932 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7933
7934         * iterators.cs: Change the name of the proxy class to include two
7935         underscores.
7936
7937         * cs-parser.jay: Update grammar to include anonymous methods.
7938
7939         * anonymous.cs: new file.
7940
7941 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7942
7943         * class.cs (Field.Define): Add missing test for pointers and
7944         safety. 
7945
7946 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7947
7948         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7949         we use the stobj opcode.
7950
7951         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7952         since it wasn't the correct fix. 
7953
7954         It still is puzzling that we are required to use stobj for IntPtr
7955         which seems to be a ValueType.
7956
7957 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7958
7959         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7960         during regular simple name resolution.   Now, the trick is that
7961         instead of returning for processing the simplename, we do a
7962         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7963         contextual lookup type).   If a match is found, return that, if
7964         not, return for further composition.
7965
7966         This fixes long-standing 30485.
7967
7968         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7969         using the address to initialize an object, do an Stobj instead of
7970         using the regular Stelem.
7971
7972         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7973         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7974         Because if we are a BaseIndexerAccess that value will be true.
7975         Fixes 43643.
7976
7977         * statement.cs (GotoCase.Resolve): Return after reporting an
7978         error, do not attempt to continue. 
7979
7980         * expression.cs (PointerArithmetic.Emit): If our operand is a
7981         long, convert our constants to match the operand before
7982         multiplying.  Convert to I type before adding.   Fixes 43670.
7983
7984 2003-05-14  Ravi Pratap  <ravi@ximian.com>
7985
7986         * enum.cs (ImplicitConversionExists) : Rename to
7987         ImplicitEnumConversionExists to remove ambiguity. 
7988
7989         * ecore.cs (NullCast): New type of cast expression class which
7990         basically is very similar to EmptyCast with the difference being
7991         it still is a constant since it is used only to cast a null to
7992         something else
7993         (eg. (string) null)
7994
7995         * convert.cs (ImplicitReferenceConversion): When casting a null
7996         literal, we return a NullCast.
7997
7998         * literal.cs (NullLiteralTyped): Remove - I don't see why this
7999         should be around anymore.
8000
8001         The renaming (reported was slightly wrong). Corrections:
8002
8003         ConvertImplicitStandard -> ImplicitConversionStandard
8004         ConvertExplicitStandard -> ExplicitConversionStandard
8005
8006         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8007         before passing them in !
8008
8009         * convert.cs (ImplicitConversionStandard): When comparing for
8010         equal expr and target types, ensure that expr is not a
8011         NullLiteral.
8012
8013         In general, we must not be checking (expr_type ==
8014         target_type) in the top level conversion methods
8015         (ImplicitConversion, ExplicitConversion etc). This checking is
8016         done in the methods that they delegate to.
8017
8018 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8019
8020         * convert.cs: Move Error_CannotConvertType,
8021         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8022         ImplicitNumericConversion, ImplicitConversionExists,
8023         ImplicitUserConversionExists, StandardConversionExists,
8024         FindMostEncompassedType, FindMostSpecificSource,
8025         FindMostSpecificTarget, ImplicitUserConversion,
8026         ExplicitUserConversion, GetConversionOperators,
8027         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8028         TryImplicitIntConversion, Error_CannotConvertImplicit,
8029         ConvertImplicitRequired, ConvertNumericExplicit,
8030         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8031         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8032         its own file.
8033
8034         Perform the following renames:
8035
8036         StandardConversionExists -> ImplicitStandardConversionExists
8037         ConvertImplicit -> ImplicitConversion
8038         ConvertImplicitStandard -> ImplicitStandardConversion
8039         TryImplicitIntConversion -> ImplicitIntConversion
8040         ConvertImplicitRequired -> ImplicitConversionRequired
8041         ConvertNumericExplicit -> ExplicitNumericConversion
8042         ConvertReferenceExplicit -> ExplicitReferenceConversion
8043         ConvertExplicit -> ExplicitConversion
8044         ConvertExplicitStandard -> ExplicitStandardConversion
8045
8046 2003-05-19  Martin Baulig  <martin@ximian.com>
8047
8048         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8049         (TypeInfo): Added support for structs having structs as fields.
8050
8051         * ecore.cs (FieldExpr): Implement IVariable.
8052         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8053         VariableInfo for the field.
8054
8055 2003-05-18  Martin Baulig  <martin@ximian.com>
8056
8057         * expression.cs (This.DoResolve): Report a CS0027 if we're
8058         emitting a field initializer.
8059
8060 2003-05-18  Martin Baulig  <martin@ximian.com>
8061
8062         * expression.cs (This.ResolveBase): New public function.
8063         (This.DoResolve): Check for CS0188.
8064
8065         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8066         This.Resolve().
8067
8068         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8069         `instance_expression' to null if we don't have any non-static
8070         methods.
8071
8072 2003-05-18  Martin Baulig  <martin@ximian.com>
8073
8074         Reworked the way how local variables and parameters are handled by
8075         the flow analysis code.
8076
8077         * statement.cs (TypeInfo, VariableMap): New public classes.
8078         (VariableInfo): New public class.  This is now responsible for
8079         checking whether a variable has been assigned.  It is used for
8080         parameters and local variables.
8081         (Block.EmitMeta): Take the InternalParameters as argument; compute
8082         the layout of the flow vectors here.
8083         (Block.LocalMap, Block.ParameterMap): New public properties.
8084         (FlowBranching): The .ctor doesn't get the InternalParameters
8085         anymore since Block.EmitMeta() now computes the layout of the flow
8086         vector.
8087         (MyStructInfo): This class is now known as `StructInfo' and nested
8088         in `TypeInfo'; we don't access this directly anymore.
8089
8090         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8091         property and removed IsAssigned(), IsFieldAssigned(),
8092         SetAssigned() and SetFieldAssigned(); we now call them on the
8093         VariableInfo so we don't need to duplicate this code everywhere.
8094
8095         * expression.cs (ParameterReference): Added `Block block' argument
8096         to the .ctor.
8097         (LocalVariableReference, ParameterReference, This): The new
8098         VariableInfo class is now responsible for all the definite
8099         assignment stuff.
8100
8101         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8102         IsParameterAssigned, SetParameterAssigned): Removed.
8103
8104 2003-05-18  Martin Baulig  <martin@ximian.com>
8105
8106         * typemanager.cs (InitCoreTypes): Try calling
8107         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8108         the 3-args-version.  Corlib now also needs our `void_type'.
8109         (GetMethod): Added overloaded version which takes an optional
8110         `bool report_errors' to allow lookups of optional methods.
8111
8112 2003-05-12  Martin Baulig  <martin@ximian.com>
8113
8114         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8115         only used for locals and not for parameters.
8116
8117 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8118
8119         * support.cs (InternalParameters.ParameterType): Return the
8120         ExternalType of the parameter.
8121
8122         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8123         they were unused.
8124
8125 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * class.cs (MethodData.Define): Do not set the `newslot' on
8128         interface members, if they are also flagged as "override".
8129
8130         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8131         better code for ++i and i++.  This only works for static fields
8132         and local variables.
8133
8134         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8135         want to pull the DeclSpace out of the builder_to_declspace instead
8136         of the TypeBuilder (like in TypeContainer.FindMembers).
8137
8138         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8139         instead of LookupTypeContainer.  Fixes the crash on .NET for
8140         looking up interface members.
8141
8142         * const.cs: Create our own emit context during the Definition
8143         stage, so that constants are evaluated in the proper context, when
8144         a recursive definition happens.
8145
8146 2003-05-11  Martin Baulig  <martin@ximian.com>
8147
8148         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8149         new block for a switch section.
8150         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8151         the adding/lookup in the switch block.  Fixes #39828.
8152
8153 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8154
8155         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8156         functionality: I needed to convert the data after I had performed
8157         the add/sub operation into the operands type size.
8158
8159         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8160         pass the type for the box operation, otherwise the resulting
8161         object would have been of type object.
8162
8163         (BoxedCast): Add constructor to specify the type to box as.
8164
8165 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8166
8167         * iterators.cs: I was reusing the `count' variable inadvertently,
8168         take steps to not allow this to happen.
8169
8170 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8171
8172         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8173         by creating an array at the point where the params starts and
8174         putting all those arguments there, then adjusting the size of the
8175         array.
8176
8177 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8178
8179         * expression.cs (New.AddressOf): Implement interface
8180         IMemoryLocation.  This is used when the `new' operator is used in
8181         the context of an invocation to a method on a value type.
8182
8183         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8184         example. 
8185
8186         * namespace.cs: Also check the using aliases here.
8187
8188         * driver.cs: Move the test for using validity after the types have
8189         been entered, so we do a single pass that also includes the using
8190         aliases. 
8191
8192         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8193         in the regular case.   CreateSiblingForFinally is doing extra
8194         error checking.
8195
8196         * attribute.cs (GetAttributeArgumentExpression): Store the result
8197         on an out value, and use the return value to indicate failure
8198         instead of using null (which is a valid return for Constant.GetValue).
8199
8200         * statement.cs: Perform the analysis flow for the increment
8201         portion after the statement, because this will be the real flow of
8202         execution.  Fixes #42385
8203
8204         * codegen.cs (EmitContext.EmitArgument,
8205         EmitContext.EmitStoreArgument): New helper functions when the
8206         RemapToProxy flag is set.
8207
8208         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8209         function.
8210
8211         Add support for remapping parameters. 
8212
8213         * iterators.cs: Propagate parameter values;  Store parameter
8214         values in the proxy classes.
8215
8216 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8217
8218         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8219         need a proxy reference;  I do not know what I was thinking
8220
8221         * cs-parser.jay (constructor_initializer): catch another error,
8222         and display nice message.
8223
8224         (field_declaration): catch void field declaration
8225         to flag a better error. 
8226
8227         * class.cs (MemberBase.CheckBase): Report an error instead of a
8228         warning if a new protected member is declared in a struct. 
8229         (Field.Define): catch the error of readonly/volatile.
8230
8231         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8232
8233         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8234         volatile variable is taken
8235
8236 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8237
8238         * statement.cs (Fixed.Resolve): Report an error if we are not in
8239         an unsafe context.
8240
8241 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8242
8243         * typemanager.cs: reuse the code that handles type clashes for
8244         delegates and enumerations.
8245
8246         * class.cs (Report28): Always report.
8247
8248         * expression.cs (EncodeAsAttribute): Allow nulls here.
8249
8250 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8251
8252         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8253         the functionality for testing whether an expression is valid for
8254         an attribute here.  Also handle the case of arrays of elements
8255         being stored. 
8256
8257         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8258         encoding a linear array into an array of objects that are suitable
8259         to be passed to an CustomAttributeBuilder.
8260
8261         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8262
8263         * ecore.cs: (FieldExpr): Handle field remapping here.
8264
8265         * iteratators.cs: Pass the instance variable (if the method is an
8266         instance method) to the constructors, so we can access the field
8267         variables on the class.
8268
8269         TODO: Test this with structs.  I think the THIS variable on
8270         structs might have to be a pointer, and not a refenrece
8271
8272 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8273
8274         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8275         local variables to fields in a proxy class.
8276
8277         * iterators.cs (PopulateProxy): Rename our internal fields to
8278         <XXX>.  
8279         Create a <THIS> field if we are an instance method, so we can
8280         reference our parent container variables.
8281         (MapVariable): Called back from the EmitContext code to enter a
8282         new variable to field mapping into the proxy class (we just create
8283         a FieldBuilder).
8284
8285         * expression.cs
8286         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8287         for using the remapped locals to fields.
8288
8289         I placed the code here, because that gives the same semantics to
8290         local variables, and only changes the Emit code.
8291
8292         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8293         statements inside iterators.
8294         (VariableInfo): Add a FieldBuilder for the cases when we are
8295         remapping local variables to fields in a proxy class
8296
8297         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8298         current_block != null.
8299
8300         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8301         not cope with strings, as it has been moved to the
8302         TableSwitchEmit.  Fixed bug in switch generation.
8303
8304         * expression.cs (New.DoResolve): Provide more context for the user
8305         when reporting an error.
8306
8307         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8308         pointers. 
8309
8310         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8311         check the permissions for it.  Note than in a type-resolution
8312         context the check was already present in DeclSpace.ResolveType,
8313         but was missing from the MemberAccess.
8314
8315         (ArrayCreation.CheckIndices): warn if the user has
8316         more nested levels of expressions, but there are no more
8317         dimensions specified.  Avoids crash on bug 41906.
8318
8319 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8320
8321         * statement.cs (Block): replace Implicit bool, for a generic
8322         flags.   
8323         New flag: `Unchecked'.  This is used during the EmitMeta phase
8324         (which is out-of-line with the regular Resolve/Emit process for a
8325         statement, as this is done ahead of time, but still gets a chance
8326         to call constant resolve).
8327
8328         (Block.Flags): new enum for adding a new flag.
8329
8330         (Block.EmitMeta): track the state of unchecked.
8331
8332         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8333         to enable constant resolution to work there as well.
8334
8335 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8336
8337         * typemanager.cs (ienumerable_type): Also look up
8338         System.Collections.IEnumerable. 
8339
8340 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8341
8342         TODO: Test more than one conditional per method.
8343
8344         * class.cs (Indexer.Define): Report the location where the user is
8345         referencing the unsupported feature.
8346
8347         (MethodData): Overload the use of `conditionals' to
8348         minimize the creation of needless ArrayLists.   This saves roughly
8349         212kb on my machine.
8350
8351         (Method): Implement the new IIteratorContainer interface.
8352         (Method.SetYields): Implement the method by setting the ModFlags
8353         to contain METHOD_YIELDS.
8354
8355         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8356         which just got set to null.
8357
8358         * iterators.cs: New file.
8359
8360         (Yield, YieldBreak): New statements.
8361
8362         * statement.cs (Return.Resolve): Flag an error if we are used in
8363         an iterator method.
8364
8365         * codegen.cs (InIterator): New flag set if the code is being
8366         compiled in an iterator method.
8367
8368         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8369         internal modifier, and we just use it to avoid adding extra
8370         fields, as this is seldom used.  
8371
8372         * cs-parser.jay: Add yield_statement (yield and yield break).
8373
8374         * driver.cs: New flag -v2 to turn on version 2 features. 
8375
8376         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8377         hashtable when v2 is enabled.
8378
8379 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8380
8381         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8382         there is already a namespace defined with this name.
8383
8384         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8385         people upgraded their corlibs.
8386
8387         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8388         always use fully qualified types, no need to use the compiler
8389         front end.
8390
8391         (TypeManager.IsNamespace): Use binarysearch.
8392
8393         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8394         AddDelegate): I did not quite use the new IsValid API properly: I
8395         have to pass the short-name and the fullname.  I was passing only
8396         the basename instead of the fullname sometimes. 
8397
8398         (TypeContainer.DefineType): call NamespaceClash.
8399
8400         * interface.cs (Interface.DefineType): use NamespaceClash before
8401         defining the type.
8402
8403         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8404         defining the type.
8405
8406         * enum.cs: (Enum.DefineType): use NamespaceClash before
8407         defining the type.
8408
8409         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8410         speed increase.  First, use the negative_hits cache when we get a
8411         negative.  Second, add the type with its full original name
8412         instead of the new . and + encoded name (reflection uses + to
8413         separate type from a nested type).  Use LookupTypeReflection
8414         directly which bypasses the type->name hashtable (that we already
8415         know does not contain the type.
8416
8417         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8418         location/container type. 
8419
8420         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8421
8422 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8423
8424         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8425
8426         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8427         method is being referenced in the method group from a static
8428         context, and report error 120 if so.
8429
8430         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8431         Error118. 
8432
8433         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8434         is created, we create the A namespace).
8435
8436         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8437         Fixes #41591
8438
8439 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8440
8441         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8442         invocation to ModuleBuilder.GetType with the same values will
8443         return a new type instance, so we need to cache its return
8444         values. 
8445
8446         * expression.cs (Binary.ResolveOperator): Only allow the compare
8447         operators on enums if they are of the same type.
8448
8449         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8450         types of ValueType on their own case.  Before we were giving them
8451         the same treatment as objects.
8452
8453         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8454         fullname.  Short name is used to compare against container name.
8455         Fullname is used to check against defined namespace names.
8456
8457         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8458         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8459
8460         (Method.CheckBase): Call parent.
8461         (MemberBase.CheckBase): Check for protected members on sealed
8462         classes.
8463         (PropertyBase.CheckBase): Call parent.
8464         (Field.Define): Call parent.
8465
8466         * report.cs: Negative error codes are now mapped to 8000 - code,
8467         so that the display is render more nicely.
8468
8469         * typemanager.cs: Do not use try/catch, instead report a regular
8470         error. 
8471
8472         (GetPointerType, GetReferenceType): These methods provide
8473         mechanisms to obtain the T* and T& from a T.  We had the code
8474         previously scattered around the code base, and it also used
8475         TypeManager.LookupType that would go through plenty of caches.
8476         This one goes directly to the type source.
8477
8478         In some places we did the Type.GetType followed by
8479         ModuleBuilder.GetType, but not in others, so this unifies the
8480         processing as well.
8481
8482         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8483         statements now that we have namespace information.
8484
8485         * typemanager.cs (IsNamespace): New method, returns whether the
8486         string presented is a namespace or not.
8487
8488         (ComputeNamespaces): New public entry point, computes the list of
8489         available namespaces, using the GetNamespaces API call in Mono, or
8490         the slower version in MS.NET.   
8491
8492         Now before we start the semantic analysis phase, we have a
8493         complete list of namespaces including everything that the user has
8494         provided.
8495
8496         Deleted old code to cache namespaces in .nsc files.
8497
8498 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8499
8500         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8501         class/struct location definition Location for the implicit
8502         constructor location.
8503
8504         (Operator.Define): Use the location of the operator for the
8505         implicit Method definition.
8506
8507         (Constructor.Emit): use the constructor location for the implicit
8508         base initializer constructor.
8509
8510         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8511         and the Expression class now contains two new methods:
8512
8513         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8514         isolate type lookup from the rest of the resolution process.
8515
8516         Since we use Expressions to hold type definitions due to the way
8517         we parse the input we have historically overloaded Resolve to
8518         perform the Type lookups if a special flag is passed.  Now this is
8519         eliminated and two methods take their place. 
8520
8521         The differences in the two methods between xStep and xTerminal is
8522         that xStep is involved in our current lookup system that uses
8523         SimpleNames to compose a name, while xTerminal is used just to
8524         catch the case where the simplename lookup failed.
8525
8526 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8527
8528         * expression.cs (ResolveMemberAccess): Remove redundant code.
8529         TypeExpr expressions are always born fully resolved.
8530
8531         * interface.cs (PopulateMethod): Do not lookup the types twice.
8532         We were doing it once during SemanticAnalysis and once during
8533         PopulateMethod.
8534
8535         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8536         in local variable type definitions, were being returned as a
8537         SimpleName (we decomposed everything into a string), that is
8538         because primary_expression was being used instead of a type in the
8539         grammar (reduce/reduce conflicts).
8540
8541         The part that was wrong is that we converted the expression into a
8542         string (an oversimplification in one hand, compounded with primary
8543         expressions doing string concatenation).
8544
8545         So things like:
8546
8547         A.B.C [] x;
8548
8549         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8550         using clauses from working on this particular context.  And a type
8551         was being matched directly against "A.B.C[]".
8552
8553         We now use the correct approach, and allow for ComposedCast to be
8554         part of the unary expression.  So the "A.B.C []" become a composed
8555         cast of "A.B.C" (as a nested group of MemberAccess with a
8556         SimpleName at the end) plus the rank composition "[]". 
8557
8558         Also fixes 35567
8559
8560 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8561
8562         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8563         for the access level checking.
8564
8565         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8566         `TypeContainer container', because I kept getting confused when I
8567         was debugging this code.
8568
8569         * expression.cs (Indexers): Instead of tracking getters/setters,
8570         we now track them in parallel.  We create one arraylist less, but
8571         most importantly it is possible now for the LValue code to find a
8572         matching get for a set.
8573
8574         (IndexerAccess.DoResolveLValue): Update the code.
8575         GetIndexersForType has been modified already to extract all the
8576         indexers from a type.  The code assumed it did not.
8577
8578         Also make the code set the correct return type for the indexer.
8579         This was fixed a long time ago for properties, but was missing for
8580         indexers.  It used to be void_type.
8581
8582         (Binary.Emit): Test first for doubles instead of
8583         floats, as they are more common.
8584
8585         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8586         when dealing with floats and the <=, >= operators.  This fixes bug
8587         #39314 
8588
8589         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8590         to load the array value by emitting a load on the foreach variable
8591         type.  This was incorrect.  
8592
8593         We now emit the code to load an element using the the array
8594         variable type, and then we emit the conversion operator.
8595
8596         Fixed #40176
8597
8598 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8599
8600         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8601
8602 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8603
8604         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8605         test for protection before we test for signatures. 
8606
8607         (MethodSignature.ToString): implement.
8608
8609         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8610         to the case where we reduced into a LongConstant.
8611
8612         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8613         depend on whether the information is acurrate, because the
8614         Microsoft runtime will always claim that the array type is public,
8615         regardless of the real state.
8616
8617         If the type is a pointer, another problem happens: the type is
8618         reported as non-public in Microsoft.  
8619
8620         In both cases we have to call CheckAccessLevel recursively with
8621         the underlying type as the argument to be tested.
8622
8623 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8624
8625         * assign.cs (Assign.Emit): If we are dealing with a compound
8626         assignment expression, we should use the code path that stores the
8627         intermediate result in a temporary value.  This fixes #40903.
8628
8629         *expression.cs (Indirection.ToString): Provide ToString method for
8630         debugging. 
8631
8632 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8633
8634         * class.cs: Null out fields holding references to Block objects so
8635         they can be garbage collected.
8636
8637         * expression.cs (OverloadResolve): Remove unused local.
8638
8639 2003-04-07  Martin Baulig  <martin@ximian.com>
8640
8641         * codegen.cs (EmitContext.CurrentFile): New public field.
8642         (EmitContext.Mark): Use the CurrentFile to check whether the
8643         location is in the correct file.
8644         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8645
8646 2003-04-07  Martin Baulig  <martin@ximian.com>
8647
8648         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8649
8650         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8651         location.  [FIXME: The location argument which gets passed to this
8652         method is sometimes wrong!]
8653
8654 2003-04-07  Nick Drochak <ndrochak@gol.com>
8655
8656         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8657
8658 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8659
8660         * expression.cs (Indirection.EmitAssign): We were using the
8661         temporary, but returning immediately instead of continuing the
8662         EmitAssing flow.
8663
8664 2003-04-06  Martin Baulig  <martin@ximian.com>
8665
8666         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8667         if it's a nested child, but also deriving from the outer class.
8668         See test 190.cs.
8669
8670         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8671         nested child, but also deriving from the outer class.  See
8672         test-190.cs.
8673         (FilterWithClosure): We may access private members of the outer
8674         class if we're a nested child and deriving from the outer class.
8675         (RealMemberLookup): Only set `closure_private_ok' if the
8676         `original_bf' contained BindingFlags.NonPublic.
8677
8678 2003-04-05  Martin Baulig  <martin@ximian.com>
8679
8680         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
8681
8682 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8683
8684         * class.cs (Event.Define): Do not allow abstract events to have
8685         initializers. 
8686
8687 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8688
8689         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8690         block in event declarations.
8691
8692         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8693         value type, get its address.
8694
8695         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8696         leaving a class on the stack instead of a boolean value (int
8697         0/1).  Change the code so we compare against null, and then the
8698         result against zero.
8699
8700         * class.cs (TypeContainer.GetClassBases): We were checking for the
8701         parent class being sealed too late.
8702
8703         * expression.cs (Binary.Emit): For <= and >= when dealing with
8704         floating point values, use cgt.un and clt.un instead of cgt and
8705         clt alone.
8706
8707 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8708
8709         * statement.cs: Apply the same optimization as MS: skip the 
8710         GetEnumerator returning an IEnumerator, and use the one returning a 
8711         CharEnumerator instead. This allows us to avoid the try-finally block 
8712         and the boxing.
8713
8714 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8715
8716         * cs-parser.jay: Attributes cannot be applied to
8717                          namespaces. Fixes #40473
8718
8719 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8720
8721         * class.cs:
8722         (Add*): check if the name is valid using the full name for constants,
8723         fields, properties and events.
8724
8725 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8726
8727         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8728         char constants to be part of the enumeration.
8729
8730         * expression.cs (Conditional.DoResolve): Add support for operator
8731         true. Implements the missing functionality from 14.12
8732
8733         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8734         operator true/false as required by the spec.
8735
8736         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8737         implicit conversion to boolean.
8738
8739         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8740         also one where the type implements `operator true'. 
8741
8742         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8743         get an expression that will invoke operator true based on an
8744         expression.  
8745
8746         (GetConversionOperators): Removed the hack that called op_True
8747         here.  
8748
8749         (Expression.ResolveBoolean): Move this from Statement.
8750
8751 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * ecore.cs (FieldExpr): do not allow initialization of initonly
8754         fields on derived classes
8755
8756 2003-03-13  Martin Baulig  <martin@ximian.com>
8757
8758         * statement.cs (Block.Emit): Call ig.BeginScope() and
8759         ig.EndScope() when compiling with debugging info; call
8760         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8761
8762 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8763
8764         * expression.cs (Indexers): Do not construct immediately, allow
8765         for new members to be appended as we go.  Fixes 38143
8766
8767 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8768
8769         * expression.cs: save/restore context when resolving an unchecked
8770         expression.
8771
8772 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8773
8774         * cfold.cs: Catch division by zero in modulus operator during
8775         constant folding.
8776
8777 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8778
8779         * interface.cs (Interface.DefineMembers): Avoid defining members
8780         twice. 
8781
8782 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8783
8784         * driver.cs: handle the +/- options for -noconfig
8785
8786         * statement.cs (Unckeched.Resolve): Also track the state of
8787         unchecked in the Resolve phase.
8788
8789 2003-02-27  Martin Baulig  <martin@ximian.com>
8790
8791         * ecore.cs (Expression.MemberLookup): Don't create a
8792         MethodGroupExpr for something which is not a method.  Fixes #38291.
8793
8794 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * class.cs (MemberBase.CheckParameters): Also check that the type
8797         is unmanaged if it is a pointer.
8798
8799         * expression.cs (SizeOf.Resolve): Add location information.
8800
8801         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8802         a managed type is declared.
8803
8804         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8805         parameter modifiers as well.  Fixes bug 38606
8806
8807         * class.cs: Very sad.  Am backing out the speed up changes
8808         introduced by the ArrayList -> Array in the TypeContainer, as they
8809         were not actually that much faster, and introduced a bug (no error
8810         reports on duplicated methods).
8811
8812         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8813         source first, this will guarantee that we have a valid expression
8814         before calling in lower levels functions that will require a
8815         resolved object.  Then use this original_source in the
8816         target.ResolveLValue instead of the original source that was
8817         passed to us.
8818
8819         Another change.  Use target.Resolve instead of LValueResolve.
8820         Although we are resolving for LValues, we will let the Assign code
8821         take care of that (it will be called again from Resolve).  This
8822         basically allows code like this:
8823
8824         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8825         class Y { void A (X x) { x [0] += o; }
8826
8827         The problem was that the indexer was trying to resolve for
8828         set_Item (idx, object o) and never finding one.  The real set_Item
8829         was set_Item (idx, X).  By delaying the process we get the right
8830         semantics. 
8831
8832         Fixes bug 36505
8833
8834 2003-02-23  Martin Baulig  <martin@ximian.com>
8835
8836         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8837         while calling DoEmit ().
8838
8839         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8840         source files; if you use the #line directive inside a method, the
8841         compiler stops emitting line numbers for the debugger until it
8842         reaches the end of the method or another #line directive which
8843         restores the original file.
8844
8845 2003-02-23  Martin Baulig  <martin@ximian.com>
8846
8847         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8848
8849 2003-02-23  Martin Baulig  <martin@ximian.com>
8850
8851         * statement.cs (Block.AddChildVariableNames): We need to call this
8852         recursively, not just for our immediate children.
8853
8854 2003-02-23  Martin Baulig  <martin@ximian.com>
8855
8856         * class.cs (Event.Define): Always make the field private, like csc does.
8857
8858         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8859         actually work, fixes bug #37521.
8860
8861 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8862
8863         * delegate.cs: When creating the various temporary "Parameters"
8864         classes, make sure that we call the ComputeAndDefineParameterTypes
8865         on those new parameters (just like we do with the formal ones), to
8866         allow them to be resolved in the context of the DeclSpace.
8867
8868         This fixes the bug that Dick observed in Bugzilla #38530.
8869
8870 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8871
8872         * expression.cs (ResolveMemberAccess): When resolving a constant,
8873         do not attempt to pull a constant if the value was not able to
8874         generate a valid constant.
8875
8876         * const.cs (LookupConstantValue): Do not report more errors than required.
8877
8878 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8879
8880         * expression.cs: fixes bug #38328.
8881
8882 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8883
8884         * class.cs: Changed all the various members that can be part of a
8885         class from being an ArrayList to be an Array of the right type.
8886         During the DefineType type_list, interface_list, delegate_list and
8887         enum_list are turned into types, interfaces, delegates and enums
8888         arrays.  
8889
8890         And during the member population, indexer_list, event_list,
8891         constant_list, field_list, instance_constructor_list, method_list,
8892         operator_list and property_list are turned into their real arrays.
8893
8894         Although we could probably perform this operation earlier, for
8895         good error reporting we need to keep the lists and remove the
8896         lists for longer than required.
8897
8898         This optimization was triggered by Paolo profiling the compiler
8899         speed on the output of `gen-sample-program.pl' perl script. 
8900
8901         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8902         not crash in methods like MemberLookupFailed that use this field.  
8903
8904         This problem arises when the compiler fails to resolve a type
8905         during interface type definition for example.
8906
8907 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8908
8909         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8910         inherit from System.Object, so we have to stop at null, not only
8911         when reaching System.Object.
8912
8913 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8914
8915         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8916         DeclaredOnly because the parent indexer might have had a different
8917         name, but did not loop until the top of the hierarchy was reached.
8918
8919         The problem this one fixes is 35492: when a class implemented an
8920         indexer from an interface, we were getting the interface method
8921         (which was abstract) and we were flagging an error (can not invoke
8922         abstract method).
8923
8924         This also keeps bug 33089 functioning, and test-148 functioning.
8925
8926         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8927         out if a method is special is to see if it is declared in a
8928         property or event, or whether it is one of the predefined operator
8929         names.   This should fix correctly #36804.
8930
8931 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8932
8933         The goal here is to remove the dependency on EmptyCast.Peel ().
8934         Killing it completely.
8935
8936         The problem is that currently in a number of places where
8937         constants are expected, we have to "probe" for an EmptyCast, and
8938         Peel, which is not the correct thing to do, as this will be
8939         repetitive and will likely lead to errors. 
8940
8941         The idea is to remove any EmptyCasts that are used in casts that
8942         can be reduced to constants, so we only have to cope with
8943         constants. 
8944
8945         This bug hunt was triggered by Bug 37363 and the desire to remove
8946         the duplicate pattern where we were "peeling" emptycasts to check
8947         whether they were constants.  Now constants will always be
8948         constants.
8949
8950         * ecore.cs: Use an enumconstant here instead of wrapping with
8951         EmptyCast.  
8952
8953         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8954         throwing me off.  By handling this we can get rid of a few hacks.
8955
8956         * statement.cs (Switch): Removed Peel() code.
8957
8958 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
8959
8960         * class.cs: Location information for error 508
8961
8962         * expression.cs (New.DoResolve): Add a guard against double
8963         resolution of an expression.  
8964
8965         The New DoResolve might be called twice when initializing field
8966         expressions (see EmitFieldInitializers, the call to
8967         GetInitializerExpression will perform a resolve on the expression,
8968         and later the assign will trigger another resolution
8969
8970         This leads to bugs (#37014)
8971
8972         * delegate.cs: The signature for EndInvoke should contain any ref
8973         or out parameters as well.  We were not doing this in the past. 
8974
8975         * class.cs (Field.Define): Do not overwrite the type definition
8976         inside the `volatile' group.  Turns out that volatile enumerations
8977         were changing the type here to perform a validity test, which
8978         broke conversions. 
8979
8980 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
8981
8982         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
8983         and structs, we do not want to load the instance variable
8984
8985         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
8986         enum_type has to be handled like an object reference (implicit
8987         conversions exists from this to object), but the regular IsClass
8988         and IsValueType tests will never return true for this one.
8989
8990         Also we use TypeManager.IsValueType instead of type.IsValueType,
8991         just for consistency with the rest of the code (this is only
8992         needed if we ever use the construct exposed by test-180.cs inside
8993         corlib, which we dont today).
8994
8995 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
8996
8997         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
8998         just InternalCall.
8999
9000 2003-02-09  Martin Baulig  <martin@ximian.com>
9001
9002         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9003         (Namespace.DefineNamespaces): New static public method; this is
9004         called when we're compiling with debugging to add all namespaces
9005         to the symbol file.
9006
9007         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9008         pass it to the Namespace's .ctor.
9009
9010         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9011         and MethodBase arguments; pass the namespace ID to the symwriter;
9012         pass the MethodBase instead of the token to the symwriter.
9013         (SymbolWriter.DefineNamespace): New method to add a namespace to
9014         the symbol file.
9015
9016 2003-02-09  Martin Baulig  <martin@ximian.com>
9017
9018         * symbolwriter.cs: New file.  This is a wrapper around
9019         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9020         methods here in near future.
9021
9022 2003-02-09  Martin Baulig  <martin@ximian.com>
9023
9024         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9025         ILGenerator.MarkSequencePoint() which are actually used by the
9026         symbol writer.
9027
9028 2003-02-09  Martin Baulig  <martin@ximian.com>
9029
9030         * location.cs (SourceFile): New public sealed class.  This
9031         contains the name and an index which is used in the location's token.
9032         (Location): Reserve an appropriate number of bits in the token for
9033         the source file instead of walking over that list, this gives us a
9034         really huge performance improvement when compiling with debugging.
9035
9036         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9037         `SourceFile' argument instead of a string.
9038         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9039         but don't parse/tokenize here, we need to generate the list of all
9040         source files before we do that.
9041         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9042         the files.
9043
9044         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9045         instead of a string.
9046
9047         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9048         of a string.
9049
9050 2003-02-09  Martin Baulig  <martin@ximian.com>
9051
9052         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9053         filename on `#line default'.
9054
9055 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9056
9057         * statement.cs: don't clear the pinned var when the fixed statement
9058         returns from the method (fixes bug#37752).
9059
9060 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9061
9062         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9063         to IsValueType.
9064
9065 2003-02-07  Martin Baulig  <martin@ximian.com>
9066
9067         * driver.cs: Removed the `--debug-args' command line argument.
9068
9069         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9070         automatically by the AsssemblyBuilder.
9071         (CodeGen.InitializeSymbolWriter): We don't need to call any
9072         initialization function on the symbol writer anymore.  This method
9073         doesn't take any arguments.
9074
9075 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9076
9077         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9078         from referenced assemblies as well.
9079
9080 2003-02-02  Martin Baulig  <martin@ximian.com>
9081
9082         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9083
9084 2003-02-02  Martin Baulig  <martin@ximian.com>
9085
9086         * class.cs (Constructor.Emit): Open the symbol writer before
9087         emitting the constructor initializer.
9088         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9089         single-stepping through constructor initializers.
9090
9091 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9092
9093         * class.cs: Handle error 549: do not allow virtual methods in
9094         sealed classes. 
9095
9096 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9097
9098         * decl.cs: Check access levels when resolving types
9099
9100 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9101
9102         * statement.cs: Add parameters and locals set in catch blocks that might 
9103         return to set vector
9104
9105 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9106
9107         * class.cs (Operator): Set the SpecialName flags for operators.
9108
9109         * expression.cs (Invocation.DoResolve): Only block calls to
9110         accessors and operators on SpecialName methods.
9111
9112         (Cast.TryReduce): Handle conversions from char constants.
9113
9114
9115 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9116
9117         * statement.cs: small memory and time optimization in FlowBranching.
9118
9119 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9120
9121         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9122         problem that the last fix but in the other sid (Set).
9123
9124         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9125         access when there is no indexer in the hierarchy.
9126
9127 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9128
9129         * class.cs: Combine some if statements.
9130
9131 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9132
9133         * driver.cs: fixed bug #37187.
9134
9135 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9136
9137         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9138         any indexer, it's needed to build a list with all the indexers in the
9139         hierarchy (AllGetters), else we have problems. Fixes #35653.
9140
9141 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9142
9143         * class.cs (MethodData.Define): It is wrong for an interface
9144         implementation to be static in both cases: explicit and implicit.
9145         We were only handling this in one case.
9146
9147         Improve the if situation there to not have negations.
9148
9149         * class.cs (Field.Define): Turns out that we do not need to check
9150         the unsafe bit on field definition, only on usage.  Remove the test.
9151
9152 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9153
9154         * driver.cs: use assembly.Location instead of Codebase (the latest
9155         patch made mcs fail when using MS assemblies).
9156
9157 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9158
9159         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9160         get the path to *corlib.dll.
9161
9162 2003-01-21  Nick Drochak <ndrochak@gol.com>
9163
9164         * cs-tokenizer.cs:
9165         * pending.cs:
9166         * typemanager.cs: Remove compiler warnings
9167
9168 2003-01-20  Duncan Mak  <duncan@ximian.com>
9169
9170         * AssemblyInfo.cs: Bump the version number to 0.19.
9171
9172 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9173
9174         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9175
9176 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9177
9178         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9179
9180 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9181
9182         * cs-parser.jay: Small fix: we were not comparing the constructor
9183         name correctly.   Thanks to Zoltan for the initial pointer.
9184
9185 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9186
9187         * cs-tokenizer.cs: Set file name when specified with #line
9188
9189 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9190
9191         * cs-parser.jay: Only perform the constructor checks here if we
9192         are named like the class;  This will help provider a better
9193         error.  The constructor path is taken when a type definition is
9194         not found, but most likely the user forgot to add the type, so
9195         report that rather than the constructor error.
9196
9197 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9198
9199         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9200         allocations.
9201
9202 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9203
9204         * cs-parser.jay: Add cleanup call.
9205
9206 2003-01-13  Duncan Mak  <duncan@ximian.com>
9207
9208         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9209         consistent with other methods.
9210
9211 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9212
9213         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9214
9215 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9216
9217         * attribute.cs: only set GuidAttr to true when we have a
9218         GuidAttribute.
9219
9220 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9221
9222         * ecore.cs:
9223         * expression.cs:
9224         * typemanager.cs: fixes to allow mcs compile corlib with the new
9225         Type.IsSubclassOf fix.
9226
9227 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9228
9229         * expression.cs (LocalVariableReference.DoResolve): Classify a
9230         constant as a value, not as a variable.   Also, set the type for
9231         the variable.
9232
9233         * cs-parser.jay (fixed_statement): take a type instead of a
9234         pointer_type, so we can produce a better error message later.
9235
9236         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9237         as an error.  
9238
9239         (For.DoEmit): Make inifinite loops have a
9240         non-conditional branch back.
9241
9242         (Fixed.DoEmit): First populate the pinned variables, then emit the
9243         statement, then clear the variables.  Before I was emitting the
9244         code once for each fixed piece.
9245
9246
9247 2003-01-08  Martin Baulig  <martin@ximian.com>
9248
9249         * statement.cs (FlowBranching.MergeChild): A break in a
9250         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9251
9252 2003-01-08  Martin Baulig  <martin@ximian.com>
9253
9254         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9255         lives in the same number space than `param_map'.  Fixes #36154.
9256
9257 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9258
9259         * cs-parser.jay (constructor_declaration): Set the
9260         Constructor.ModFlags before probing for it.  This makes the
9261         compiler report 514, 515 and 132 (the code was there, but got
9262         broken). 
9263
9264         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9265         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9266         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9267
9268 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9269
9270         * enum.cs: create the enum static fields using the enum type.
9271
9272 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9273
9274         * class.cs: don't try to create the ParamBuilder for the return
9275         type if it's not needed (and handle it breaking for the ms runtime
9276         anyway).
9277
9278 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9279
9280         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9281
9282 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9283
9284         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9285         the command.   This showed up while compiling the JANET source
9286         code, which used \r as its only newline separator.
9287
9288 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9289
9290         * class.cs (Method.Define): If we are an operator (because it
9291         reuses our code), then set the SpecialName and HideBySig.  #36128
9292
9293 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9294
9295         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9296         exception, report error 120 `object reference required'.
9297
9298         * driver.cs: Add --pause option, used during to measure the size
9299         of the process as it goes with --timestamp.
9300
9301         * expression.cs (Invocation.DoResolve): Do not allow methods with
9302         SpecialName to be invoked.
9303
9304 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9305
9306         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9307         number before adding it.
9308
9309 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9310
9311         * ecore.cs (StandardImplicitConversion): When in an unsafe
9312         context, we allow conversion between void * to any other pointer
9313         type. This fixes bug #35973.
9314
9315 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9316
9317         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9318         is not thrown when extensionless outputs are used 
9319
9320 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9321
9322         * rootcontext.cs: fixed compilation of corlib.
9323
9324 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * attribute.cs (Attributes.Contains): Add new method.
9327
9328         * class.cs (MethodCore.LabelParameters): if the parameter is an
9329         `out' parameter, check that no attribute `[In]' has been passed.
9330
9331         * enum.cs: Handle the `value__' name in an enumeration.
9332
9333 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9334
9335         * decl.cs: Added special case to allow overrides on "protected
9336         internal" methods
9337
9338 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9339
9340         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9341         since it makes much more sense.
9342
9343         (Attributes.ctor): Don't require a Location parameter.
9344
9345         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9346
9347         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9348         since we already have that information per attribute.
9349
9350         * everywhere : make appropriate changes.
9351
9352         * class.cs (LabelParameters): Write the code which actually
9353         applies attributes to the return type. We can't do this on the MS
9354         .NET runtime so we flag a warning in the case an exception is
9355         thrown.
9356
9357 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9358
9359         * const.cs: Handle implicit null conversions here too.
9360
9361 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9362
9363         * class.cs (MethodCore.LabelParameters): Remove the extra
9364         Type [] parameter since it is completely unnecessary. Instead
9365         pass in the method's attributes so that we can extract
9366         the "return" attribute.
9367
9368 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9371         of ignoring it and letting the compile continue.
9372
9373         * typemanager.cs (ChangeType): use an extra argument to return an
9374         error condition instead of throwing an exception.
9375
9376 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9377
9378         * expression.cs (Unary.TryReduce): mimic the code for the regular
9379         code path.  Perform an implicit cast in the cases where we can
9380         implicitly convert to one of the integral types, and then reduce
9381         based on that constant.   This fixes bug #35483.
9382
9383 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9384
9385         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9386
9387 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9388
9389         * namespace.cs: fixed bug #35489.
9390
9391 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9392
9393         * class.cs: Remove some dead code.
9394
9395         * cs-parser.jay: Estimate the number of methods needed
9396         (RootContext.MethodCount);
9397
9398         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9399         numbers instead of StringBuilders.
9400
9401         * support.cs (PtrHashtable): Add constructor with initial size;
9402         We can now reduce reallocations of the method table.
9403
9404 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9405
9406         * attribute.cs (ApplyAttributes): Keep track of the emitted
9407         attributes on a per-target basis. This fixes bug #35413.
9408
9409 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9410
9411         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9412         default to the Windows 1252 encoding.
9413
9414         (UnixParseOption): Support version, thanks to Alp for the missing
9415         pointer. 
9416
9417         * AssemblyInfo.cs: Add nice assembly information.
9418
9419         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9420         (bug 35169).
9421
9422         * cs-parser.jay: Allow a trailing comma before the close bracked
9423         in the attribute_section production.
9424
9425         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9426         address of the instance was being taken, I will take this out,
9427         because we take the address of the object immediately here.
9428
9429 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9430
9431         * typemanager.cs (AreMultipleAllowed): Take care of the most
9432         obvious case where attribute type is not in the current assembly -
9433         stupid me ;-)
9434
9435 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9436
9437         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9438         definitions, instead of doing that afterwards.  
9439
9440         Also we use a nice little hack, depending on the constructor, we
9441         know if we are a "composed" name or a simple name.  Hence, we
9442         avoid the IndexOf test, and we avoid 
9443
9444         * codegen.cs: Add code to assist in a bug reporter to track down
9445         the source of a compiler crash. 
9446
9447 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9448
9449         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9450         types have been emitted for a given element and flag an error
9451         if something which does not have AllowMultiple set is used more
9452         than once.
9453
9454         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9455         attribute types and their corresponding AllowMultiple properties
9456
9457         (AreMultipleAllowed): Check the property for a given type.
9458
9459         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9460         property in the case we have a TypeContainer.
9461
9462         (Attributes.AddAttribute): Detect duplicates and just skip on
9463         adding them. This trivial fix catches a pretty gross error in our
9464         attribute emission - global attributes were being emitted twice!
9465
9466         Bugzilla bug #33187 is now fixed.
9467
9468 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9469
9470         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9471         instead of pp_and).
9472
9473         * expression.cs (Binary.ResolveOperator): I can only use the
9474         Concat (string, string, string) and Concat (string, string,
9475         string, string) if the child is actually a concatenation of
9476         strings. 
9477
9478 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9479
9480         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9481         context where we need a 2-character lookahead.
9482
9483         * pending.cs (PendingImplementation): Rework so we can keep track
9484         of interface types all the time, and flag those which were
9485         implemented by parents as optional.
9486
9487 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9488
9489         * expression.cs (Binary.ResolveOperator): Use
9490         String.Concat(string,string,string) or
9491         String.Concat(string,string,string,string) when possible. 
9492
9493         * typemanager: More helper methods.
9494
9495
9496 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9497
9498         * pending.cs: remove the bogus return from GetMissingInterfaces()
9499         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9500
9501 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9502
9503         * namespace.cs: avoid duplicated 'using xxx' being added to
9504         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9505         when we get more than one 'using' statement for the same namespace.
9506         Report a CS0105 warning for it.
9507
9508 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9509
9510         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9511         of calling getChar/putback, uses internal knowledge of it.    
9512
9513         (xtoken): Reorder tokenizer so most common patterns are checked
9514         first.  This reduces the compilation time in another 5% (from 8.11s
9515         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9516
9517         The parsing time is 22% of the compilation in mcs, and from that
9518         64% is spent on the tokenization process.  
9519
9520         I tried using a binary search for keywords, but this is slower
9521         than the hashtable.  Another option would be to do a couple of
9522         things:
9523
9524                 * Not use a StringBuilder, instead use an array of chars,
9525                   with a set value.  Notice that this way we could catch
9526                   the 645 error without having to do it *afterwards*.
9527
9528                 * We could write a hand-parser to avoid the hashtable
9529                   compares altogether.
9530
9531         The identifier consumption process takes 37% of the tokenization
9532         time.  Another 15% is spent on is_number.  56% of the time spent
9533         on is_number is spent on Int64.Parse:
9534
9535                 * We could probably choose based on the string length to
9536                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9537                   computations. 
9538
9539         Another 3% is spend on wrapping `xtoken' in the `token' function.
9540
9541         Handle 0xa0 as whitespace (#34752)
9542
9543 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9544
9545         * typemanager.cs (IsCLRType): New routine to tell whether a type
9546         is one of the builtin types.  
9547
9548         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9549         typecode in more places instead of doing pointer comparissions.
9550         We could leverage some knowledge about the way the typecodes are
9551         laid out.
9552
9553         New code to cache namespaces in assemblies, it is currently not
9554         invoked, to be used soon.
9555
9556         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9557
9558         * expression.cs (Binary.ResolveOperator): specially handle
9559         strings, and do not perform user-defined operator overloading for
9560         built-in types.
9561
9562 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9563
9564         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9565         internalcall as it is a pretty simple operation;  Avoid whenever
9566         possible to call Char.IsLetter.
9567
9568         (consume_identifier): Cut by half the number of
9569         hashtable calls by merging the is_keyword and GetKeyword behavior.
9570
9571         Do not short-circuit, because if we do, we
9572         report errors (ie, #if false && true would produce an invalid
9573         directive error);
9574
9575
9576 2002-11-24  Martin Baulig  <martin@ximian.com>
9577
9578         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9579         check constant ranges and report a CS0221.  Fixes #33186.
9580
9581 2002-11-24  Martin Baulig  <martin@ximian.com>
9582
9583         * cs-parser.jay: Make this work for uninitialized variable
9584         declarations in the `for' initializer.  Fixes #32416.
9585
9586 2002-11-24  Martin Baulig  <martin@ximian.com>
9587
9588         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9589         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9590
9591 2002-11-24  Martin Baulig  <martin@ximian.com>
9592
9593         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9594         argument; if true, we also check for user-defined conversions.
9595         This is only needed if both arguments are of a user-defined type.
9596         Fixes #30443, added test-175.cs.
9597         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9598
9599         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9600
9601 2002-11-24  Martin Baulig  <martin@ximian.com>
9602
9603         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9604         function to get the store opcode.
9605         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9606         only emit the Ldelema if the store opcode is Stobj.  You must run
9607         both test-34 and test-167 to test this.  Fixes #34529.
9608
9609 2002-11-23  Martin Baulig  <martin@ximian.com>
9610
9611         * ecore.cs (Expression.MemberLookup): Added additional
9612         `qualifier_type' argument which is used when we're being called
9613         from MemberAccess.DoResolve() and null if we're called from a
9614         SimpleName lookup.
9615         (Expression.MemberLookupFailed): New method to report errors; this
9616         does the CS1540 check and reports the correct error message.
9617
9618         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9619         argument for the CS1540 check and redone the way how we're dealing
9620         with private members.  See the comment in the source code for details.
9621         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9622         `closure_start_type' to `closure_qualifier_type' and check whether
9623         it's not null.  It was not this filter being broken, it was just
9624         being called with the wrong arguments.
9625
9626         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9627         and pass it the correct `qualifier_type'; this also does the error
9628         handling for us.
9629
9630 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9631
9632         * expression.cs (Invocation.EmitParams): If the we are dealing
9633         with a non-built-in value type, load its address as well.
9634
9635         (ArrayCreation): Use a a pretty constant instead
9636         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9637         static initializers.  
9638
9639         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9640         because they are not really value types, just glorified integers. 
9641
9642         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9643
9644         * ecore.cs: Remove redundant code for enumerations, make them use
9645         the same code path as everything else, fixes the casting issue
9646         with enumerations in Windows.Forms.
9647
9648         * attribute.cs: Do only cast to string if it is a string, the
9649         validation happens later.
9650
9651         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9652         people upgrade their corlibs.
9653
9654         * ecore.cs: Oops, enumerations were not following the entire code path
9655
9656 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9657
9658         * typemanager.cs (FilterWithClosure): Commented out the test for
9659         1540 in typemanager.cs, as it has problems when accessing
9660         protected methods from a parent class (see test-174.cs). 
9661
9662         * attribute.cs (Attribute.ValidateGuid): new method.
9663         (Attribute.Resolve): Use above.
9664
9665 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9666
9667         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9668
9669         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9670         handling for enumerations, as we only needed the TypeContainer
9671         functionality to begin with (this is required for the fix below to
9672         work for enums that reference constants in a container class for
9673         example). 
9674
9675         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9676
9677         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9678         a valid TypeBuilder to perform lookups on.o
9679
9680         * class.cs (InheritableMemberSignatureCompare): Use true in the
9681         call to GetGetMethod and GetSetMethod, because we are comparing
9682         the signature, and we need to get the methods *even* if they are
9683         private. 
9684
9685         (PropertyBase.CheckBase): ditto.
9686
9687         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9688         GotoCase.Resolve): Use Peel on EmpytCasts.
9689
9690         * ecore.cs (EmptyCast): drop child, add Peel method.
9691
9692 2002-11-17  Martin Baulig  <martin@ximian.com>
9693
9694         * ecore.cs (EmptyCast.Child): New public property.
9695
9696         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9697         label resolved to an EmptyCast.  Fixes #34162.
9698         (GotoCase.Resolve): Likewise.
9699         (Block.EmitMeta): Likewise.
9700
9701 2002-11-17  Martin Baulig  <martin@ximian.com>
9702
9703         * expression.cs (Invocation.BetterConversion): Prefer int over
9704         uint; short over ushort; long over ulong for integer literals.
9705         Use ImplicitConversionExists instead of StandardConversionExists
9706         since we also need to check for user-defined implicit conversions.
9707         Fixes #34165.  Added test-173.cs.
9708
9709 2002-11-16  Martin Baulig  <martin@ximian.com>
9710
9711         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9712         with the `true' and `false' literals.  Fixes #33151.
9713
9714 2002-11-16  Martin Baulig  <martin@ximian.com>
9715
9716         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9717         October 22nd; don't do the cs1540 check for static members.
9718
9719         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9720         now using our own filter here and doing the cs1540 check again.
9721
9722 2002-11-16  Martin Baulig  <martin@ximian.com>
9723
9724         * support.cs (InternalParameters): Don't crash if we don't have
9725         any fixed parameters.  Fixes #33532.
9726
9727 2002-11-16  Martin Baulig  <martin@ximian.com>
9728
9729         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9730         when looking up static methods to make this work on Windows.
9731         Fixes #33773.
9732
9733 2002-11-16  Martin Baulig  <martin@ximian.com>
9734
9735         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9736         a setter rather than using PropertyInfo.CanWrite.
9737
9738 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9739
9740         * class.cs: Allow acces to block member by subclasses. Fixes build
9741         breaker.
9742
9743 2002-11-14  Martin Baulig  <martin@ximian.com>
9744
9745         * class.cs (Constructor.Emit): Added the extern/block check.
9746         Fixes bug #33678.
9747
9748 2002-11-14  Martin Baulig  <martin@ximian.com>
9749
9750         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9751         iteration while looking for indexers, this is needed because the
9752         indexer may have a different name in our base classes.  Fixed the
9753         error reporting (no indexers at all, not get accessor, no
9754         overloaded match).  Fixes bug #33089.
9755         (IndexerAccess.DoResolveLValue): Likewise.
9756
9757 2002-11-14  Martin Baulig  <martin@ximian.com>
9758
9759         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9760         indexers.  Fixes the first part of bug #33089.
9761         (MethodSignature.InheritableMemberSignatureCompare): Added support
9762         for properties.
9763
9764 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9765
9766         * attribute.cs (Attribute.Resolve): Catch the
9767         NullReferenceException and report it since it isn't supposed to
9768         happen. 
9769
9770 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9771
9772         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9773         LogicalOr and LogicalAnd that can benefit from recursively
9774         handling EmitBranchable.  The code now should be nice for Paolo.
9775
9776 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9777
9778         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9779         the Type lookups, as we perform quite a number of lookups on
9780         non-Types.  This can be removed once we can deterministically tell
9781         whether we have a type or a namespace in advance.
9782
9783         But this might require special hacks from our corlib.
9784
9785         * TODO: updated.
9786
9787         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9788         and double which avoids a conversion from an integer to a double.
9789
9790         * expression.cs: tiny optimization, avoid calling IsConstant,
9791         because it effectively performs the lookup twice.
9792
9793 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9794
9795         But a bogus return here to keep the semantics of the old code
9796         until the Mono runtime is fixed.
9797
9798         * pending.cs (GetMissingInterfaces): New method used to remove all
9799         the interfaces that are already implemented by our parent
9800         classes from the list of pending methods. 
9801
9802         * interface.cs: Add checks for calls after ResolveTypeExpr.
9803
9804 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9805
9806         * class.cs (Class.Emit): Report warning 67: event not used if the
9807         warning level is beyond 3.
9808
9809         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9810         being a NullLiteral.
9811
9812         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9813         specifiers. 
9814
9815         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9816         path that might fail if a type can not be resolved.
9817
9818         * expression.cs (Binary.Emit): Emit unsigned versions of the
9819         operators. 
9820
9821         * driver.cs: use error 5.
9822
9823 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9824
9825         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9826
9827 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * cs-parser.jay (switch_section): A beautiful patch from Martin
9830         Baulig that fixed 33094.
9831
9832 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9833
9834         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9835         Check whether the base is abstract and report an error if so.
9836
9837         * expression.cs (IndexerAccess.DoResolveLValue,
9838         IndexerAccess.DoResolve): ditto. 
9839
9840         (Invocation.DoResolve): ditto.
9841
9842         (Invocation.FullMethodDesc): Improve the report string.
9843
9844         * statement.cs (Block): Eliminate IsVariableDefined as it is
9845         basically just a wrapper for GetVariableInfo.
9846
9847         * ecore.cs (SimpleName): Use new 
9848
9849         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9850         type, as we return the actual parameter ref/unref state on a
9851         different call.
9852
9853 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9854
9855         * support.cs: Return proper flags REF/OUT fixing the previous
9856         commit.  
9857
9858         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9859         not used to mean `ref' but `ref or out' in ParameterReference
9860
9861         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9862         full type signature instead of calling TypeManger.CSharpName
9863         ourselves. 
9864
9865         * support.cs (InternalParameters.ParameterDesc): Do not compare
9866         directly to the modflags, because REF/OUT will actually be bitsets
9867         if set. 
9868
9869         * delegate.cs (VerifyMethod): Check also the modifiers.
9870
9871         * cs-tokenizer.cs: Fix bug where floating point values with an
9872         exponent where a sign was missing was ignored.
9873
9874         * driver.cs: Allow multiple assemblies to be specified in a single
9875         /r: argument
9876
9877 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9878
9879         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9880         because identifiers after a parenthesis would end up in this kind
9881         of production, and we needed to desamiguate it for having casts
9882         like:
9883
9884                 (UserDefinedType *) xxx
9885
9886 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9887
9888         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9889         we should set on the Bindingflags.NonPublic, but not turn on
9890         private_ok.  private_ok controls whether a Private member is
9891         returned (this is chekced on the filter routine), while the
9892         BindingFlags.NonPublic just controls whether private/protected
9893         will be allowed.   This fixes the problem part of the problem of
9894         private properties being allowed to be used in derived classes.
9895
9896         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9897         so we can call the children DoResolveLValue method (this will
9898         properly signal errors on lvalue assignments to base properties)
9899
9900         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9901         getter are null, and we have a property info, we know that this
9902         happened because the lookup failed, so we report an error 122 for
9903         protection level violation.
9904
9905         We also silently return if setter and getter are null in the
9906         resolve functions, this condition only happens if we have flagged
9907         the error before.  This is the other half of the problem. 
9908
9909         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9910         not have accessibility information, that is why we were returning
9911         true in the filter function in typemanager.cs.
9912
9913         To properly report 122 (property is inaccessible because of its
9914         protection level) correctly, we report this error in ResolveAccess
9915         by failing if both the setter and the getter are lacking (ie, the
9916         lookup failed). 
9917
9918         DoResolve and DoLResolve have been modified to check for both
9919         setter/getter being null and returning silently, the reason being
9920         that I did not want to put the knowledge about this error in upper
9921         layers, like:
9922
9923         int old = Report.Errors;
9924         x = new PropertyExpr (...);
9925         if (old != Report.Errors)
9926                 return null;
9927         else
9928                 return x;
9929
9930         So the property expr is returned, but it is invalid, so the error
9931         will be flagged during the resolve process. 
9932
9933         * class.cs: Remove InheritablePropertySignatureCompare from the
9934         class, as we no longer depend on the property signature to compute
9935         whether it is possible to implement a method or not.
9936
9937         The reason is that calling PropertyInfo.GetGetMethod will return
9938         null (in .NET, in Mono it works, and we should change this), in
9939         cases where the Get Method does not exist in that particular
9940         class.
9941
9942         So this code:
9943
9944         class X { public virtual int A { get { return 1; } } }
9945         class Y : X { }
9946         class Z : Y { public override int A { get { return 2; } } }
9947
9948         Would fail in Z because the parent (Y) would not have the property
9949         defined.  So we avoid this completely now (because the alternative
9950         fix was ugly and slow), and we now depend exclusively on the
9951         method names.
9952
9953         (PropertyBase.CheckBase): Use a method-base mechanism to find our
9954         reference method, instead of using the property.
9955
9956         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9957         routines are gone now.
9958
9959         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9960         names, they were incorrectly named.
9961
9962         * cs-tokenizer.cs: Return are more gentle token on failure. 
9963
9964         * pending.cs (PendingImplementation.InterfaceMethod): This routine
9965         had an out-of-sync index variable, which caused it to remove from
9966         the list of pending methods the wrong method sometimes.
9967
9968 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
9969
9970         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9971         CanWrite, because those refer to this particular instance of the
9972         property, and do not take into account the fact that we can
9973         override single members of a property.
9974
9975         Constructor requires an EmitContext.  The resolution process does
9976         not happen here, but we need to compute the accessors before,
9977         because the resolution does not always happen for properties.
9978
9979         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
9980         subclass, before we did not update this flag, but we did update
9981         bindingflags. 
9982
9983         (GetAccessors): Drop this routine, as it did not work in the
9984         presence of partially overwritten set/get methods. 
9985
9986         Notice that this broke the cs1540 detection, but that will require
9987         more thinking. 
9988
9989 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9990
9991         * class.cs:
9992         * codegen.cs:
9993         * driver.cs: issue a warning instead of an error if we don't support
9994         debugging for the platform. Also ignore a couple of errors that may
9995         arise when trying to write the symbols. Undo my previous patch.
9996
9997 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9998
9999         * driver.cs: ignore /debug switch except for Unix platforms.
10000
10001 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10002
10003         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10004
10005 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10006
10007         * driver.cs: Do not make mcs-debug conditional, so we do not break
10008         builds that use it.
10009
10010         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10011         review this patch.  But basically after all the children variables
10012         have been merged, the value of "Breaks" was not being set to
10013         new_breaks for Switch blocks.  I think that it should be set after
10014         it has executed.  Currently I set this to the value of new_breaks,
10015         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10016         conservative, but I do not understand this code very well.
10017
10018         I did not break anything in the build, so that is good ;-)
10019
10020         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10021
10022 2002-10-20  Mark Crichton  <crichton@gimp.org>
10023
10024         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10025
10026 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10027
10028         * cfold.cs: Fixed compile blocker.
10029
10030 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * driver.cs: I was chekcing the key, not the file.
10033
10034 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10035
10036         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10037         message that we were generating - we just need to silently return
10038         a null.
10039
10040 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10041
10042         * class.cs (Event.Define): Change my previous commit, as this
10043         breaks the debugger.  This is a temporary hack, as it seems like
10044         the compiler is generating events incorrectly to begin with.
10045
10046         * expression.cs (Binary.ResolveOperator): Added support for 
10047         "U operator - (E x, E y)"
10048
10049         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10050         y)".
10051
10052         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10053         init-only variables, but this path did not take into account that
10054         there might be also instance readonly variables.  Correct this
10055         problem. 
10056
10057         This fixes bug 32253
10058
10059         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10060         delegates as well.
10061
10062         * driver.cs: Change the extension for modules to `netmodule'
10063
10064         * cs-parser.jay: Improved slightly the location tracking for
10065         the debugger symbols.
10066
10067         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10068         modifiers that were specified instead of the hardcoded value
10069         (FamAndAssem).  This was basically ignoring the static modifier,
10070         and others.  Fixes 32429.
10071
10072         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10073         fixed a bug in the process (32476)
10074
10075         * expression.cs (ArrayAccess.EmitAssign): Patch from
10076         hwang_rob@yahoo.ca that fixes bug 31834.3
10077
10078 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * driver.cs: Make the module extension .netmodule.
10081
10082 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10083
10084         * driver.cs: Report an error if the resource file is not found
10085         instead of crashing.
10086
10087         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10088         false, like Emit does.
10089
10090 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10091
10092         * typemanager.cs: Remove unused private member.  Also reported mcs
10093         bug to report this as a warning like csc.
10094
10095 2002-10-15  Martin Baulig  <martin@gnome.org>
10096
10097         * statement.cs (Statement.Emit): Made this a virtual method; emits
10098         the line number info and calls DoEmit().
10099         (Statement.DoEmit): New protected abstract method, formerly knows
10100         as Statement.Emit().
10101
10102         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10103
10104 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10105
10106         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10107         have fixed a remaining problem: not every AddXXXX was adding a
10108         fully qualified name.  
10109
10110         Now everyone registers a fully qualified name in the DeclSpace as
10111         being defined instead of the partial name.  
10112
10113         Downsides: we are slower than we need to be due to the excess
10114         copies and the names being registered this way.  
10115
10116         The reason for this is that we currently depend (on the corlib
10117         bootstrap for instance) that types are fully qualified, because
10118         we dump all the types in the namespace, and we should really have
10119         types inserted into the proper namespace, so we can only store the
10120         basenames in the defined_names array.
10121
10122 2002-10-10  Martin Baulig  <martin@gnome.org>
10123
10124         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10125         from bug #31834, see the bug report for a testcase which is
10126         miscompiled.
10127
10128 2002-10-10  Martin Baulig  <martin@gnome.org>
10129
10130         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10131         flow analysis code for this.
10132
10133         * statement.cs (Do, While, For): Tell the flow analysis code about
10134         infinite loops.
10135         (FlowBranching.UsageVector): Added support for infinite loops.
10136         (Block.Resolve): Moved the dead code elimination here and use flow
10137         analysis to do it.
10138
10139 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10140
10141         * class.cs (Field.Define): Catch cycles on struct type
10142         definitions. 
10143
10144         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10145         fields if the fields are static.  We only need to check instance
10146         fields. 
10147
10148         * expression.cs (As.DoResolve): Test for reference type.
10149
10150         * statement.cs (Using.ResolveExpression): Use
10151         ConvertImplicitRequired, not ConvertImplicit which reports an
10152         error on failture
10153         (Using.ResolveLocalVariableDecls): ditto.
10154
10155         * expression.cs (Binary.ResolveOperator): Report errors in a few
10156         places where we had to.
10157
10158         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10159
10160 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * expression.cs: Use StoreFromPtr instead of extracting the type
10163         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10164
10165         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10166         an enumeration value to a System.Enum, but System.Enum is not a
10167         value type, but an class type, so we need to box.
10168
10169         (Expression.ConvertExplicit): One codepath could return
10170         errors but not flag them.  Fix this.  Fixes #31853
10171
10172         * parameter.cs (Resolve): Do not allow void as a parameter type.
10173
10174 2002-10-06  Martin Baulig  <martin@gnome.org>
10175
10176         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10177         if it's a class type and not a struct.  Fixes #31815.
10178
10179 2002-10-06  Martin Baulig  <martin@gnome.org>
10180
10181         * statement.cs: Reworked the flow analysis code a bit to make it
10182         usable for dead code elimination.
10183
10184 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10185
10186         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10187
10188 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10191         to fix the test 165, will investigate deeper.
10192
10193 2002-10-04  Martin Baulig  <martin@gnome.org>
10194
10195         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10196         finally blocks actually work.
10197         (Try.Resolve): We don't need to create a sibling for `finally' if
10198         there is no finally block.
10199
10200 2002-10-04  Martin Baulig  <martin@gnome.org>
10201
10202         * class.cs (Constructor.Define): The default accessibility for a
10203         non-default constructor is private, not public.
10204
10205 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * class.cs (Constructor): Make AllowedModifiers public, add
10208         EXTERN.
10209
10210         * cs-parser.jay: Perform the modifiers test here, as the
10211         constructor for the Constructor class usually receives a zero
10212         because of the way we create it (first we create, later we
10213         customize, and we were never checking the modifiers).
10214
10215         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10216         is a version of LookupTypeReflection that includes the type-name
10217         cache.  This can be used as a fast path for functions that know
10218         the fully qualified name and are only calling into *.GetType() to
10219         obtain a composed type.
10220
10221         This is also used by TypeManager.LookupType during its type
10222         composition.
10223
10224         (LookupType): We now also track the real type name, as sometimes
10225         we can get a quey for the real type name from things like
10226         ComposedCast.  This fixes bug 31422.
10227
10228         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10229         complete type fullname, it does not have to go through the type
10230         resolution system to obtain the composed version of the type (for
10231         obtaining arrays or pointers).
10232
10233         (Conditional.Emit): Use the EmitBoolExpression to
10234         generate nicer code, as requested by Paolo.
10235
10236         (ArrayCreation.CheckIndices): Use the patch from
10237         hwang_rob@yahoo.ca to validate the array initializers. 
10238
10239 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10240
10241         * class.cs (ConstructorInitializer.Emit): simplify code by using
10242         Invocation.EmitCall, and at the same time, fix the bugs in calling
10243         parent constructors that took variable arguments. 
10244
10245         * ecore.cs (Expression.ConvertNumericExplicit,
10246         Expression.ImplicitNumericConversion): Remove the code that
10247         manually wrapped decimal (InternalTypeConstructor call is now gone
10248         as well).
10249
10250         * expression.cs (Cast.TryReduce): Also handle decimal types when
10251         trying to perform a constant fold on the type.
10252
10253         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10254
10255         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10256         that only turned off an error report, and did nothing else. 
10257
10258 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10259
10260         * driver.cs: Handle and ignore /fullpaths
10261
10262 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * expression.cs (Binary.ResolveOperator): Catch the case where
10265         DoNumericPromotions returns true, 
10266
10267         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10268
10269 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10270
10271         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10272         report error 70.
10273
10274 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10275
10276         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10277         conversion exists, but it is also required that the conversion be
10278         performed.  This manifested in "(Type64Enum) 2".  
10279
10280         * class.cs (TypeManager.AddMethod): The fix is not to change
10281         AddEnum, because that one was using a fully qualified name (every
10282         DeclSpace derivative does), but to change the AddMethod routine
10283         that was using an un-namespaced name.  This now correctly reports
10284         the duplicated name.
10285
10286         Revert patch until I can properly fix it.  The issue
10287         is that we have a shared Type space across all namespaces
10288         currently, which is wrong.
10289
10290         Options include making the Namespace a DeclSpace, and merge
10291         current_namespace/current_container in the parser.
10292
10293 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10294
10295         * cs-parser.jay: Improve error reporting when we get a different
10296         kind of expression in local_variable_type and
10297         local_variable_pointer_type. 
10298
10299         Propagate this to avoid missleading errors being reported.
10300
10301         * ecore.cs (ImplicitReferenceConversion): treat
10302         TypeManager.value_type as a target just like object_type.   As
10303         code like this:
10304
10305         ValueType v = 1;
10306
10307         Is valid, and needs to result in the int 1 being boxed before it
10308         is assigned to the value type v.
10309
10310         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10311         to validate the enumeration name.
10312
10313         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10314         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10315         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10316
10317         * ecore.cs (TryImplicitIntConversion): When doing an
10318         implicit-enumeration-conversion, check if the type is 64-bits and
10319         perform a conversion before passing to EnumConstant.
10320
10321 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10322
10323         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10324         report ambiguous type references.  Unlike the MS version, we
10325         report what the ambiguity is.   Innovation at work ;-)
10326
10327         (DeclSpace.FindType): Require a location argument to
10328         display when we display an ambiguous error.
10329
10330         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10331
10332         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10333
10334         * expression.cs (EmitDynamicInitializers): Apply patch from
10335         hwang_rob@yahoo.ca that fixes the order in which we emit our
10336         initializers. 
10337
10338 2002-09-21  Martin Baulig  <martin@gnome.org>
10339
10340         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10341         delegate takes no arguments.
10342
10343 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10344
10345         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10346         from integers.
10347
10348         * expression.cs: Extract the underlying type.
10349
10350         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10351
10352         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10353
10354 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10355
10356         * class.cs (TypeContainer.DefineType): We can not use the nice
10357         PackingSize with the size set to 1 DefineType method, because it
10358         will not allow us to define the interfaces that the struct
10359         implements.
10360
10361         This completes the fixing of bug 27287
10362
10363         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10364         means also structs.  This fixes part of the problem. 
10365         (Expresion.ImplicitReferenceConversionExists): ditto.
10366
10367         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10368         error if there were no errors reported during the type lookup
10369         process, to avoid duplicates or redundant errors.  Without this
10370         you would get an ambiguous errors plus a type not found.  We have
10371         beaten the user enough with the first error.  
10372
10373         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10374         reference. 
10375
10376         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10377         during the resolution process, stop the lookup, this avoids
10378         repeated error reports (same error twice).
10379
10380         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10381
10382         * typemanager.cs (LookupType): Redo the type lookup code to match
10383         the needs of System.Reflection.  
10384
10385         The issue is that System.Reflection requires references to nested
10386         types to begin with a "+" sign instead of a dot.  So toplevel
10387         types look like: "NameSpace.TopLevelClass", and nested ones look
10388         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10389         levels. 
10390
10391 2002-09-19  Martin Baulig  <martin@gnome.org>
10392
10393         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10394         says that a method always returns or always throws an exception,
10395         don't report the CS0161.
10396
10397         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10398         set `Returns = new_returns'.
10399
10400 2002-09-19  Martin Baulig  <martin@gnome.org>
10401
10402         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10403         to an enum constant, check for a CS0176.
10404
10405 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10406
10407         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10408         for operators that must be in pairs and report errors.
10409
10410         * ecore.cs (SimpleName.DoResolveType): During the initial type
10411         resolution process, when we define types recursively, we must
10412         check first for types in our current scope before we perform
10413         lookups in the enclosing scopes.
10414
10415         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10416
10417         (Invocation.VerifyArgumentsCompat): Call
10418         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10419         I thought we were supposed to always call this, but there are a
10420         few places in the code where we dont do it.
10421
10422 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10423
10424         * driver.cs: Add support in -linkres and -resource to specify the
10425         name of the identifier.
10426
10427 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * ecore.cs (StandardConversionExists): Sync with the conversion
10430         code: allow anything-* to void* conversions.
10431
10432         (FindMostSpecificSource): Use an Expression argument
10433         instead of a Type, because we might be handed over a Literal which
10434         gets a few more implicit conversions that plain types do not.  So
10435         this information was being lost.
10436
10437         Also, we drop the temporary type-holder expression when not
10438         required.
10439
10440 2002-09-17  Martin Baulig  <martin@gnome.org>
10441
10442         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10443         this is an explicit interface implementation.
10444
10445 2002-09-17  Martin Baulig  <martin@gnome.org>
10446
10447         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10448         different `IndexerName' attributes.
10449
10450         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10451         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10452         virtual CommonResolve().
10453
10454 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10455
10456         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10457         and convert that to the UnderlyingType.
10458
10459         * statement.cs (Foreach.Resolve): Indexers are just like variables
10460         or PropertyAccesses.
10461
10462         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10463         inside quoted strings, we were not doing this before.
10464
10465 2002-09-16  Martin Baulig  <martin@gnome.org>
10466
10467         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10468         resolve it.  This is needed for the definite assignment check of the
10469         instance expression, fixes bug #29846.
10470         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10471
10472 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10473
10474         * parameter.cs: Fix compile error.  Cannot reference static member
10475         from an instance object.  Is this an mcs bug?
10476
10477 2002-09-14  Martin Baulig  <martin@gnome.org>
10478
10479         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10480         multiple times.  Fixes bug #30295, added test-166.cs.
10481
10482 2002-09-14  Martin Baulig  <martin@gnome.org>
10483
10484         * statement.cs (Block.Emit): Don't emit unreachable code.
10485         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10486         `break' statements.
10487         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10488
10489 2002-09-14  Martin Baulig  <martin@gnome.org>
10490
10491         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10492         is set.
10493
10494 2002-09-14  Martin Baulig  <martin@gnome.org>
10495
10496         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10497         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10498         be false on the ms runtime.
10499
10500 2002-09-13  Martin Baulig  <martin@gnome.org>
10501
10502         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10503         the CS0038 error message.
10504
10505 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10506
10507         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10508         constant inside, return it.
10509
10510 2002-09-12  Martin Baulig  <martin@gnome.org>
10511
10512         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10513         implicit conversion can be done between enum types.
10514
10515         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10516         check whether an implicit conversion to the current enum's UnderlyingType
10517         exists and report an error if not.
10518
10519         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10520         without debugging support.
10521
10522         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10523         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10524
10525 2002-09-12  Martin Baulig  <martin@gnome.org>
10526
10527         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10528
10529         * ecore.cs (IMemberExpr.DeclaringType): New property.
10530         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10531         nonstatic member of an outer type (CS0038).
10532
10533 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10534
10535         * driver.cs: Activate the using-error detector at warning level
10536         4 (at least for MS-compatible APIs).
10537
10538         * namespace.cs (VerifyUsing): Small buglett fix.
10539
10540         * pending.cs (PendingImplementation): pass the container pointer. 
10541
10542         * interface.cs (GetMethods): Allow for recursive definition.  Long
10543         term, I would like to move every type to support recursive
10544         definitions, not the current ordering mechanism that we have right
10545         now.
10546
10547         The situation is this: Attributes are handled before interfaces,
10548         so we can apply attributes to interfaces.  But some attributes
10549         implement interfaces, we will now handle the simple cases
10550         (recursive definitions will just get an error).  
10551
10552         * parameter.cs: Only invalidate types at the end if we fail to
10553         lookup all types.  
10554
10555 2002-09-09  Martin Baulig  <martin@gnome.org>
10556
10557         * ecore.cs (PropertyExpr.Emit): Also check for
10558         TypeManager.system_int_array_get_length so this'll also work when
10559         compiling corlib.  Fixes #30003.
10560
10561 2002-09-09  Martin Baulig  <martin@gnome.org>
10562
10563         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10564         and throw an exception if we can't get the type's size.  Fixed #30040,
10565         added test-165.cs.
10566
10567 2002-09-09  Martin Baulig  <martin@gnome.org>
10568
10569         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10570
10571         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10572         context.  Fixes bug #30027.
10573
10574         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10575         virtual functions.  Fixes bug #30043, added test-164.cs.
10576
10577 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10578
10579         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10580
10581 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10582
10583         * driver.cs: Use an object to get the windows codepage since it's not a
10584         static property.
10585
10586 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10587
10588         * statement.cs (For.Emit): for infinite loops (test == null)
10589         return whether there is a break inside, not always "true".
10590
10591         * namespace.cs (UsingEntry): New struct to hold the name of the
10592         using definition, the location where it is defined, and whether it
10593         has been used in a successful type lookup.
10594
10595         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10596         strings.
10597
10598         * decl.cs: ditto.
10599
10600 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10601
10602         * attribute.cs : Fix incorrect code which relied on catching
10603         a NullReferenceException to detect a null being passed in
10604         where an object was expected.
10605
10606 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10607
10608         * statement.cs (Try): flag the catch variable as assigned
10609
10610         * expression.cs (Cast): Simplified by using ResolveType instead of
10611         manually resolving.
10612
10613         * statement.cs (Catch): Fix bug by using ResolveType.
10614
10615 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10616
10617         * expression.cs (BetterConversion): Special case for when we have
10618         a NullLiteral as the argument and we have to choose between string
10619         and object types - we choose string the way csc does.
10620
10621         * attribute.cs (Attribute.Resolve): Catch the
10622         NullReferenceException and report error #182 since the Mono
10623         runtime no more has the bug and having this exception raised means
10624         we tried to select a constructor which takes an object and is
10625         passed a null.
10626
10627 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10628
10629         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10630         message (1502, 1503) when we can't locate a method after overload
10631         resolution. This is much more informative and closes the bug
10632         Miguel reported.
10633
10634         * interface.cs (PopulateMethod): Return if there are no argument
10635         types. Fixes a NullReferenceException bug.
10636
10637         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10638         expressions too. Previously we were checking only in one place for
10639         positional arguments leaving out named arguments.
10640
10641         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10642         type to the enum type is not allowed. Remove code corresponding to
10643         that.
10644
10645         (ConvertNumericExplicit): Allow explicit conversions from
10646         the underlying type to enum type. This precisely follows the spec
10647         and closes a bug filed by Gonzalo.
10648
10649 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10650
10651         * compiler.csproj:
10652         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10653
10654 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10655
10656         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10657         it was important that we stored the right value after the
10658         reduction in `converted'.
10659
10660 2002-09-04  Martin Baulig  <martin@gnome.org>
10661
10662         * location.cs (Location.SymbolDocument): Use full pathnames for the
10663         source files.
10664
10665 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10666
10667         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10668         of the expression resolve mechanism, because that will catch the
10669         SimpleName error failures.
10670
10671         (Conditional): If we can not resolve the
10672         expression, return, do not crash.
10673
10674 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10675
10676         * cs-tokenizer.cs:
10677         (location): display token name instead of its number.
10678
10679 2002-08-28  Martin Baulig  <martin@gnome.org>
10680
10681         * expression.cs (Binary.ResolveOperator): Don't silently return
10682         but return an error if an operator cannot be applied between two
10683         enum types.
10684
10685 2002-08-28  Martin Baulig  <martin@gnome.org>
10686
10687         * class.cs (Constructor.Define): Set the permission attributes
10688         correctly instead of making all constructors public.
10689
10690 2002-08-28  Martin Baulig  <martin@gnome.org>
10691
10692         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10693         for private members before reporting a CS0103; if we find anything,
10694         it's a CS0122.
10695
10696 2002-08-28  Martin Baulig  <martin@gnome.org>
10697
10698         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10699         to check whether `closure_start_type == closure_invocation_type',
10700         we also need to check whether `m.DeclaringType == closure_invocation_type'
10701         before bypassing the permission checks.  We might be accessing
10702         protected/private members from the base class.
10703         (TypeManager.RealMemberLookup): Only set private_ok if private
10704         members were requested via BindingFlags.NonPublic.
10705
10706         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10707
10708         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10709         MethodGroupExpr.IsExplicitImpl if appropriate.
10710         (Invocation.DoResolve): Don't report the CS0120 for explicit
10711         interface implementations.
10712
10713 2002-08-27  Martin Baulig  <martin@gnome.org>
10714
10715         * expression.cs (Invocation.DoResolve): If this is a static
10716         method and we don't have an InstanceExpression, we must report
10717         a CS0120.
10718
10719 2002-08-25  Martin Baulig  <martin@gnome.org>
10720
10721         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10722         `==' between a valuetype and an object.
10723
10724 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10725
10726         * ecore.cs (TypeExpr): Provide a ToString method.
10727
10728 2002-08-24  Martin Baulig  <martin@gnome.org>
10729
10730         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10731         now called proggie.dbg and it's a binary file.
10732
10733 2002-08-23  Martin Baulig  <martin@gnome.org>
10734
10735         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10736
10737 2002-08-23  Martin Baulig  <martin@gnome.org>
10738
10739         * struct.cs (MyStructInfo.ctor): Make this work with empty
10740         structs; it's not allowed to use foreach() on null.
10741
10742 2002-08-23  Martin Baulig  <martin@gnome.org>
10743
10744         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10745         writer the full pathname of the generated assembly.
10746
10747 2002-08-23  Martin Baulig  <martin@gnome.org>
10748
10749         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10750         A `finally' block never returns or breaks; improved handling of
10751         unreachable code.
10752
10753 2002-08-23  Martin Baulig  <martin@gnome.org>
10754
10755         * statement.cs (Throw.Resolve): Allow `throw null'.
10756
10757 2002-08-23  Martin Baulig  <martin@gnome.org>
10758
10759         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10760         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10761         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10762         MemberLookup would return a wrong event if this is an explicit
10763         interface implementation and the class has an event with the same
10764         name.
10765
10766 2002-08-23  Martin Baulig  <martin@gnome.org>
10767
10768         * statement.cs (Block.AddChildVariableNames): New public method.
10769         (Block.AddChildVariableName): Likewise.
10770         (Block.IsVariableNameUsedInChildBlock): Likewise.
10771         (Block.AddVariable): Check whether a variable name has already
10772         been used in a child block.
10773
10774         * cs-parser.jay (declare_local_variables): Mark all variable names
10775         from the current block as being used in a child block in the
10776         implicit block.
10777
10778 2002-08-23  Martin Baulig  <martin@gnome.org>
10779
10780         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10781         find the symbol writer.
10782
10783         * driver.cs: csc also allows the arguments to /define being
10784         separated by commas, not only by semicolons.
10785
10786 2002-08-23  Martin Baulig  <martin@gnome.org>
10787
10788         * interface.cs (Interface.GetMembers): Added static check for events.
10789
10790 2002-08-15  Martin Baulig  <martin@gnome.org>
10791
10792         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10793         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10794
10795         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10796         why the MethodData.EmitDestructor() change was necessary.
10797
10798 2002-08-20  Martin Baulig  <martin@gnome.org>
10799
10800         * class.cs (TypeContainer.FindMembers): Added static check for events.
10801
10802         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10803
10804         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10805         use Type.GetEvents(), not Type.FindMembers().
10806
10807 2002-08-20  Martin Baulig  <martin@gnome.org>
10808
10809         * decl.cs (MemberCache): Added a special method cache which will
10810         be used for method-only searched.  This ensures that a method
10811         search will return a MethodInfo with the correct ReflectedType for
10812         inherited methods.      
10813
10814 2002-08-20  Martin Baulig  <martin@gnome.org>
10815
10816         * decl.cs (DeclSpace.FindMembers): Made this public.
10817
10818 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10819
10820         * delegate.cs: fixed build on windows.
10821         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10822
10823 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10824
10825         * ecore.cs (StandardConversionExists): Return a false
10826         if we are trying to convert the void type to anything else
10827         since that is not allowed.
10828
10829         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10830         we flag error 70 in the event an event is trying to be accessed
10831         directly from outside the declaring type.
10832
10833 2002-08-20  Martin Baulig  <martin@gnome.org>
10834
10835         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10836         MemberCache from typemanager.cs to decl.cs.
10837
10838 2002-08-19  Martin Baulig  <martin@gnome.org>
10839
10840         * class.cs (TypeContainer): Implement IMemberContainer.
10841         (TypeContainer.DefineMembers): Create the MemberCache.
10842         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10843         return public members if BindingFlags.Public was given, check
10844         whether members are static.
10845
10846 2002-08-16  Martin Baulig  <martin@gnome.org>
10847
10848         * decl.cs (DeclSpace.Define): Splitted this in Define and
10849         DefineMembers.  DefineMembers is called first and initializes the
10850         MemberCache.
10851
10852         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10853         DefineMembers() on all our DeclSpaces.
10854
10855         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10856         but call DefineMembers() on all nested interfaces.  We call their
10857         Define() in our new Define() function.
10858
10859         * interface.cs (Interface): Implement IMemberContainer.
10860         (Interface.Define): Moved all code except the attribute stuf to
10861         DefineMembers().
10862         (Interface.DefineMembers): Initialize the member cache.
10863
10864         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10865         need this anymore since we can use MemberCache.FindMembers directly.
10866
10867 2002-08-19  Martin Baulig  <martin@gnome.org>
10868
10869         * typemanager.cs (MemberCache): When creating the cache for an
10870         interface type, add all inherited members.
10871         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10872         to `out bool used_cache' and documented it.
10873         (TypeManager.MemberLookup): If we already used the cache in the first
10874         iteration, we don't need to do the interfaces check.
10875
10876 2002-08-19  Martin Baulig  <martin@gnome.org>
10877
10878         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10879         here from IMemberFinder and don't implement this interface anymore.
10880         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10881
10882         * typemanager.cs (IMemberFinder): This interface is now only used by
10883         classes which actually support the member cache.
10884         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10885         since we only put DeclSpaces into this Hashtable.
10886         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10887         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10888
10889 2002-08-16  Martin Baulig  <martin@gnome.org>
10890
10891         * typemanager.cs (ICachingMemberFinder): Removed.
10892         (IMemberFinder.MemberCache): New property.
10893         (TypeManager.FindMembers): Merged this with RealFindMembers().
10894         This function will never be called from TypeManager.MemberLookup()
10895         so we can't use the cache here, just the IMemberFinder.
10896         (TypeManager.MemberLookup_FindMembers): Check whether the
10897         IMemberFinder has a MemberCache and call the cache's FindMembers
10898         function.
10899         (MemberCache): Rewrote larger parts of this yet another time and
10900         cleaned it up a bit.
10901
10902 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10903
10904         * driver.cs (LoadArgs): Support quoting.
10905
10906         (Usage): Show the CSC-like command line arguments.
10907
10908         Improved a few error messages.
10909
10910 2002-08-15  Martin Baulig  <martin@gnome.org>
10911
10912         * typemanager.cs (IMemberContainer.Type): New property.
10913         (IMemberContainer.IsInterface): New property.
10914
10915         The following changes are conditional to BROKEN_RUNTIME, which is
10916         defined at the top of the file.
10917
10918         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10919         class'es members, but add all members from TypeHandle.ObjectType
10920         if we're an interface.
10921         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10922         is the current type.
10923         (MemberCache.CacheEntry.Container): Removed this field.
10924         (TypeHandle.GetMembers): Include inherited members.
10925
10926 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10927
10928         * typemanager.cs: fixed compilation and added a comment on a field that
10929         is never used.
10930
10931 2002-08-15  Martin Baulig  <martin@gnome.org>
10932
10933         * class.cs (ConstructorInitializer.Resolve): In the
10934         Expression.MemberLookup call, use the queried_type as
10935         invocation_type.
10936
10937         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10938         declared' attribute, it's always true.
10939         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10940         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10941         temporary wrapper for FindMembers which tells MemberLookup whether
10942         members from the base classes are included in the return value.
10943         This will go away soon.
10944         (TypeManager.MemberLookup): Use this temporary hack here; once the
10945         new MemberCache is completed, we don't need to do the DeclaredOnly
10946         looping here anymore since the MemberCache will take care of this.
10947         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10948         (MemberCache): When creating the MemberCache for a class, get
10949         members from the current class and all its base classes.
10950         (MemberCache.CacheEntry.Container): New field.  This is a
10951         temporary hack until the Mono runtime is fixed to distinguish
10952         between ReflectedType and DeclaringType.  It allows us to use MCS
10953         with both the MS runtime and the unfixed Mono runtime without
10954         problems and without accecting performance.
10955         (MemberCache.SearchMembers): The DeclaredOnly looping from
10956         TypeManager.MemberLookup is now done here.      
10957
10958 2002-08-14  Martin Baulig  <martin@gnome.org>
10959
10960         * statement.cs (MyStructInfo.MyStructInfo): Don't call
10961         Type.GetFields on dynamic types but get the fields from the
10962         corresponding TypeContainer.
10963         (MyStructInfo.GetStructInfo): Added check for enum types.
10964
10965         * typemanager.cs (MemberList.IsSynchronized): Implemented.
10966         (MemberList.SyncRoot): Implemented.
10967         (TypeManager.FilterWithClosure): No need to check permissions if
10968         closure_start_type == closure_invocation_type, don't crash if
10969         closure_invocation_type is null.
10970
10971 2002-08-13  Martin Baulig  <martin@gnome.org>
10972
10973         Rewrote TypeContainer.FindMembers to use a member cache.  This
10974         gives us a speed increase of about 35% for the self-hosting MCS
10975         build and of about 15-20% for the class libs (both on GNU/Linux).
10976
10977         * report.cs (Timer): New class to get enhanced profiling.  This
10978         whole class is "TIMER" conditional since it remarkably slows down
10979         compilation speed.
10980
10981         * class.cs (MemberList): New class.  This is an IList wrapper
10982         which we're now using instead of passing MemberInfo[]'s around to
10983         avoid copying this array unnecessarily.
10984         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
10985         (ICachingMemberFinder, IMemberContainer): New interface.
10986         (TypeManager.FilterWithClosure): If `criteria' is null, the name
10987         has already been checked, otherwise use it for the name comparision.
10988         (TypeManager.FindMembers): Renamed to RealMemberFinder and
10989         provided wrapper which tries to use ICachingMemberFinder.FindMembers
10990         if possible.  Returns a MemberList, not a MemberInfo [].
10991         (TypeHandle): New class, implements IMemberContainer.  We create
10992         one instance of this class per type, it contains a MemberCache
10993         which is used to do the member lookups.
10994         (MemberCache): New class.  Each instance of this class contains
10995         all members of a type and a name-based hash table.
10996         (MemberCache.FindMembers): This is our new member lookup
10997         function.  First, it looks up all members of the requested name in
10998         the hash table.  Then, it walks this list and sorts out all
10999         applicable members and returns them.
11000
11001 2002-08-13  Martin Baulig  <martin@gnome.org>
11002
11003         In addition to a nice code cleanup, this gives us a performance
11004         increase of about 1.4% on GNU/Linux - not much, but it's already
11005         half a second for the self-hosting MCS compilation.
11006
11007         * typemanager.cs (IMemberFinder): New interface.  It is used by
11008         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11009         Enum, Delegate or Interface.
11010         (TypeManager.finder_to_member_finder): New PtrHashtable.
11011         (TypeManager.finder_to_container): Removed.
11012         (TypeManager.finder_to_delegate): Removed.
11013         (TypeManager.finder_to_interface): Removed.
11014         (TypeManager.finder_to_enum): Removed.
11015
11016         * interface.cs (Interface): Implement IMemberFinder.
11017
11018         * delegate.cs (Delegate): Implement IMemberFinder.
11019
11020         * enum.cs (Enum): Implement IMemberFinder.
11021
11022         * class.cs (TypeContainer): Implement IMemberFinder.
11023
11024 2002-08-12  Martin Baulig  <martin@gnome.org>
11025
11026         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11027
11028 2002-08-12  Martin Baulig  <martin@gnome.org>
11029
11030         * ecore.cs (ITypeExpression): New interface for expressions which
11031         resolve to a type.
11032         (TypeExpression): Renamed to TypeLookupExpression.
11033         (Expression.DoResolve): If we're doing a types-only lookup, the
11034         expression must implement the ITypeExpression interface and we
11035         call DoResolveType() on it.
11036         (SimpleName): Implement the new ITypeExpression interface.
11037         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11038         hack, the situation that we're only looking up types can't happen
11039         anymore when this method is called.  Moved the type lookup code to
11040         DoResolveType() and call it.
11041         (SimpleName.DoResolveType): This ITypeExpression interface method
11042         is now doing the types-only lookup.
11043         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11044         (ResolveFlags): Added MaskExprClass.
11045
11046         * expression.cs (MemberAccess): Implement the ITypeExpression
11047         interface.
11048         (MemberAccess.DoResolve): Added support for a types-only lookup
11049         when we're called via ITypeExpression.DoResolveType().
11050         (ComposedCast): Implement the ITypeExpression interface.
11051
11052         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11053         Expression.Resolve() with ResolveFlags.Type instead.
11054
11055 2002-08-12  Martin Baulig  <martin@gnome.org>
11056
11057         * interface.cs (Interface.Define): Apply attributes.
11058
11059         * attribute.cs (Attribute.ApplyAttributes): Added support for
11060         interface attributes.
11061
11062 2002-08-11  Martin Baulig  <martin@gnome.org>
11063
11064         * statement.cs (Block.Emit): Only check the "this" variable if we
11065         do not always throw an exception.
11066
11067         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11068         whether the property has a set accessor.
11069
11070 2002-08-11  Martin Baulig  <martin@gnome.org>
11071
11072         Added control flow analysis support for structs.
11073
11074         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11075         with control flow analysis turned off.
11076         (IVariable): New interface.
11077         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11078         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11079         (FieldExpr.DoResolve): Resolve the instance expression with flow
11080         analysis turned off and do the definite assignment check after the
11081         resolving when we know what the expression will resolve to.
11082
11083         * expression.cs (LocalVariableReference, ParameterReference):
11084         Implement the new IVariable interface, only call the flow analysis
11085         code if ec.DoFlowAnalysis is true.
11086         (This): Added constructor which takes a Block argument.  Implement
11087         the new IVariable interface.
11088         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11089         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11090         This does the definite assignment checks for struct members.
11091
11092         * class.cs (Constructor.Emit): If this is a non-static `struct'
11093         constructor which doesn't have any initializer, call
11094         Block.AddThisVariable() to tell the flow analysis code that all
11095         struct elements must be initialized before control returns from
11096         the constructor.
11097
11098         * statement.cs (MyStructInfo): New public class.
11099         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11100         argument to this indexer.  If non-zero, check an individual struct
11101         member, not the whole struct.
11102         (FlowBranching.CheckOutParameters): Check struct members.
11103         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11104         overloaded versions of these methods which take an additional
11105         `int field_idx' argument to check struct members.
11106         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11107         overloaded versions of these methods which take an additional
11108         `string field_name' argument to check struct member.s
11109         (VariableInfo): Implement the IVariable interface.
11110         (VariableInfo.StructInfo): New public property.  Returns the
11111         MyStructInfo instance of the variable if it's a struct or null.
11112         (Block.AddThisVariable): New public method.  This is called from
11113         Constructor.Emit() for non-static `struct' constructor which do
11114         not have any initializer.  It creates a special variable for the
11115         "this" instance variable which will be checked by the flow
11116         analysis code to ensure that all of the struct's fields are
11117         initialized before control returns from the constructor.
11118         (UsageVector): Added support for struct members.  If a
11119         variable/parameter is a struct with N members, we reserve a slot
11120         in the usage vector for each member.  A struct is considered fully
11121         initialized if either the struct itself (slot 0) or all its
11122         members are initialized.
11123
11124 2002-08-08  Martin Baulig  <martin@gnome.org>
11125
11126         * driver.cs (Driver.MainDriver): Only report an error CS5001
11127         if there were no compilation errors.
11128
11129         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11130         `UnsafeContext' property to determine whether the parent is in
11131         unsafe context rather than checking the parent's ModFlags:
11132         classes nested in an unsafe class are unsafe as well.
11133
11134 2002-08-08  Martin Baulig  <martin@gnome.org>
11135
11136         * statement.cs (UsageVector.MergeChildren): Distinguish between
11137         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11138         we return.  Added test17() and test18() to test-154.cs.
11139
11140 2002-08-08  Martin Baulig  <martin@gnome.org>
11141
11142         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11143         Family access, make sure the invoking type isn't a subclass of the
11144         queried type (that'd be a CS1540).
11145
11146         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11147         this method which takes an additional `Type invocation_type'.
11148
11149         * expression.cs (BaseAccess.DoResolve): Use the base type as
11150         invocation and query type.
11151         (MemberAccess.DoResolve): If the lookup failed and we're about to
11152         report a CS0122, try a lookup with the ec.ContainerType - if this
11153         succeeds, we must report a CS1540.
11154
11155 2002-08-08  Martin Baulig  <martin@gnome.org>
11156
11157         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11158         (MethodGroupExpr): Implement the IMemberExpr interface.
11159
11160         * expression (MemberAccess.ResolveMemberAccess): No need to have
11161         any special code for MethodGroupExprs anymore, they're now
11162         IMemberExprs.   
11163
11164 2002-08-08  Martin Baulig  <martin@gnome.org>
11165
11166         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11167         Family, FamANDAssem and FamORAssem permissions.
11168         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11169
11170 2002-08-08  Martin Baulig  <martin@gnome.org>
11171
11172         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11173         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11174         or loop block.
11175
11176 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11177
11178         * driver.cs: implemented /resource option to embed managed resources.
11179
11180 2002-08-07  Martin Baulig  <martin@gnome.org>
11181
11182         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11183         (FieldBase.HasFieldInitializer): New public property.
11184         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11185         returns the field initializer and makes sure it is only resolved once.
11186         (TypeContainer.EmitFieldInitializers): Call
11187         FieldBase.GetInitializerExpression to get the initializer, this ensures
11188         that it isn't resolved multiple times.
11189
11190         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11191         the resolving process (SimpleName/MemberLookup) that we're currently
11192         emitting a field initializer (which must not access any instance members,
11193         this is an error CS0236).
11194
11195         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11196         argument, if the `IsFieldInitializer' flag is set, we must report and
11197         error CS0236 and not an error CS0120.   
11198
11199 2002-08-07  Martin Baulig  <martin@gnome.org>
11200
11201         * ecore.cs (IMemberExpr): New public interface.
11202         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11203         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11204         if the expression is an IMemberExpr.
11205
11206         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11207         to be null, implicitly default to `this' if we're non-static in
11208         this case.  Simplified the code a lot by using the new IMemberExpr
11209         interface.  Also fixed bug #28176 here.
11210
11211 2002-08-06  Martin Baulig  <martin@gnome.org>
11212
11213         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11214         ParameterReferences during semantic analysis so that we can do a
11215         type-only search when resolving Cast, TypeOf and SizeOf.
11216         (block): Pass the `current_local_parameters' to the Block's
11217         constructor.
11218
11219         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11220         argument to the constructor.
11221         (ConstructorInitializer.Resolve): Create a temporary implicit
11222         block with the parameters.
11223
11224         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11225         references here if we aren't doing a type-only search.
11226
11227         * statement.cs (Block): Added constructor which takes a
11228         `Parameters parameters' argument.
11229         (Block.Parameters): New public property.
11230
11231         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11232         to `Parameters' and made it public readonly.
11233
11234 2002-08-06  Martin Baulig  <martin@gnome.org>
11235
11236         * ecore.cs (Expression.Warning): Made this public as well.
11237
11238         * report.cs (Report.Debug): Print the contents of collections.
11239
11240 2002-08-06  Martin Baulig  <martin@gnome.org>
11241
11242         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11243         used to tell Resolve() which kinds of expressions it may return.
11244         (Expression.Resolve): Added overloaded version of this method which
11245         takes a `ResolveFlags flags' argument.  This can be used to tell
11246         Resolve() which kinds of expressions it may return.  Reports a
11247         CS0118 on error.
11248         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11249         ResolveFlags.SimpleName.
11250         (Expression.Error118): Added overloaded version of this method which
11251         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11252         which kinds of expressions are allowed.
11253
11254         * expression.cs (Argument.ResolveMethodGroup): New public method.
11255         Resolves an argument, but allows a MethodGroup to be returned.
11256         This is used when invoking a delegate.
11257
11258         * TODO: Updated a bit.
11259
11260 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11261
11262         Fixed compilation with csc.
11263
11264         * ecore.cs: Expression.Error made public. Is this correct? Should
11265         Warning be made public too?
11266
11267         * expression.cs: use ea.Location instead of ea.loc.
11268         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11269
11270 2002-08-06  Martin Baulig  <martin@gnome.org>
11271
11272         * ecore.cs (Expression.loc): Moved the location here instead of
11273         duplicating it in all derived classes.
11274         (Expression.Location): New public property.
11275         (Expression.Error, Expression.Warning): Made them non-static and
11276         removed the location argument.
11277         (Expression.Warning): Added overloaded version which takes an
11278         `int level' argument.
11279         (Expression.Error118): Make this non-static and removed the
11280         expression and location arguments.
11281         (TypeExpr): Added location argument to the constructor.
11282
11283         * expression.cs (StaticCallExpr): Added location argument to
11284         the constructor.
11285         (Indirection, PointerArithmetic): Likewise.
11286         (CheckedExpr, UnCheckedExpr): Likewise.
11287         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11288         (StringPtr): Likewise.
11289
11290
11291 2002-08-05  Martin Baulig  <martin@gnome.org>
11292
11293         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11294
11295         * assign.cs (Assign.DoResolve): Check whether the source
11296         expression is a value or variable.
11297
11298         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11299         while resolving the corresponding blocks.
11300
11301         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11302         an error, don't silently return null.
11303
11304         * statement.cs (Block.AddVariable): Do the error reporting here
11305         and distinguish between CS0128 and CS0136.
11306         (Block.DoResolve): Report all unused labels (warning CS0164).
11307         (LabeledStatement): Pass the location to the constructor.
11308         (LabeledStatement.HasBeenReferenced): New property.
11309         (LabeledStatement.Resolve): Set it to true here.
11310
11311         * statement.cs (Return.Emit): Return success even after reporting
11312         a type mismatch error (CS0126 or CS0127), this is what csc does and
11313         it avoids confusing the users with any consecutive errors.
11314
11315 2002-08-05  Martin Baulig  <martin@gnome.org>
11316
11317         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11318
11319         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11320
11321         * expression.cs (MemberAccess.DoResolve): Silently return if an
11322         error has already been reported.
11323
11324         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11325         error has already been reported.
11326
11327 2002-08-05  Martin Baulig  <martin@gnome.org>
11328
11329         * statement.cs (UsageVector): Only initialize the `parameters'
11330         vector if we actually have any "out" parameters.
11331
11332 2002-08-05  Martin Baulig  <martin@gnome.org>
11333
11334         * expression.cs (Binary.ResolveOperator): When combining delegates,
11335         they must have the same type.
11336
11337 2002-08-05  Martin Baulig  <martin@gnome.org>
11338
11339         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11340         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11341         work with the ms runtime and we also don't need it: if we're a
11342         PropertyBuilder and not in the `indexer_arguments' hash, then we
11343         are a property and not an indexer.
11344
11345         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11346         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11347         since the latter one doesn't work with the ms runtime.
11348
11349 2002-08-03  Martin Baulig  <martin@gnome.org>
11350
11351         Fixed bugs #27998 and #22735.
11352
11353         * class.cs (Method.IsOperator): New public field.
11354         (Method.CheckBase): Report CS0111 if there's already a method
11355         with the same parameters in the current class.  Report CS0508 when
11356         attempting to change the return type of an inherited method.
11357         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11358         and it's not marked abstract or extern.
11359         (PropertyBase): New abstract base class for Property and Indexer.
11360         (PropertyBase.CheckBase): Moved here from Property and made it work
11361         for indexers.
11362         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11363         the same so we can reuse it there.
11364         (Property, Indexer): Derive from PropertyBase.
11365         (MethodSignature.inheritable_property_signature_filter): New delegate
11366         to find properties and indexers.
11367
11368         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11369         argument and improved error reporting.
11370
11371         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11372         EmptyReadOnlyParameters and made it a property.
11373
11374         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11375         version of this method which takes a `PropertyInfo indexer'.
11376         (TypeManager.RegisterIndexer): New method.
11377
11378         * class.cs: Added myself as author of this file :-)
11379
11380 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11381
11382         * class.cs: fixed compilation on windoze.
11383
11384 2002-08-03  Martin Baulig  <martin@gnome.org>
11385
11386         * interface.cs (Interface.GetInterfaceBases): Check whether all
11387         base interfaces are at least as accessible than the current one.
11388
11389         * class.cs (TypeContainer.GetClassBases): Check whether base types
11390         are at least as accessible than the current type.
11391         (TypeContainer.AsAccessible): Implemented and made non-static.
11392         (MemberBase.CheckParameters): Report errors if the accessibility
11393         checks fail.
11394
11395         * delegate.cs (Delegate.Delegate): The default visibility is
11396         internal for top-level types and private for nested types.
11397         (Delegate.Define): Report errors if the accessibility checks fail.
11398
11399         * enum.cs (Enum.Enum): The default visibility is internal for
11400         top-level types and private for nested types.
11401         (Enum.DefineType): Compute the correct visibility.
11402
11403         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11404         function which takes a `bool is_toplevel' instead of a TypeContainer.
11405
11406         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11407         builtin type.
11408
11409 2002-08-02  Martin Baulig  <martin@gnome.org>
11410
11411         * expression.cs (LocalVariableReferenc): Added constructor which
11412         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11413         (LocalVariableReference.IsReadOnly): New property.
11414         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11415         variable is readonly, use our own readonly flag to do this; you can
11416         use the new constructor to get a writable reference to a read-only
11417         variable.
11418
11419         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11420         reference to the local variable.
11421
11422 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11423
11424         * rootcontext.cs (ResolveCore): Also include System.Exception
11425
11426         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11427         we reach an EmptyStatement.
11428
11429         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11430         is also fine.
11431
11432         * expression.cs (Binary.ResolveOperator): Check error result in
11433         two places.
11434
11435         use brtrue/brfalse directly and avoid compares to null.
11436
11437 2002-08-02  Martin Baulig  <martin@gnome.org>
11438
11439         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11440         Fixes bug #28407, added test-155.cs.
11441
11442 2002-08-01  Martin Baulig  <martin@gnome.org>
11443
11444         * class.cs (Event.EmitDefaultMethod): Make this work with static
11445         events.  Fixes #28311, added verify-3.cs.
11446
11447 2002-08-01  Martin Baulig  <martin@gnome.org>
11448
11449         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11450         `is_disposable' fields.
11451         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11452         `hm.is_disposable' if we're using the collection pattern.
11453         (Foreach.EmitCollectionForeach): Use the correct type for the
11454         enumerator's local variable, only emit the try/finally block if
11455         necessary (fixes #27713).
11456
11457 2002-08-01  Martin Baulig  <martin@gnome.org>
11458
11459         * ecore.cs (Expression.report118): Renamed to Error118 and made
11460         it public static.
11461
11462         * statement.cs (Throw.Resolve): Check whether the expression is of
11463         the correct type (CS0118) and whether the type derives from
11464         System.Exception (CS0155).
11465         (Catch.Resolve): New method.  Do the type lookup here and check
11466         whether it derives from System.Exception (CS0155).
11467         (Catch.CatchType, Catch.IsGeneral): New public properties.
11468
11469         * typemanager.cs (TypeManager.exception_type): Added.
11470
11471 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11472
11473         * driver.cs: Updated About function.
11474
11475 2002-07-31  Martin Baulig  <martin@gnome.org>
11476
11477         Implemented Control Flow Analysis.
11478
11479         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11480         (EmitContext.CurrentBranching): Added.
11481         (EmitContext.StartFlowBranching): Added.
11482         (EmitContext.EndFlowBranching): Added.
11483         (EmitContext.KillFlowBranching): Added.
11484         (EmitContext.IsVariableAssigned): Added.
11485         (EmitContext.SetVariableAssigned): Added.
11486         (EmitContext.IsParameterAssigned): Added.
11487         (EmitContext.SetParameterAssigned): Added.
11488         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11489         Added control flow analysis stuff here.
11490
11491         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11492         resolve the expression as lvalue.
11493         (LocalVariableReference.DoResolve): Check whether the variable has
11494         already been assigned.
11495         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11496         the parameter as assigned here.
11497         (ParameterReference.DoResolve): Check whether the parameter has already
11498         been assigned.
11499         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11500         expression as lvalue.
11501
11502         * statement.cs (FlowBranching): New class for the flow analysis code.
11503         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11504         (LabeledStatement.IsDefined): New public property.
11505         (LabeledStatement.AddUsageVector): New public method to tell flow
11506         analyis that the label may be reached via a forward jump.
11507         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11508         flow analysis.
11509         (VariableInfo.Number): New public field.  This is used by flow analysis
11510         to number all locals of a block.
11511         (Block.CountVariables): New public property.  This is the number of
11512         local variables in this block (including the locals from all parent
11513         blocks).
11514         (Block.EmitMeta): Number all the variables.
11515
11516         * statement.cs: Added flow analysis support to all classes.
11517
11518 2002-07-31  Martin Baulig  <martin@gnome.org>
11519
11520         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11521         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11522         then use this argument.
11523
11524         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11525
11526         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11527         use this to specify /define options.
11528
11529 2002-07-29  Martin Baulig  <martin@gnome.org>
11530
11531         * statement.cs (Fixed): Moved all code that does variable lookups
11532         and resolvings from Emit to Resolve.
11533
11534         * statement.cs (For): Moved all code that does variable lookups
11535         and resolvings from Emit to Resolve.
11536
11537         * statement.cs (Using): Moved all code that does variable lookups
11538         and resolvings from Emit to Resolve.
11539
11540 2002-07-29  Martin Baulig  <martin@gnome.org>
11541
11542         * attribute.cs (Attribute.Resolve): Explicitly catch a
11543         System.NullReferenceException when creating the
11544         CustromAttributeBuilder and report a different warning message.
11545
11546 2002-07-29  Martin Baulig  <martin@gnome.org>
11547
11548         * support.cs (ParameterData.ParameterName): Added method to
11549         get the name of a parameter.
11550
11551         * typemanager.cs (TypeManager.IsValueType): New public method.
11552
11553 2002-07-29  Martin Baulig  <martin@gnome.org>
11554
11555         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11556         is a flag which specifies that it's either ref or out.
11557         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11558         the out parameter to `out Parameter.Modifier mod', also set the
11559         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11560
11561         * support.cs (InternalParameters.ParameterModifier): Distinguish
11562         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11563         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11564
11565         * expression.cs (Argument.GetParameterModifier): Distinguish
11566         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11567         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11568
11569 2002-07-29  Martin Baulig  <martin@gnome.org>
11570
11571         * expression.cs (ParameterReference.ParameterReference): Added
11572         `Location loc' argument to the constructor.
11573
11574         * cs-parser.jay: Pass location to ParameterReference.
11575
11576 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * statement.cs (Try): Initialize the location.
11579
11580         * cs-parser.jay: pass location to Try.
11581
11582         * expression.cs (Unary.Reduce): Change the prototype to return
11583         whether a constant fold could be performed or not.  The result is
11584         returned in an out parameters.  In the case of Indirection and
11585         AddressOf, we want to perform the full tests.
11586
11587 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11588
11589         * statement.cs (Statement.Emit): Flag dead code.
11590
11591 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11592
11593         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11594
11595 2002-07-27  Martin Baulig  <martin@gnome.org>
11596
11597         * class.cs (MethodData.Define): Put back call to
11598         TypeManager.AddMethod(), accidentally commented this out.
11599
11600         * report.cs (Debug): New public method to print debugging information,
11601         this is `[Conditional ("DEBUG")]'.
11602
11603 2002-07-26  Martin Baulig  <martin@gnome.org>
11604
11605         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11606         (switch_statement): Push the current_block to the switch_stack and
11607         pop it again when we're done with the switch.
11608         (switch_section): The new block is a child of the current_block.
11609         Fixes bug #24007, added test-152.cs.
11610
11611 2002-07-27  Martin Baulig  <martin@gnome.org>
11612
11613         * expression.cs (Invocation.EmitArguments): When calling a varargs
11614         function with only its fixed arguments, we need to pass an empty
11615         array.
11616
11617 2002-07-27  Martin Baulig  <martin@gnome.org>
11618
11619         Mono 0.13 has been released.
11620
11621 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11622
11623         * driver.cs: Rename --resource to --linkres, because that is what
11624         we do currently, we dont support --resource yet.
11625
11626         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11627
11628 2002-07-25  Martin Baulig  <martin@gnome.org>
11629
11630         * class.cs (MethodData): New public class.  This is a `method builder'
11631         class for a method or one accessor of a Property/Indexer/Event.
11632         (MethodData.GetMethodFlags): Moved here from MemberBase.
11633         (MethodData.ApplyAttributes): Likewise.
11634         (MethodData.ApplyObsoleteAttribute): Likewise.
11635         (MethodData.ApplyConditionalAttribute): Likewise.
11636         (MethodData.ApplyDllImportAttribute): Likewise.
11637         (MethodData.CheckAbstractAndExternal): Likewise.
11638         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11639         (MethodData.Emit): Formerly known as Method.Emit().
11640         (MemberBase): Moved everything which was specific to a single
11641         accessor/method to MethodData.
11642         (Method): Create a new MethodData and call Define() and Emit() on it.
11643         (Property, Indexer, Event): Create a new MethodData objects for each
11644         accessor and call Define() and Emit() on them.
11645
11646 2002-07-25  Martin Baulig  <martin@gnome.org>
11647
11648         Made MethodCore derive from MemberBase to reuse the code from there.
11649         MemberBase now also checks for attributes.
11650
11651         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11652         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11653         as virtual.
11654         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11655         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11656         (MemberBase.ApplyAttributes): New virtual method; applies the
11657         attributes to a method or accessor.
11658         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11659         (MemberBase.ApplyConditionalAttribute): Likewise.
11660         (MemberBase.ApplyDllImportAttribute): Likewise.
11661         (MemberBase.CheckAbstractAndExternal): Likewise.
11662         (MethodCore.ParameterTypes): This is now a property instead of a
11663         method, it's initialized from DoDefineParameters().
11664         (MethodCore.ParameterInfo): Removed the set accessor.
11665         (MethodCore.DoDefineParameters): New protected virtual method to
11666         initialize ParameterTypes and ParameterInfo.
11667         (Method.GetReturnType): We can now simply return the MemberType.
11668         (Method.GetMethodFlags): Override the MemberBase version and add
11669         the conditional flags.
11670         (Method.CheckBase): Moved some code from Define() here, call
11671         DoDefineParameters() here.
11672         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11673         here to avoid some larger code duplication.
11674         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11675         ensure that abstract and external accessors don't declare a body.
11676
11677         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11678         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11679         lookup in the attribute's parent classes, so we need to abort as soon
11680         as we found the first match.
11681         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11682         the attribute has no arguments.
11683
11684         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11685         of a Method.
11686
11687 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11688
11689         * cs-parser.jay: reverted previous patch.
11690
11691 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11692
11693         * cs-parser.jay: fixed bug #22119.
11694
11695 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11696
11697         * attribute.cs: fixed compilation. The error was:
11698         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11699         be assigned to before control leaves the current method."
11700         [FIXME:  Filed as bug #28186: MCS must report this error.]
11701
11702 2002-07-25  Martin Baulig  <martin@gnome.org>
11703
11704         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11705         method to pull the condition name ouf of a Conditional attribute.
11706         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11707         the obsolete message and error flag out of an Obsolete attribute.
11708
11709         * class.cs (Method.GetMethodFlags): New public method to get the
11710         TypeManager.MethodFlags for this method.
11711         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11712         private methods.
11713         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11714         if we're overriding a virtual function, set the new private variable
11715         `parent_method'; call the new TypeManager.AddMethod().
11716
11717         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11718         the MethodBuilder and the Method in a PtrHashtable.
11719         (TypeManager.builder_to_method): Added for this purpose.
11720         (TypeManager.MethodFlags): Added IsObsoleteError.
11721         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11722         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11723         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11724         the message from the attribute.
11725
11726 2002-07-24  Martin Baulig  <martin@gnome.org>
11727
11728         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11729         preprocessor directives, ensure that the argument to #define/#undef is
11730         exactly one identifier and that it's actually an identifier.
11731
11732         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11733         did not work ....
11734
11735 2002-07-24  Martin Baulig  <martin@gnome.org>
11736
11737         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11738         initialize it to TypeManager.object_type in the constructor.
11739         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11740         of the `hm.get_current' method if we're using the collection pattern.
11741         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11742         for the explicit conversion to make it work when we're using the collection
11743         pattern and the `Current' property has a different return type than `object'.
11744         Fixes #27713.
11745
11746 2002-07-24  Martin Baulig  <martin@gnome.org>
11747
11748         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11749         does not match, but don't report any errors.  This method is called in
11750         order for all methods in a MethodGroupExpr until a matching method is
11751         found, so we don't want to bail out if the first method doesn't match.
11752         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11753         matches, report the 123.  Fixes #28070.
11754
11755 2002-07-24  Martin Baulig  <martin@gnome.org>
11756
11757         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11758         TypeManager.TypeToCoreType() to the top of the method so the
11759         following equality checks will work.  Fixes #28107.
11760
11761 2002-07-24  Martin Baulig  <martin@gnome.org>
11762
11763         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11764         operand is of type uint, and the other operand is of type sbyte,
11765         short or int, the operands are converted to type long." -
11766         Actually do what this comment already told us.  Fixes bug #28106,
11767         added test-150.cs.
11768
11769 2002-07-24  Martin Baulig  <martin@gnome.org>
11770
11771         * class.cs (MethodBase): New abstract class.  This is now a base
11772         class for Property, Indexer and Event to avoid some code duplication
11773         in their Define() and DefineMethods() methods.
11774         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11775         generic methods for Define() and DefineMethods().
11776         (FieldBase): Derive from MemberBase, not MemberCore.
11777         (Property): Derive from MemberBase, not MemberCore.
11778         (Property.DefineMethod): Moved all the code from this method to the
11779         new MethodBase.DefineAccessor(), just call it with appropriate
11780         argumetnts.
11781         (Property.Define): Call the new Property.DoDefine(), this does some
11782         sanity checks and we don't need to duplicate the code everywhere.
11783         (Event): Derive from MemberBase, not MemberCore.
11784         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11785         accessors, this will also make them work with interface events.
11786         (Indexer): Derive from MemberBase, not MemberCore.
11787         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11788         (Indexer.Define): Use the new MethodBase functions.
11789
11790         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11791         argument to the constructor.
11792         (Interface.FindMembers): Added support for interface events.
11793         (Interface.PopluateEvent): Implemented.
11794
11795         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11796
11797 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11798
11799         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11800         but this is required to check for a method name being the same as
11801         the containing class.  
11802
11803         Handle this now.
11804
11805 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11806
11807         * interface.cs: initialize variable.
11808
11809 2002-07-23  Martin Baulig  <martin@gnome.org>
11810
11811         Implemented the IndexerName attribute in interfaces.
11812
11813         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11814         name if this is an explicit interface implementation.
11815         (Indexer.InterfaceIndexerName): New public variable.  If we're
11816         implementing an interface indexer, this is the IndexerName in that
11817         interface.  Otherwise, it's the IndexerName.
11818         (Indexer.DefineMethod): If we're implementing interface indexer,
11819         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11820         and Pending.ImplementIndexer methods.
11821         (Indexer.Define): Also define the PropertyBuilder if we're
11822         implementing an interface indexer and this is neither an explicit
11823         interface implementation nor do the IndexerName match the one in
11824         the interface.
11825
11826         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11827         If a method is defined here, then we always need to create a proxy
11828         for it.  This is used when implementing interface indexers.
11829         (Pending.IsInterfaceIndexer): New public method.
11830         (Pending.ImplementIndexer): New public method.
11831         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11832         This is used when implementing interface indexers to define a proxy
11833         if necessary.
11834         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11835         define a proxy if necessary.
11836
11837         * interface.cs (Interface.IndexerName): New public variable.
11838         (Interface.PopulateIndexer): Set the IndexerName.
11839         (Interface.DefineIndexers): New private method.  Populate all the
11840         indexers and make sure their IndexerNames match.
11841
11842         * typemanager.cs (IndexerPropertyName): Added support for interface
11843         indexers.
11844
11845 2002-07-22  Martin Baulig  <martin@gnome.org>
11846
11847         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11848         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11849         ret if HasReturnLabel.
11850         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11851         variables.
11852
11853         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11854         and set the ec.LoopBeginTryCatchLevel.
11855         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11856         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11857         the current ec.TryCatchLevel, the branch goes out of an exception
11858         block.  In this case, we need to use Leave and not Br.
11859
11860 2002-07-22  Martin Baulig  <martin@gnome.org>
11861
11862         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11863         block unless the block does not always return or it is contained in
11864         another try { ... } catch { ... } block.  Fixes bug #26506.
11865         Added verify-1.cs to the test suite.
11866
11867 2002-07-22  Martin Baulig  <martin@gnome.org>
11868
11869         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11870         then we do not always return.  Fixes bug #24985.
11871
11872 2002-07-22  Martin Baulig  <martin@gnome.org>
11873
11874         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11875         lookup on a per-class level; ie. walk up the class hierarchy until we
11876         found at least one applicable method, then choose the best among them.
11877         Fixes bug #24463 and test-29.cs.
11878
11879 2002-07-22  Martin Baulig  <martin@gnome.org>
11880
11881         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11882         return types of the methods.  The return type is not part of the
11883         signature and we must not check it to make the `new' modifier work.
11884         Fixes bug #27999, also added test-147.cs.
11885         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11886
11887         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11888         on the method's return type.
11889
11890 2002-07-21  Martin Baulig  <martin@gnome.org>
11891
11892         * assign.cs: Make this work if the rightmost source is a constant and
11893         we need to do an implicit type conversion.  Also adding a few more tests
11894         to test-38.cs which should have caught this.
11895
11896         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11897         target in the makefile for this.  The makefile.gnu is primarily intended
11898         for end-users who don't want to debug the compiler.
11899
11900 2002-07-21  Martin Baulig  <martin@gnome.org>
11901
11902         * assign.cs: Improved the Assign class so it can now handle embedded
11903         assignments (X = Y = Z = something).  As a side-effect this'll now also
11904         consume less local variables.  test-38.cs now passes with MCS, added
11905         a few new test cases to that test.
11906
11907 2002-07-20  Martin Baulig  <martin@gnome.org>
11908
11909         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11910         instructions.  Fixes bug #27977, also added test-146.cs.
11911
11912 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11913
11914         * cs-tokenizer.cs: fixed getHex ().
11915
11916 2002-07-19  Martin Baulig  <martin@gnome.org>
11917
11918         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11919         not Type.GetType() to lookup the array type.  This is needed when
11920         we're constructing an array of a user-defined type.
11921         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11922         single-dimensional arrays, but also for single-dimensial arrays of
11923         type decimal.
11924
11925 2002-07-19  Martin Baulig  <martin@gnome.org>
11926
11927         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11928         this function is called, it's not allowed to share LocalBuilders
11929         among ILGenerators.
11930
11931 2002-07-19  Martin Baulig  <martin@gnome.org>
11932
11933         * expression.cs (Argument.Resolve): Report an error 118 when trying
11934         to pass a type as argument.
11935
11936 2002-07-18  Martin Baulig  <martin@gnome.org>
11937
11938         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11939         Conv_R_Un for the signed `long' type.
11940
11941 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11944         `expr' for the temporary result, as that will fail if we do
11945         multiple resolves on the same expression.
11946
11947 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11948
11949         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11950         ec.TypeContainer for looking up aliases. 
11951
11952         * class.cs (TypeContainer): Remove LookupAlias from here.
11953
11954         * decl.cs (DeclSpace); Move here.
11955
11956 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
11957
11958         * class.cs (FindMembers): Only call filter if the constructor
11959         bulider is not null.
11960
11961         Also handle delegates in `NestedTypes' now.  Now we will perform
11962         type lookups using the standard resolution process.  This also
11963         fixes a bug.
11964
11965         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11966         This uses Expressions (the limited kind that can be parsed by the
11967         tree) instead of strings.
11968
11969         * expression.cs (ComposedCast.ToString): Implement, used to flag
11970         errors since now we have to render expressions.
11971
11972         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
11973         FormArrayType. 
11974
11975         * ecore.cs (SimpleName.ToString): ditto.
11976
11977         * cs-parser.jay: Instead of using strings to assemble types, use
11978         Expressions to assemble the type (using SimpleName, ComposedCast,
11979         MemberAccess).  This should fix the type lookups in declarations,
11980         because we were using a different code path for this.
11981
11982         * statement.cs (Block.Resolve): Continue processing statements
11983         even when there is an error.
11984
11985 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
11986
11987         * class.cs (Event.Define): Also remove the `remove' method from
11988         the list of pending items.
11989
11990         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
11991         generate more compact code. 
11992
11993 2002-07-17  Martin Baulig  <martin@gnome.org>
11994
11995         * const.cs (Const.LookupConstantValue): Add support for constant
11996         `unchecked' and `checked' expressions.
11997         Also adding test case test-140.cs for this.
11998
11999 2002-07-17  Martin Baulig  <martin@gnome.org>
12000
12001         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12002         check whether mi.ReturnType implements the IEnumerator interface; the
12003         `==' and the IsAssignableFrom() will fail in this situation.
12004
12005 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12006
12007         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12008         here too.
12009
12010 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12011
12012         * expression.cs: fixed bug #27811.
12013
12014 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12015
12016         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12017         Molaro: when we are a ref, the value already contains a pointer
12018         value, do not take the address of it.
12019
12020 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12021         * removed mb-parser.jay and mb-tokenizer.cs
12022
12023 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12024
12025         * expression.cs: check against the building corlib void type.
12026
12027 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12028
12029         * ecore.cs: fix for valuetype static readonly fields: when 
12030         initializing them, we need their address, not the address of a copy.
12031
12032 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12033
12034         * typemanager.cs: register also enum_type in corlib.
12035
12036 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12037
12038         * class.cs: allow calling this (but not base) initializers in structs.
12039
12040 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12041
12042         * ecore.cs: make sure we compare against the building base types
12043         in GetTypeSize ().
12044
12045 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12046
12047         * typemanager.cs: fix TypeToCoreType() to handle void and object
12048         (corlib gets no more typerefs after this change).
12049
12050 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12051
12052         * expression.cs (ArrayCreation.EmitArrayArguments): use
12053         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12054
12055         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12056         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12057         array indexes, the runtime actually forbids them.
12058
12059         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12060         for array arguments here.
12061
12062         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12063         instead of the default for ValueTypes.
12064
12065         (New.DoEmit): Use IsValueType instead of
12066         IsSubclassOf (value_type)
12067         (New.DoResolve): ditto.
12068         (Invocation.EmitCall): ditto.
12069
12070         * assign.cs (Assign): ditto.
12071
12072         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12073         Statements *are* currently doing part of their resolution during
12074         Emit.  
12075
12076         Expressions do always resolve during resolve, but statements are
12077         only required to propagate resolution to their children.
12078
12079 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12080
12081         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12082
12083         (LoadAssembly): Do not add the dll if it is already specified
12084
12085         (MainDriver): Add the System directory to the link path at the end,
12086         after all the other -L arguments. 
12087
12088         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12089         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12090         ldelem.u1) and using the opposite for sbytes.
12091
12092         This fixes Digger, and we can finally run it.
12093
12094         * driver.cs (UnixParseOption): Move the option parsing here.  
12095         (CSCParseOption): Implement CSC-like parsing of options.
12096
12097         We now support both modes of operation, the old Unix way, and the
12098         new CSC-like way.  This should help those who wanted to make cross
12099         platform makefiles.
12100
12101         The only thing broken is that /r:, /reference: and /lib: are not
12102         implemented, because I want to make those have the same semantics
12103         as the CSC compiler has, and kill once and for all the confussion
12104         around this.   Will be doing this tomorrow.
12105
12106         * statement.cs (Unsafe.Resolve): The state is checked during
12107         resolve, not emit, so we have to set the flags for IsUnsfe here.
12108
12109 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12110
12111         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12112         not catch the Error_ObjectRefRequired in SimpleName (as it is
12113         possible to have a class/instance variable name that later gets
12114         deambiguated), we have to check this here.      
12115
12116 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12117
12118         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12119         make static and put into Expression.
12120
12121         (Event.Define): Register the private field of the event with the 
12122         TypeManager so that GetFieldFromEvent can get at it.
12123
12124         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12125         keep track of the private field associated with an event which
12126         has no accessors.
12127
12128         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12129         private field.
12130
12131         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12132
12133 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12134
12135         * expression.cs (Binary.EmitBranchable): this routine emits the
12136         Binary expression in a branchable context.  This basically means:
12137         we need to branch somewhere, not just get the value on the stack.
12138
12139         This works together with Statement.EmitBoolExpression.
12140
12141         * statement.cs (Statement.EmitBoolExpression): Use
12142         EmitBranchable. 
12143
12144 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12145
12146         * statement.cs (For): Reduce the number of jumps in loops.
12147
12148         (For): Implement loop inversion for the For statement.
12149
12150         (Break): We can be breaking out of a Try/Catch controlled section
12151         (foreach might have an implicit try/catch clause), so we need to
12152         use Leave instead of Br.
12153
12154         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12155         now).  If the instace expression supports IMemoryLocation, we use
12156         the AddressOf method from the IMemoryLocation to extract the
12157         address instead of emitting the instance.
12158
12159         This showed up with `This', as we were emitting the instance
12160         always (Emit) instead of the Address of This.  Particularly
12161         interesting when This is a value type, as we dont want the Emit
12162         effect (which was to load the object).
12163
12164 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12165
12166         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12167
12168         * statement.cs (Checked): Set the CheckedState during the resolve
12169         process too, as the ConvCast operations track the checked state on
12170         the resolve process, and not emit.
12171
12172         * cs-parser.jay (namespace_member_declaration): Flag that we have
12173         found a declaration when we do.  This is used to flag error 1529
12174
12175         * driver.cs: Report ok when we display the help only.
12176
12177 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12178
12179         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12180
12181 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12182
12183         * cs-tokenizer.cs (define): We also have to track locally the
12184         defines.  AllDefines is just used for the Conditional Attribute,
12185         but we also need the local defines for the current source code. 
12186
12187 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12188
12189         * statement.cs (While, For, Do): These loops can exit through a
12190         Break statement, use this information to tell whether the
12191         statement is the last piece of code.
12192
12193         (Break): Flag that we break.
12194
12195         * codegen.cs (EmitContexts): New `Breaks' state variable.
12196
12197 2002-07-03  Martin Baulig  <martin@gnome.org>
12198
12199         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12200         modifiers in method declarations in structs.  Otherwise, you won't
12201         be able to override things like Object.Equals().
12202
12203 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * class.cs (Method, Property, Indexer): Do not allow the public
12206         modifier to be used in explicit interface implementations.
12207
12208         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12209         override modifiers in method declarations in structs
12210
12211 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12212
12213         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12214         integer or real overflow, report an error
12215
12216 2002-07-02  Martin Baulig  <martin@gnome.org>
12217
12218         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12219         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12220         to tell the runtime about our newly created System.Object and
12221         System.ValueType types.
12222
12223 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12224
12225         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12226         struct instead of Ldarg/Starg.
12227
12228 2002-07-02  Martin Baulig  <martin@gnome.org>
12229
12230         * expression.cs (Indirection.Indirection): Call
12231         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12232
12233 2002-07-02  Martin Baulig  <martin@gnome.org>
12234
12235         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12236         ValueType, call TypeManager.TypeToCoreType() on it.
12237         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12238         the OpCodes.Newarr argument.
12239
12240 2002-07-02  Martin Baulig  <martin@gnome.org>
12241
12242         * expression.cs (Invocation.EmitCall): When compiling corlib,
12243         replace all calls to the system's System.Array type to calls to
12244         the newly created one.
12245
12246         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12247         System.Array methods.
12248         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12249         from the system's System.Array type which must be replaced.
12250
12251 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12252
12253         * typemanager.cs: load unverifiable_code_ctor so we can build
12254         corlib using the correct type. Avoid using GetTypeCode() with
12255         TypeBuilders.
12256         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12257         TypeManager.object_type to allow building corlib.
12258
12259 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12260
12261         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12262
12263 2002-07-01  Martin Baulig  <martin@gnome.org>
12264
12265         * class.cs: Make the last change actually work, we need to check
12266         whether `ifaces != null' to avoid a crash.
12267
12268 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12269
12270         * class.cs: when we build structs without fields that implement
12271         interfaces, we need to add the interfaces separately, since there is
12272         no API to both set the size and add the interfaces at type creation
12273         time.
12274
12275 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12276
12277         * expression.cs: the dimension arguments to the array constructors
12278         need to be converted if they are a long.
12279
12280 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12281
12282         * class.cs: don't emit ldarg.0 if there is no parent constructor
12283         (fixes showstopper for corlib).
12284
12285 2002-06-29  Martin Baulig  <martin@gnome.org>
12286
12287         MCS now compiles corlib on GNU/Linux :-)
12288
12289         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12290         ie. check for MethodImplOptions.InternalCall.
12291
12292         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12293         and TypeManager.attribute_type are null, so we must explicitly check
12294         whether parent is not null to find out whether it's an attribute type.
12295         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12296         and SetBuilder, not only if the property is neither abstract nor external.
12297         This is necessary to set the MethodImplOptions on the accessor methods.
12298         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12299         SetBuilder, see Property.Emit().
12300
12301         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12302         populate "System.Object", "System.ValueType" and "System.Attribute" since
12303         they've already been populated from BootCorlib_PopulateCoreTypes().
12304
12305 2002-06-29  Martin Baulig  <martin@gnome.org>
12306
12307         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12308         is the NullLiteral, we also need to make sure that target_type is not
12309         an enum type.   
12310
12311 2002-06-29  Martin Baulig  <martin@gnome.org>
12312
12313         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12314         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12315         before calling BootstrapCorlib_ResolveDelegate ().
12316
12317 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12318
12319         * statement.cs: fixed build-breaker. All tests passed ok.
12320
12321 2002-06-27  Martin Baulig  <martin@gnome.org>
12322
12323         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12324         for System.Decimal when compiling corlib.
12325
12326 2002-06-27  Martin Baulig  <martin@gnome.org>
12327
12328         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12329         switch blocks which contain nothing but a default clause.
12330
12331 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12332
12333        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12334
12335 2002-06-27  Martin Baulig  <martin@gnome.org>
12336
12337         * ecore.cs (PropertyExpr.PropertyExpr): Call
12338         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12339
12340         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12341         is already a TypeBuilder.
12342
12343 2002-06-27  Martin Baulig  <martin@gnome.org>
12344
12345         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12346         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12347         the "from an array-type to System.Array" case.  This makes it work
12348         when compiling corlib.
12349
12350 2002-06-27  Martin Baulig  <martin@gnome.org>
12351
12352         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12353         non-static PropertyExpr, set its InstanceExpression.  This makes
12354         the `ICollection.Count' property work in System/Array.cs.
12355
12356 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12357
12358         * driver.cs: Made error handling more consistent.  Errors now
12359         tracked by Report class, so many methods which used to return int
12360         now return void.  Main() now prints success/failure and 
12361         errors/warnings message.
12362
12363         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12364         the magic number return values (123 and 124).  Now, if the
12365         expected error occurs, the compiler exits with success (exit value
12366         0).  If the compilation completes without seeing that particular
12367         error, the compiler exits with failure (exit value 1).  The
12368         makefile in mcs/errors has been changed to handle the new behaviour.
12369
12370         * report.cs: Made 'expected error' number a property and renamed
12371         it from 'Probe' to 'ExpectedError'.
12372
12373         * genericparser.cs: Removed error handling support, since it is
12374         now all done by Report class.
12375
12376         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12377         class, so parse() no longer returns an int.
12378
12379         * namespace.cs: Use Report.Error instead of GenericParser.error
12380
12381 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12382
12383         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12384         TypeContainer.AddOperator): At the front of the list put the
12385         explicit implementations, so they get resolved/defined first. 
12386
12387 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12388
12389         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12390         interface type is implemented by this TypeContainer.  Used during
12391         explicit interface implementation.
12392
12393         (Property.Define, Indexer.Define, Method.Define): Validate that
12394         the given interface in the explicit implementation is one of the
12395         base classes for the containing type.
12396
12397         Also if we are explicitly implementing an interface, but there is
12398         no match in the pending implementation table, report an error.
12399
12400         (Property.Define): Only define the property if we are
12401         not explicitly implementing a property from an interface.  Use the
12402         correct name also for those properties (the same CSC uses,
12403         although that is really not needed).
12404
12405         (Property.Emit): Do not emit attributes for explicitly implemented
12406         properties, as there is no TypeBuilder.
12407
12408         (Indexer.Emit): ditto.
12409
12410         Hiding then means that we do not really *implement* a pending
12411         implementation, which makes code fail.
12412
12413 2002-06-22  Martin Baulig  <martin@gnome.org>
12414
12415         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12416         the return value of Object.GetType().  [FIXME: we need to do this whenever
12417         we get a type back from the reflection library].
12418
12419 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12420
12421         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12422
12423 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12424
12425         * attribute.cs: Return null if we can not look up the type.
12426
12427         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12428         the interface types found.
12429
12430         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12431         interface types found.
12432
12433         * typemanager.cs (GetInterfaces): Make this routine returns alll
12434         the interfaces and work around the lame differences between
12435         System.Type and System.Reflection.Emit.TypeBuilder in the results
12436         result for GetInterfaces.
12437
12438         (ExpandInterfaces): Given an array of interface types, expand and
12439         eliminate repeated ocurrences of an interface.  This expands in
12440         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12441         be IA, IB, IC.
12442
12443 2002-06-21  Martin Baulig  <martin@gnome.org>
12444
12445         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12446         on System.Enum.
12447
12448 2002-06-21  Martin Baulig  <martin@gnome.org>
12449
12450         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12451         and called with one of the core types, return the corresponding typebuilder for
12452         that type.
12453
12454         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12455         element type.
12456
12457 2002-06-21  Martin Baulig  <martin@gnome.org>
12458
12459         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12460         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12461         (Expression.ConvertReferenceExplicit): Likewise.
12462
12463         * expression.cs (ElementAccess.DoResolve): Likewise.
12464         (ElementAccess.DoResolveLValue): Likewise.
12465
12466 2002-06-10  Martin Baulig  <martin@gnome.org>
12467
12468         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12469         add the "value" parameter to the parameter list.
12470
12471         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12472         to our caller.
12473
12474 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12475
12476         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12477         the argument to an int, uint, long or ulong, per the spec.  Also
12478         catch negative constants in array creation.
12479
12480 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12481
12482         * class.cs: do not allow the same interface to appear twice in
12483         the definition list.
12484
12485 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12486
12487         * ecore.cs: don't use ldlen with System.Array.
12488
12489 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12490
12491         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12492
12493 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12494
12495         * modifiers.cs: produce correct field attributes for protected
12496         internal. Easy fix so miguel can work on ther harder stuff:-)
12497
12498 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12499
12500         * pending.cs: New file.  Move the code from class.cs here.
12501         Support clearning the pending flag for all methods (when not doing
12502         explicit interface implementation).
12503
12504 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12505
12506         * rootcontext.cs: added a couple more types needed to bootstrap.
12507
12508 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12509
12510         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12511         constructor in the type, instead of any constructor in the type
12512         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12513         a bug in the Mono runtime when applying the params attribute). 
12514
12515 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12516         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12517
12518 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12519
12520         * expression.cs (Unary.ResolveOperator): Use TypeManager
12521         to resolve the type.
12522
12523 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12524
12525         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12526         attached.
12527
12528         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12529         with each member too.
12530
12531         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12532         field builders too - this takes care of the enum member case.
12533
12534 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12535
12536         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12537         address-of operator on both value types and pointers.
12538
12539 2002-06-10  Martin Baulig  <martin@gnome.org>
12540
12541         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12542         PropertyBuilder to the `property_builders' list.
12543
12544         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12545         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12546         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12547         find any indexers which are inherited from an interface.
12548
12549 2002-06-09  Martin Baulig  <martin@gnome.org>
12550
12551         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12552         the same type as the constant if necessary.  There's also a test-130.cs
12553         for this.
12554
12555         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12556
12557         * typemanager.cs (TypeManager.ChangeType): Previously known as
12558         Enum.ChangeEnumType().
12559
12560 2002-06-09  Martin Baulig  <martin@gnome.org>
12561
12562         * expression.cs (Cast.TryReduce): Added support for consts.
12563
12564 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12565
12566         * class.cs (Accessor): Hold attributes information so we can pass
12567         it along.
12568
12569         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12570         Modify to pass in attributes attached to the methods.
12571
12572         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12573
12574         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12575         to handle the Accessor kind :-)
12576
12577         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12578
12579 2002-06-08  Martin Baulig  <martin@gnome.org>
12580
12581         * expression.cs (Unary.TryReduceNegative): Added support for
12582         ULongConstants.
12583
12584 2002-06-08  Martin Baulig  <martin@gnome.org>
12585
12586         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12587         name can't be found in the `defined_names' - the caller will do a
12588         MemberLookup in this case and thus find methods in System.Enum
12589         such as Enum.IsDefined().
12590
12591 2002-06-08  Martin Baulig  <martin@gnome.org>
12592
12593         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12594         Convert.ChangeType() which works with TypeBuilder created types.
12595         (Enum.LookupEnumValue, Enum.Define): Use it here.
12596
12597         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12598         `TypeBuilder.BaseType != null' check.
12599         (TypeContainer.FindMembers): Only lookup parent members if we
12600         actually have a parent.
12601         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12602         (ConstructorInitializer.Resolve): Likewise.
12603
12604         * interface.cs (Interface.FindMembers): Added
12605         `TypeBuilder.BaseType != null' check.
12606
12607         * rootcontext.cs (RootContext.ResolveCore): Added
12608         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12609         classes_second_stage.
12610
12611         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12612         debug_type and trace_type when compiling with --nostdlib.       
12613
12614 2002-06-07  Martin Baulig  <martin@gnome.org>
12615
12616         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12617         (AddField): Set it to true when adding a non-static field.
12618         (DefineType): Use `have_nonstatic_fields' to find out whether we
12619         have non-static fields, not `Fields != null'.
12620
12621 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12624         dereferencing a null on the static-field code path)
12625
12626 2002-05-30  Martin Baulig  <martin@gnome.org>
12627
12628         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12629         to take command line arguments.  Use reflection to call the new
12630         custom `Initialize' function on the symbol writer and pass it the
12631         command line arguments.
12632
12633         * driver.cs (--debug-args): New command line argument to pass command
12634         line arguments to the symbol writer.
12635
12636 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12639         the target type for indexers and properties.  Thanks to Joe for
12640         catching this.
12641
12642 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12643
12644         * typemanager.cs (MethodFlags): returns the method flags
12645         (Obsolete/ShouldIgnore) that control warning emission and whether
12646         the invocation should be made, or ignored. 
12647
12648         * expression.cs (Invocation.Emit): Remove previous hack, we should
12649         not do this on matching a base type, we should do this based on an attribute
12650
12651         Only emit calls to System.Diagnostics.Debug and
12652         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12653         on the command line.
12654
12655         * rootcontext.cs: Global settings for tracing and debugging.
12656
12657         * cs-tokenizer.cs (define): New utility function to track
12658         defines.   Set the global settings for TRACE and DEBUG if found.
12659
12660 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12661
12662         * interface.cs (Populate*): Pass in the TypeContainer as well as
12663         the DeclSpace as parameters so that we can create EmitContexts and
12664         then use that to apply attributes etc.
12665
12666         (PopulateMethod, PopulateEvent, PopulateProperty)
12667         (PopulateIndexer): Apply attributes everywhere.
12668
12669         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12670         etc.
12671
12672         (ApplyAttributes): Update accordingly.
12673
12674         We now apply interface attributes for all members too.
12675
12676 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12677
12678         * class.cs (Indexer.Define); Correctly check if we are explicit
12679         implementation (instead of checking the Name for a ".", we
12680         directly look up if the InterfaceType was specified).
12681
12682         Delay the creation of the PropertyBuilder.
12683
12684         Only create the PropertyBuilder if we are not an explicit
12685         interface implementation.   This means that explicit interface
12686         implementation members do not participate in regular function
12687         lookups, and hence fixes another major ambiguity problem in
12688         overload resolution (that was the visible effect).
12689
12690         (DefineMethod): Return whether we are doing an interface
12691         implementation. 
12692
12693         * typemanager.cs: Temporary hack until we get attributes in
12694         interfaces (Ravi is working on that) and we get IndexerName
12695         support in interfaces.
12696
12697         * interface.cs: Register the indexers as properties.
12698
12699         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12700         warning, I have verified that this is a bug in the .NET runtime
12701         (JavaScript suffers of the same problem).
12702
12703         * typemanager.cs (MemberLookup): When looking up members for
12704         interfaces, the parent of an interface is the implicit
12705         System.Object (so we succeed in searches of Object methods in an
12706         interface method invocation.  Example:  IEnumerable x;  x.ToString
12707         ()) 
12708
12709 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12710
12711         * class.cs (Event): Events should also register if they do
12712         implement the methods that an interface requires.
12713
12714         * typemanager.cs (MemberLookup); use the new GetInterfaces
12715         method. 
12716
12717         (GetInterfaces): The code used to lookup interfaces for a type is
12718         used in more than one place, factor it here. 
12719
12720         * driver.cs: Track the errors at the bottom of the file, we kept
12721         on going.
12722
12723         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12724         instance if the method we are calling is static!
12725
12726 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * attribute.cs (ApplyAttributes): Make this function filter out
12729         the IndexerName attribute (as that attribute in reality is never
12730         applied) and return the string constant for the IndexerName
12731         attribute. 
12732
12733         * class.cs (TypeContainer.Emit): Validate that all the indexers
12734         have the same IndexerName attribute, and if so, set the
12735         DefaultName attribute on the class. 
12736
12737         * typemanager.cs: The return value might contain other stuff (not
12738         only methods).  For instance, consider a method with an "Item"
12739         property and an Item method.
12740
12741         * class.cs: If there is a problem with the parameter types,
12742         return. 
12743
12744 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12745
12746         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12747         looks at user defined conversion after making a call to 
12748         StandardConversionExists - we need this for overload resolution.
12749
12750         * expression.cs : Update accordingly the various method calls.
12751
12752         This fixes 2 bugs filed against implicit user defined conversions 
12753
12754 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12755
12756         * statement.cs: Track the result of the assignment.
12757
12758 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12759
12760         * expression.cs (MemberAccess): Improved error reporting for
12761         inaccessible members.
12762
12763 2002-05-22  Martin Baulig  <martin@gnome.org>
12764
12765         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12766         itself with debugging support.
12767
12768 2002-05-22  Martin Baulig  <martin@gnome.org>
12769
12770         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12771         Removed, this isn't needed anymore.
12772
12773 2002-05-20  Martin Baulig  <martin@gnome.org>
12774
12775         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12776         be underlying type for an enum.
12777
12778 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12779
12780         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12781         that splits out the loading of just the core types.
12782
12783         * rootcontext.cs (ResolveCore): Split the struct resolution in
12784         two, so we can load the enumeration underlying types before any
12785         enums are used.
12786
12787         * expression.cs (Is): Bandaid until we fix properly Switch (see
12788         bug #24985 for details).
12789
12790         * typemanager.cs (ImplementsInterface): The hashtable will contain
12791         a null if there are no interfaces implemented.
12792
12793 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12794
12795         * cs-parser.jay (indexer_declarator): It is fine to have array
12796         parameters
12797
12798 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12799
12800         * typemanager.cs: (RegisterBuilder): New function used to register
12801         TypeBuilders that implement interfaces.  Since
12802         TypeBuilder.GetInterfaces (as usual) does not work with lame
12803         Reflection.Emit. 
12804         (AddUserType): register interfaces.
12805
12806         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12807         dealing with TypeBuilder.  Also, arrays are showing up as
12808         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12809         methods can not be invoked on them!
12810
12811         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12812         (ImplicitReferenceConversionExists): Split out from
12813         StandardConversionExists. 
12814
12815         * expression.cs (As): We were only implementing one of the three
12816         cases for the as operator.  We now implement them all.
12817         (Is): Implement the various other cases for Is as well.
12818
12819         * typemanager.cs (CACHE): New define used to control if we want or
12820         not the FindMembers cache.  Seems to have a negative impact on
12821         performance currently
12822
12823         (MemberLookup): Nested types have full acess to
12824         enclosing type members
12825
12826         Remove code that coped with instance/static returns for events, we
12827         now catch this in RealFindMembers.
12828
12829         (RealFindMembers): only perform static lookup if the instance
12830         lookup did not return a type or an event.  
12831
12832 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12833
12834         * assign.cs (CompoundAssign): We pass more semantic information
12835         now to Compound Assignments than we did before: now we have all
12836         the information at hand, and now we resolve the target *before* we
12837         do the expression expansion, which allows the "CacheValue" method
12838         to have the effect we intended (before, a [x] += 1 would generate
12839         two differen ArrayAccess expressions from the ElementAccess,
12840         during the resolution process).
12841
12842         (CompoundAssign.DoResolve): Resolve target and original_source here.
12843
12844 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12845
12846         * expression.cs (ArrayAccess): dropped debugging information. 
12847
12848         * typemanager.cs: Small bug fix: I was always returning i_members,
12849         instead of one of i_members or s_members (depending on which had
12850         the content).
12851
12852         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12853         method is invoked before any code generation takes place, and it
12854         is a mechanism to inform that the expression will be invoked more
12855         than once, and that the method should use temporary values to
12856         avoid having side effects
12857
12858         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12859
12860         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12861         implementation.
12862
12863         * expression.cs (Indirection, ArrayAccess): Add support for
12864         CacheTemporaries in these two bad boys. 
12865
12866         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12867         ldobj or ldind_ref.  
12868         (StoreFromPtr): Handle stobj as well.
12869
12870         * expression.cs (UnaryMutator): Share more code.
12871
12872         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12873         down: I was not tracking the Filter function as well, which
12874         was affecting the results of the cache.
12875
12876 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12877
12878         * attribute.cs: Remove the hack to handle the CharSet property on
12879         StructLayouts. 
12880
12881 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12882
12883         * attribute.cs (DoResolve): More uglyness, we now only try to
12884         resolve the attribute partially, to extract the CharSet
12885         information (only if we are a StructLayout attribute).  Otherwise 
12886
12887         (GetExtraTypeInfo): Add some code to conditionally kill in the
12888         future this.   I am more and more convinced that the .NET
12889         framework has special code to handle the attribute setting on
12890         certain elements.
12891
12892         * expression.cs (IsParamsMethodApplicable): Revert my previous
12893         foreach change here, it was wrong.
12894
12895 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12898         (pp_expr): do not abort on unknown input, just return.
12899         (eval): abort if there are pending chars.
12900
12901         * attribute.cs (Attribute.Resolve): Positional parameters are
12902         optional.  Deal with that case.
12903
12904         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12905         the Ansi/Unicode/Auto information for the type.
12906
12907         (TypeContainer.DefineType): instantiate the EmitContext here, as
12908         we will be using it during the type definition (to resolve
12909         attributes) and during the emit phase.
12910
12911         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12912         to pull type information out of the attributes
12913
12914         (Attribute.Resolve): track the constructor builder, and allow for
12915         multiple invocations (structs and classes will use this).
12916
12917         * ecore.cs (MemberLookupFinal): new version with all the
12918         parameters customizable.
12919
12920         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12921         constructors.  Return if the result value is null (as the error
12922         would have been flagged already by MemberLookupFinal)
12923
12924         Do not allow instances of abstract classes or interfaces to be
12925         created.
12926
12927         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12928         We have to compare the assembly property here when dealing with
12929         FamANDAssem and Assembly access modifiers, because we might be
12930         creating an assembly from *modules* (that means that we are not
12931         getting TypeBuilders for types defined in other modules that are
12932         part of this assembly).
12933
12934         (Method.Emit): If the method is marked abstract and has a body,
12935         emit an error. 
12936
12937         (TypeContainer.DefineMembers): If both the defined member and the
12938         parent name match are methods, then do not emit any warnings: let
12939         the Method.Define routine take care of flagging warnings.  But if
12940         there is a mismatch (method overrides something else, or method is
12941         overriwritten by something, then emit warning).
12942
12943         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12944         set to null, this means `do not check for the return type on the
12945         signature'. 
12946
12947         (Method.Define): set the return type for the method signature to
12948         null, so that we get methods with the same name and parameters and
12949         different return types.  This is used to flag warning 114 (you are
12950         hiding a method, and you probably want to use the new/override
12951         keywords instead).
12952
12953         * typemanager.cs (MemberLookup): Implemented proper access
12954         control, closing a long standing set of bug reports.  The problem
12955         was that the Framework only has two bits: Public and NonPublic,
12956         and NonPublic includes private and protected methods, but we need
12957         to enforce the FamANDAssem, FamOrAssem and Family. 
12958
12959 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
12960
12961         * statement.cs (GotoCase): Return true: Ammounts to giving up
12962         knowledge on whether we return or not, and letting the other case
12963         be responsible for it.
12964
12965 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
12966
12967         * driver.cs: Do not load directories for each file processed, only
12968         do it if there is a pattern.
12969
12970         * ecore.cs: Report readonly assigns here as well, as we might have
12971         been resolved only by MemberAccess.
12972
12973         (SimpleName.SimpleNameResolve): Also be useful for LValue
12974         resolution.   We need this to propagate assign to local readonly variables
12975
12976         * typemanager.cs: Use a ptrhashtable for the criteria, because we
12977         do not want to reuse potential criteria memory.
12978
12979         * class.cs (MyEventBuilder): Set reflected_type;
12980
12981         * ecore.cs (Constantify): Added support for constifying bools.
12982
12983         (RootContext.LookupType): Added a cache for values looked up in
12984         the declaration space.
12985
12986         * typemanager.cs (FindMembers): Now is a front-end to
12987         RealFindMembers, and provides a two-level hashtable-based cache to
12988         the request.  
12989
12990         15% performance improvement: from 22.5 to 19.2 seconds.
12991
12992         * expression.cs (IsParamsMethodApplicable): use foreach.
12993         (Invocation.DoResolve): ditto.
12994         (New.DoResolve): ditto.
12995         (ArrayCreation.DoResolve): ditto.
12996
12997         * ecore.cs (FindMostEncompassingType): use foreach.
12998
12999         * delegate.cs (NewDelegate.DoResolve): Use foreach
13000
13001         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13002         (RemoveMethods): use foreach.
13003
13004         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13005         nested foreach statements instead of for, and also break out of
13006         the inner loop once a match is found.
13007
13008         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13009
13010 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13011
13012         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13013         we actually unwrap the expression to allow for extra information
13014         to be extracted. 
13015
13016         * expression.cs: Use Shr_Un on unsigned operations. 
13017
13018 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13019
13020         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13021         applicable operators was not being considered correctly. This closes
13022         the bug Miguel reported.
13023
13024 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13025
13026         * attribute.cs: check that the type derives from System.Attribute
13027         and report the correct error in that case (moved the duplicate code to
13028         its own method, too).
13029
13030 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13031
13032         * attribute.cs: lookup attribute type name as the spec says: first the
13033         bare attribute name and then name + "Attribute" (nant compiles with
13034         mcs after this fix).
13035
13036 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13037
13038         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13039         Because of the way we parse things, we should try to see if a
13040         UIntConstant can fit in an integer.
13041
13042 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13043
13044         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13045         when we are in an explicit context.
13046
13047         (ConvertReferenceExplicit): When converting from Iface type S to Class
13048         T make sure the rules are implemented as an OR.
13049
13050         * parameter.cs (ParameterType): Make it a property for now although the
13051         purpose really isn't anything immediate.
13052
13053         * expression.cs (Is*Applicable): Do better checking on the parameter type
13054         of a ref/out parameter. The ones from the system assemblies are already 
13055         marked with the correct type so we don't need to do any correction.
13056
13057         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13058         the object type is standard too so include that.
13059
13060 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13061
13062         * ecore.cs (StandardConversionExists): Augment with missing code:
13063         deal with IntConstant, LongConstants and Enumerations.
13064
13065         * assign.cs: Report the error, instead of failing silently
13066
13067         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13068         typecontainer that they are declared, because the
13069         typecontainer/namespace will have the list of using clauses that
13070         need to be applied.
13071
13072         Assembly Attributes were escaping the normal registration
13073         mechanism. 
13074
13075         (EmitCode): Apply attributes within an EmitContext that represents
13076         the container they were declared on.
13077
13078         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13079
13080 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13081
13082         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13083         Revamp completely - make much cleaner as we now operate only
13084         on a set of Types.
13085
13086         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13087         to implement the logic detailed in the spec more correctly.
13088
13089         (UserDefinedConversion): Update accordingly.
13090
13091 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13092
13093         * statement.cs: Return flow analysis information up.
13094
13095         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13096         and the default.
13097
13098         (token): Do not consume an extra character before calling
13099         decimal_digits.
13100
13101 2002-05-06  Piers Haken <piersh@friskit.com>
13102
13103         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13104
13105 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13108         EmitContext during the instance constructor initializer
13109         resolution, to stop access to instance variables.
13110
13111         This is mandated by the spec, last paragraph of the `constructor
13112         initializers' section. 
13113
13114 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13115
13116         * cs-parser.jay, class.cs (Accessor): new class used to represent
13117         an accessor (get or set).  In the past we used `null' to represent
13118         a missing accessor.  But this is ambiguous because there was no
13119         way to tell in abstract indexers/properties if one of them was
13120         specified.
13121
13122         Now there is a way of addressing that.
13123
13124         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13125         instead of FindMembers.
13126
13127         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13128         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13129
13130         * attribute.cs: Treat indexers and properties as the same in terms
13131         of applying attributes
13132
13133         * ecore.cs (FindMostEncompassedType): Use statically initialized
13134         EmptyExpressions()s like we do elsewhere to avoid creating useless
13135         objects (and we take this out of the tight loop).
13136
13137         (GetConversionOperators): Move the code to extract the actual
13138         operators to a separate routine to clean things up.
13139
13140 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13141
13142         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13143         events are always registered FieldBuilders.
13144
13145         * class.cs (FieldBase): New class shared by Fields 
13146
13147         * delegate.cs: If we are a toplevel delegate, use our full name.
13148         If we are a nested delegate, then only use our tail name.
13149
13150 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13151
13152         * expression.cs (IsApplicable): Ensure that we add the "&" to
13153         ref/out types before comparing it with the type of the argument.
13154
13155         (IsParamsMethodApplicable): Ditto.
13156
13157         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13158         silly me ;-)
13159
13160         * delegate.cs : Handle the case when we have more than one applicable
13161         method. Flag an error only when we finish checking all.
13162
13163 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13164
13165         * expression.cs: Add support for boolean static initializers.
13166
13167 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13170
13171         * parameter.cs (ComputeParameterTypes,
13172         ComputeAndDefineParameterTypes): Better error handling: now we
13173         clear the `types' cache if we fail during any of the type lookups.
13174         We also return the status code correctly to our caller
13175
13176         * delegate.cs: If we fail to define a delegate, abort the extra
13177         steps. 
13178
13179         * expression.cs (Binary.ResolveOperator): for
13180         operator==(object,object) and operator !=(object, object) we also
13181         have to verify that there is an implicit conversion from one to
13182         the other.
13183
13184         (ArrayAccess.DoResolve): Array Access can operate on
13185         non-variables. 
13186
13187 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13188
13189         * assign.cs (CompoundAssign): A new class used as a "flag" that
13190         the assignment actually is happening as part of a compound
13191         assignment operator.
13192
13193         During compound assignment, a few new rules exist to enable things
13194         like:
13195
13196         byte b |= 1 + 2
13197
13198         From the spec:
13199
13200         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13201         to the type of x) if y is implicitly convertible to the type of x,
13202         and the operator is a builtin operator and the return type of the
13203         operator is explicitly convertible to the type of x. 
13204
13205         * rootcontext.cs: Reset warning level to 2.  4 catches various
13206         "interesting" features in mcs, we must clean this up at some
13207         point, but currently am trying to kill other bugs ;-)
13208
13209         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13210         in container classes as well.  
13211
13212         * expression.cs (Binary.ResolveOperator): Handle string case
13213         before anything else (as operator overloading does emit an error
13214         before doing anything else).
13215
13216         This code could go away when we move to a table driven model, but
13217         i could not come up with a good plan last night.
13218
13219 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13220
13221         * typemanager.cs (CSharpName): reimplementation using regex.
13222         * class.cs: added null check for fields in Emit
13223         * rootcontext.cs: set warninglevel to 4
13224
13225 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13226
13227         * typemanager.cs (CSharpName): reimplemented with Lupus
13228         suggestion.
13229
13230 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13231
13232         * statement.cs (If): correclty implement Resolve, because we were
13233         not catching sem errors in there.  The same process is needed
13234         everywhere else. 
13235         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13236
13237
13238         (Statement.Warning_DeadCodeFound): Factorize code.
13239         (While): Report dead code here too.
13240
13241         (Statement): Added Resolve virtual method to allow
13242         for resolution split from the emit code.
13243
13244 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13245
13246         * statement.cs (EmitBoolExpression): No longer try to resolve the
13247         expression here.    
13248         (MakeBoolean): New utility function that resolve, implicitly
13249         converts to boolean and tags the expression. 
13250
13251
13252         (If, Do): Implement dead code elimination.
13253         (While): Implement loop inversion
13254
13255         (Do, While, For, If): Resolve the expression prior to calling our
13256         code generation.
13257
13258 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13259
13260         * class.cs:
13261           - added method Report28 (warning: program has more than one entry point)
13262           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13263           - modified method Method.Define, the part at the end of the method
13264
13265         * rootcontext.cs: added static public Location EntryPointLocation;
13266           
13267         * ../errors/cs0028.cs : Add test case for the above warning.              
13268
13269         * typemanager.cs:
13270           - modified method CSharpName to allow arrays of primitive type to
13271             be printed nicely (e.g. instead of System.Int32[][] it now prints
13272             int[][])
13273           - added method CSharpSignature: returns the signature of a method
13274             in string format to be used in reporting errors, warnings, etc.
13275
13276         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13277         with String.Empty.
13278
13279 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13280
13281         * delegate.cs (Define): Fix extremely silly bug where I was
13282         setting the type of the 'object' parameter of the BeginInvoke
13283         method to System.IAsyncResult instead of System.Object ;-)
13284
13285 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13286
13287         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13288         here. 
13289
13290         (Constructor.Emit): return if we fail to initialize the
13291         constructor.  Another door closed!  
13292
13293         * expression.cs (New.DoResolve): Improve error message (from -6 to
13294         1501).  Use DeclaredOnly lookup to find the exact constructor.
13295
13296         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13297         loop.  This is useful.
13298
13299         * cs-parser.jay: Adjust the default parameters so that destructors
13300         have the proper signature.
13301
13302 2002-04-26  Martin Baulig  <martin@gnome.org>
13303
13304         * driver.cs (LoadAssembly): If `assembly' contains any characters
13305         which are only valid in path names and not in assembly names
13306         (currently slash, backslash and point), use Assembly.LoadFrom ()
13307         instead of Assembly.Load () on the `assembly' (before iteration
13308         over the link_paths).
13309
13310 2002-04-26  Martin Baulig  <martin@gnome.org>
13311
13312         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13313
13314 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13315
13316         * class.cs (Property): use the new typemanager.MemberLookup
13317
13318         (TypeContainer.MemberLookup): Implement using the
13319         TypeManager.MemberLookup now. 
13320
13321         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13322         and return MemberInfos, so that these can be used without an
13323         EmitContext (what we had before).
13324
13325 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * expression.cs: Fix the case where the argument to params if the
13328         type of the params.  I omitted handling this before.   Fixed
13329
13330 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13331
13332         * driver.cs: Call BootCorlib_PopulateCoreType
13333
13334         * class.cs (Property.CheckBase): Check for properties only, not
13335         for all members. 
13336
13337         * interface.cs: Temporary hack: try/catch around the
13338         CustomAttributeBuilder, because I am getting an exception that I
13339         do not understand.
13340
13341         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13342         types whose definitions are required to be there (attributes are
13343         defined before standard types).
13344
13345         Compute definitions as we boot the various types, as they are used
13346         immediately (value_type class will need object_type, but if we do
13347         not initialize object_type, we will pass a null, which will let
13348         the runtime pick the System.Object from the existing corlib, which
13349         is not what we want).
13350
13351 2002-04-22  Patrik Torstensson <totte@labs2.com>
13352
13353         * cs-tokenizer.cs: fixed a number of trim() issues.
13354
13355 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13356
13357         * expression.cs (Argument.Type): Ensure that we return the correct
13358         type when we have out or ref parameters [in which case we 
13359         append a "&"].
13360
13361 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * class.cs (Property, Indexer): Allow extern modifier in there. 
13364
13365         * typemanager.cs (InitBaseTypes): Initializes object_type and
13366         value_type, since those will be used early on during the bootstrap
13367         process to compile corlib.
13368
13369         (InitCoreTypes): Move code from here to InitBaseTypes.
13370
13371 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13374         single-dimension arrays as using the ldlen opcode.  
13375
13376         Daniel Lewis discovered this optimization.  
13377
13378         * typemanager.cs: Add signature for System.Array::get_Length
13379
13380 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13381
13382         * statement.cs: report the error when the foreach does not apply to an
13383         array nor a collection.
13384
13385 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13386
13387         * expression.cs: Add implicit conversions to the operator ~.
13388
13389         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13390
13391         * typemanager.cs: Locate the decimal constructor.
13392
13393 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13394
13395         * attribute.cs: use the new property of TypeOf.
13396         * expression.cs: added 'get' property around typearg.
13397
13398         These changes fix a build breaker reported by NickD. Is this the
13399         correct way to fix?  If not, please, revert my changes and make it
13400         work :-).
13401
13402 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13403
13404         * attribute.cs: Add support for typeof in attribute invocations.
13405         I am not sure that this is right though.
13406
13407 2002-04-14  Duncan Mak  <duncan@ximian.com>
13408
13409         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13410         Binary.Operator.Division case.
13411
13412 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13413
13414         * class.cs (DefineType): Ensure that we do a proper check on
13415         attribute types and also register it with the TypeManager.
13416
13417         (TypeContainer.Targets): The default for attribute types is
13418         AttributeTargets.All.
13419
13420         * attribute.cs (ApplyAttributes): Registering the attribute type
13421         is done elsewhere, not when we discover we have a Usage attribute.
13422
13423 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13424
13425         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13426         and get rid of is_delegate parameter.
13427
13428         * everywhere : update.
13429
13430 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13431
13432         * cs-parser.jay (compilation_unit): Revamp completely to use
13433         some new ideas that I got from Rhys' grammar to solve the problems
13434         with assembly level attributes.
13435
13436         (outer_declaration): New grammar production.
13437
13438         (attribute_sections): Add.
13439
13440         (opt_attributes): Base on attribute_sections
13441
13442         (namespace_declaration): Allow opt_attributes to tackle the case
13443         when we have assembly level attributes - we are clever in this
13444         regard now ;-)
13445
13446         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13447         attributes in the non-global context.
13448
13449         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13450         instead of SetGlobalAttributes.
13451
13452         * class.cs, rootcontext.cs : Ensure we define and generate 
13453         attribute types before anything else.
13454
13455         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13456         and flag the new error -20 for the case when the attribute type
13457         does not have valid targets specified. csc does not catch this.
13458
13459         * ../errors/errors.txt : update for error # -20
13460
13461 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13462
13463         * support.cs (InternalParameters.ParameterModifier): Do some null
13464         checking and return sane values.
13465
13466         * class.cs (Method.Define): If we are a PInvoke method, ensure
13467         that we are static and extern. Report error # 601
13468
13469         * ../errors/cs0601.cs : Add test case for the above error.
13470
13471 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13472
13473         * rootcontext.cs (attribute_types): We need to keep type of
13474         all attribute types separately and emit code for them first.
13475
13476         (RegisterAttribute) : Implement.
13477
13478         * class.cs (DefineType): Check if the current Type is a custom
13479         attribute type and register it accordingly.
13480
13481         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13482         adding the first attribute twice and rename to
13483
13484         (SetGlobalAttributes): this.
13485
13486         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13487         lookups.
13488
13489         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13490         if we are processing global arguments. Hmm, I am unsure of this.
13491
13492 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13493
13494         * expression.cs: added static array of strings to avoid calling
13495         Enum.ToString () for Operator in Binary. Significant recover of
13496         performance.
13497
13498 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13499
13500         * class.cs (FindMembers): Allow the Builders of the various
13501         members to be null.  If they are skip them.  This only happens
13502         during the PInvoke declaration.
13503
13504 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13505
13506         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13507         failure, so we do not keep going afterwards.
13508
13509         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13510         wanted to pass `false' as the `is_delegate' argument.  If this is
13511         the case, why not use delegate_type == null to mean `is_delegate =
13512         false' and anything else as is_delegate = true.
13513
13514 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13515
13516         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13517         code for the section, not the beginning of the tests.
13518
13519 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13520
13521         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13522
13523         * expression.cs (Binary): same.  Warn about errors where we have
13524         Enum/Enum in operator + as well.
13525
13526 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13527
13528         * statement.cs:
13529                 - added support for switch(bool)
13530                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13531                 - add TableSwitchEmit() to handle table-based switch statements
13532
13533 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13534
13535         * expression.cs (Invocation.OverloadResolve): Factor out code which
13536         does parameter compatibility checking with arguments so that we can 
13537         re-use the code even from Delegate.VerifyApplicability
13538
13539         (VerifyArgumentsCompat): Move above code here.
13540
13541         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13542         and instead make a call to the above method.
13543
13544 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13545
13546         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13547         We use it to keep track of classes which are attribute types.
13548
13549 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13550
13551         * delegate.cs (Delegate.Define): Correctly define the types in the
13552         presence of fixed and array parameters.
13553
13554         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13555         doing FindMembers.
13556
13557         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13558         include NonPublic after the first iteration.
13559
13560         * class.cs (Indexer.CheckBase): Only check if both parents are
13561         non-null. 
13562
13563         * cs-parser.jay (accessor_body): If empty, set to null.
13564
13565         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13566         same code path here to resolve constants names that we did have in
13567         MemberAccess.DoResolve.  There is too much code duplicated here.
13568
13569 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13570
13571         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13572
13573         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13574         to MakeUnionSet.
13575
13576         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13577         tokens, numbers and strings.
13578
13579         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13580         parenthesis.
13581
13582         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13583         asyncronous parameters and the regular parameters.  
13584
13585         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13586         specify the target directory.
13587
13588         * expression.cs: (This.DoResolve): Simplify
13589         (As.Emit): Optimize, do not generate IsInst if the expression is
13590         always of the given type.
13591
13592         (Is.DoResolve): Bug fix, we were reporting both always/never for
13593         the is expression.
13594
13595         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13596         creating too many unnecessary arrays.
13597
13598 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13599
13600         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13601         fields instead of rolling our own initializer.   Takes care of all
13602         implicit conversions, and drops unnecessary static checks/argument.
13603
13604 2002-03-31  Dick Porter  <dick@ximian.com>
13605
13606         * driver.cs: use the GetDirectories() return values properly, and
13607         use "/" as path separator.
13608
13609 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13610
13611         * expression.cs (Unary): Optimize - - expr into expr.
13612         (Binary): Optimize a + (-b) into a -b.
13613
13614         * codegen.cs (CodeGen): Made all methods static.
13615
13616 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13617
13618         * rootcontext.cs: 
13619
13620         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13621         TypeBuilder property.
13622
13623         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13624         instead. 
13625
13626         * tree.cs: Removed the various RecordXXXX, and replaced with a
13627         single RecordDecl.  Removed all the accessor methods, and just
13628         left a single access point Type 
13629
13630         * enum.cs: Rename DefineEnum to DefineType.
13631
13632         * decl.cs: New abstract method `DefineType' used to unify the
13633         Defines for Enumerations, Interfaces, TypeContainers and
13634         Delegates.
13635
13636         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13637         LookupBaseClasses method that used to live in class.cs and
13638         interface.cs here, and renamed to FindType.
13639
13640         * delegate.cs: Implement DefineType.  Take advantage of the
13641         refactored pattern for locating the parent builder without taking
13642         the parent_builder argument (which we know does not work if we are
13643         nested, and triggering a toplevel definition).
13644
13645 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13648         accessibility of a member has changed during override and report
13649         an error if so.
13650
13651         * class.cs (Method.Define, Property.Define): Only complain on
13652         overrides if the method is private, any other accessibility is
13653         fine (and since we just checked the permission is the same, we are
13654         good to go).
13655
13656         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13657         and elif are processed always.  The other pre-processing
13658         directives are only processed if we are "taking" the path
13659
13660 2002-03-29  Martin Baulig  <martin@gnome.org>
13661
13662         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13663         current location is not Null.
13664
13665         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13666         a separate method so we can profile it.
13667
13668         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13669         `span.Seconds' are just seconds, but no minutes or hours.
13670         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13671
13672 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13673
13674         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13675         Remove the gratuitous set of Final:
13676
13677                                 // If an interface implementation, then we can set Final.
13678                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13679                                     implementing.DeclaringType.IsInterface)
13680                                         flags |= MethodAttributes.Final;
13681
13682         I do not know what I was smoking when I used that.
13683
13684
13685         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13686         step into fixing the name resolution issues for delegates and
13687         unifying the toplevel name resolution.
13688
13689 2002-03-28  Martin Baulig  <martin@gnome.org>
13690
13691         * class.cs (Method.Emit): If we have a symbol writer, call its
13692         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13693         tell it about the current method.
13694
13695         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13696         writer that we're going to emit the first byte of IL code for a new
13697         statement (a new source line).
13698         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13699         EmitContext.Mark() before emitting any code.
13700
13701         * location.cs (SymbolDocument): Return null when we're Null.
13702
13703         * statement.cs (Statement): Moved the `Location loc' variable here.
13704         (Statement.EmitBoolExpression): If we have a symbol writer, call
13705         ec.Mark() before emitting any code to tell it that we're at the
13706         beginning of a new statement.
13707         (StatementExpression): Added `Location' argument to the constructor.
13708         (Block): Added public readonly variable `StartLocation' and public
13709         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13710         (Block): Added constructor which takes a start and end location.
13711         (Block.SetEndLocation): New method. This sets the end location.
13712         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13713         local variables we create.
13714         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13715         each statement and do also mark the begin and end of the block.
13716
13717         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13718         tell it the current lexer.Location, use Location.Null for the end of the
13719         block.
13720         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13721         current block, set its end location using SetEndLocation().
13722         (statement_expression): StatementExpression constructor now takes the
13723         lexer.Location as additional argument.
13724         (for_statement, declare_local_variables): Likewise.
13725         (declare_local_variables): When creating a new implicit block, use the
13726         new Block constructor and pass it the lexer.Location.
13727
13728 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13729
13730         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13731         members also on the parent interfaces recursively.
13732
13733 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13734
13735         * report.cs: Use new formats, since Gonzalo finished the missing
13736         bits. 
13737
13738         * expression.cs (Binary.ResolveOperator): added missing operator|
13739         operator& and operator^ for bool/bool.
13740
13741         * cs-parser.jay: CheckDef now takes a Location argument that is
13742         used to report errors more precisly (instead of reporting the end
13743         of a definition, we try to track something which is a lot closer
13744         to the source of the problem).
13745
13746         * cs-tokenizer.cs: Track global token use, so we can properly flag
13747         the use of #define/#undef after the first token has been seen.
13748
13749         Also, rename the reportXXXX to Error_DescriptiveName
13750
13751         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13752         TypeContainer, so that Enum and Interface can use this too.
13753
13754         * class.cs (TypeContainer.LookupInterfaceOrClass,
13755         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13756         `builder' argument.  Typically this was used to pass the parent
13757         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13758         the definition).  
13759
13760         The problem is that a nested class could trigger the definition of
13761         a toplevel class, and the builder would be obviously wrong in that
13762         case. 
13763
13764         So we drop this argument, and we compute dynamically the
13765         TypeBuilder/ModuleBuilder (the correct information was available
13766         to us anyways from DeclSpace.Parent)
13767
13768         * interface.cs (Interface.DefineInterface): Drop builder
13769         parameter cleanup like class.cs
13770
13771         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13772         like class.cs
13773
13774         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13775         values. 
13776
13777         (Try.Emit): Propagate the returns value from the statement.
13778
13779         (Return.Emit): Even if we are leavning 
13780
13781         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13782
13783         * modifiers.cs: Fix the computation of MethodAttributes flags.
13784
13785 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13786
13787         * driver.cs: allow compilation of files that start with '/'.
13788         Add a default case when checking the argument of --target.
13789
13790 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13791
13792         * interface.cs: Implement the same search algorithm for types in
13793         the interface code.
13794
13795         * delegate.cs: Do not allow multiple definition.
13796
13797         * Recovered ChangeLog that got accidentally amputated
13798
13799         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13800
13801         * rootcontext.cs: Load manually enum to allow core classes to
13802         contain enumerations.
13803
13804         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13805         Update to new static methods in TypeManager.
13806
13807         * typemanager.cs (GetMethod, GetConstructor): Use our
13808         implementation of FindMembers to find the members, since during
13809         corlib compilation, the types are TypeBuilders and GetMethod and
13810         GetConstructor do not work.
13811
13812         Make all methods in TypeManager static.
13813
13814         (InitCodeHelpers): Split the functionality from
13815         the InitCodeTypes function.
13816
13817         * driver.cs: Call InitCodeHelpers after we have populated the
13818         types. 
13819
13820         * cs-parser.jay (delegate_declaration): we did not used to compute
13821         the delegate name correctly for void delegates.
13822
13823 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13824
13825         * rootcontext.cs (RootContext): Init the interface_resolve_order
13826         and type_container_resolve_order always.
13827
13828         (ResolveCore, BootstrapCorlib_ResolveClass,
13829         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13830         compiler when compiling with --nostdlib
13831
13832         * class.cs (TypeContainer.DefineType): Check that our parent is
13833         not null.  This test is most important when we are bootstraping
13834         the core types.
13835
13836         * codegen.cs: Split out the symbol writing code.
13837
13838 2002-03-25  Martin Baulig  <martin@gnome.org>
13839
13840         * driver.cs (-g): Made -g an alias for --debug.
13841
13842 2002-03-24  Martin Baulig  <martin@gnome.org>
13843
13844         * codegen.cs (SymbolWriter): New public variable. Returns the
13845         current symbol writer.
13846         (CodeGen): Added `bool want_debugging_support' argument to the
13847          constructor. If true, tell the ModuleBuild that we want debugging
13848         support and ask it for the ISymbolWriter.
13849         (Save): If we have a symbol writer, call it's Close() method after
13850         saving the assembly.
13851
13852         * driver.c (--debug): New command line argument to create a
13853         debugger information file.
13854
13855         * location.cs (SymbolDocument): New public property. Returns an
13856         ISymbolDocumentWriter object for the current source file or null
13857         if we don't have a symbol writer.
13858
13859 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * driver.cs (LoadAssembly): Correctly return when all the paths
13862         have been tried and not before.
13863
13864         * statement.cs (Switch.Emit): return the actual coverage for this
13865         statement (returns/not-returns)
13866
13867         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13868         switch of the statement if we are the last switch section.  That
13869         kills two problems: try/catch problems (we used to emit an empty
13870         nop at the end) and switch statements where all branches would
13871         return. 
13872
13873 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * driver.cs: Add default assemblies (the equivalent to the
13876         Microsoft CSC.RSP file)
13877
13878         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13879         also update tokens_seen and set it to false.
13880
13881         * driver.cs: Implement --recurse for Mike.
13882
13883         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13884         correctly splitting out the paths.
13885
13886 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13887
13888         * interface.cs (Interface.PopulateProperty): Instead of using
13889         `parent' as the declaration space for the set parameters, use
13890         `this' 
13891
13892         * support.cs (InternalParameters): InternalParameters constructor
13893         takes a DeclSpace instead of a TypeContainer.
13894
13895         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13896         types are being initialized, load the address of it before calling
13897         the function.  
13898
13899         (New): Provide a mechanism to disable the generation of local
13900         value type temporaries when the caller will be providing us with
13901         an address to store it.
13902
13903         (ArrayCreation.EmitDynamicInitializers): Use it.
13904
13905 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13906
13907         * expression.cs (Invocation.EmitArguments): Only probe for array
13908         property if there is more than one argument.  Sorry about that.
13909
13910         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13911         empty param arrays.
13912
13913         * class.cs (Method.LabelParameters): Fix incorrect code path that
13914         prevented the `ParamArrayAttribute' from being applied to the
13915         params attribute.
13916
13917 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13918
13919         * support.cs (ReflectionParameters): Correctly compute whether the
13920         last argument is a params array.  Fixes the problem with
13921         string.Split ('a')
13922
13923         * typemanager.cs: Make the assemblies array always be non-null
13924         (empty, but non-null)
13925
13926         * tree.cs (RecordDecl): New function that abstracts the recording
13927         of names.  This reports error 101, and provides a pointer to the
13928         previous declaration.  Fixes a crash in the compiler.
13929
13930         * cs-parser.jay (constructor_declaration): Update to new grammar,
13931         and provide a constructor_body that can be empty.
13932
13933 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13934
13935         * driver.cs: Add support for --resources.
13936
13937         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13938         Make all types for the various array helper methods be integer.
13939
13940         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13941         CheckState to ConvCast.
13942
13943         (ConvCast): Now it takes a `checked' state argument, to avoid
13944         depending on the emit context for the conversion, and just using
13945         the resolve time setting.
13946
13947         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13948         instead of Invocation.EmitArguments.  We do not emit the original
13949         arguments, instead we emit those which have been converted to
13950         unsigned int expressions.
13951
13952         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13953
13954         * codegen.cs: ditto.
13955
13956         * expression.cs (LocalVariableReference): Drop the use of the
13957         Store function that depended on the variable index.
13958
13959         * statement.cs (VariableInfo): Drop the `Idx' property from this
13960         class, as this is not taking into account the indexes for
13961         temporaries tat we generate during the execution, getting the
13962         indexes wrong.
13963
13964         * class.cs: First emit class initializers, then call the parent
13965         constructor. 
13966
13967         * expression.cs (Binary): Fix opcode emision.
13968         (UnaryMutator.EmitCode): Support checked code generation
13969
13970         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13971         matches for events for both the Static and Instance scans,
13972         pointing to the same element.   Fix that.
13973
13974 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * rootcontext.cs (ResolveTree): Always set the
13977         interface_resolve_order, because nested interfaces will be calling
13978         into us.
13979
13980         * class.cs (GetInterfaceOrClass): Track the same resolution
13981         process used by TypeManager.LookupType.  This fixes the nested
13982         type lookups in class declarations (separate path from
13983         LookupType). 
13984
13985         (TypeContainer.DefineType): Also define nested interfaces.
13986         (TypeContainer.RegisterOrder): New public function used to
13987         register the order in which child interfaces need to be closed.
13988
13989         Nested interfaces need to be closed after their parents have been
13990         created. 
13991
13992         * interface.cs (InterfaceAttr): Put all the logic for computing
13993         the interface attribute here. 
13994
13995         (DefineInterface): Register our interface order with the
13996         RootContext or with the TypeContainer depending on the case.
13997
13998 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13999
14000         * cs-parser.jay: rework foreach statement to work with the new
14001         changes to the policy on SimpleNames.
14002
14003         * report.cs: support Stacktrace on warnings as well.
14004
14005         * makefile: drop --unsafe and /unsafe from the compile.
14006
14007 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14008
14009         * ecore.cs (StandardConversionExists): Modify to take an Expression
14010         as the first parameter. Ensure we do null -> reference type conversion
14011         checking.
14012
14013         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14014         temporary Expression objects.
14015
14016 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14017
14018         * interface.cs: workaround bug in method overloading resolution
14019         (there is already a bugzilla bug for it).
14020
14021 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14022
14023         We could also solve this problem by having a separate path for
14024         performing type lookups, instead of DoResolve, we could have a
14025         ResolveType entry point, and only participating pieces of the
14026         production (simplename, deref, array) would implement this. 
14027
14028         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14029         signal SimpleName to only resolve type names and not attempt to
14030         resolve anything else.
14031
14032         * expression.cs (Cast): Set the flag.
14033
14034         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14035
14036         * class.cs: Only report 108 if there is no `new' modifier.
14037
14038         * cs-parser.jay: rework foreach statement to work with the new
14039         changes to the policy on SimpleNames.
14040
14041         * report.cs: support Stacktrace on warnings as well.
14042
14043         * makefile: drop --unsafe and /unsafe from the compile.
14044
14045 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14048         lookups here, instead of doing that at parse time.  This means
14049         that our grammar will not introduce `LocalVariableReferences' as
14050         expressions at this point.  That solves the problem of code like
14051         this:
14052
14053         class X {
14054            static void Main ()
14055            { int X = 1;
14056             { X x = null }}}
14057
14058         This is only half the fix.  The full fix requires parameters to
14059         also be handled in this way.
14060
14061         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14062         makes the use more obvious of the DeclSpace.  The
14063         ec.TypeContainer.TypeBuilder is now only used to pull the
14064         TypeBuilder for it.
14065
14066         My theory is that I can get rid of the TypeBuilder completely from
14067         the EmitContext, and have typecasts where it is used (from
14068         DeclSpace to where it matters).  
14069
14070         The only pending problem is that the code that implements Aliases
14071         is on TypeContainer, and probably should go in DeclSpace.
14072
14073         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14074         lookups here, instead of doing that at parse time.  This means
14075         that our grammar will not introduce `LocalVariableReferences' as
14076         expressions at this point.  That solves the problem of code like
14077         this:
14078
14079         class X {
14080            static void Main ()
14081            { int X = 1;
14082             { X x = null }}}
14083
14084         This is only half the fix.  The full fix requires parameters to
14085         also be handled in this way.
14086
14087         * class.cs (Property.DefineMethod): When implementing an interface
14088         method, set newslot, when implementing an abstract method, do not
14089         set the flag (before we tried never setting it, or always setting
14090         it, which is the difference).
14091         (Indexer.DefineMethod): same.
14092         (Method.DefineMethod): same.
14093
14094         * ecore.cs: Only set the status used flag if we get back a Field.
14095
14096         * attribute.cs: Temporary hack, so Paolo can keep working.
14097
14098 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14099
14100         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14101         the unmanaged type in the case we have a MarshalAs attribute.
14102
14103         (Resolve): Handle the case when we are parsing the special MarshalAs
14104         attribute [we need to store the unmanaged type to use later]
14105
14106         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14107         MarshalAs Attribute.
14108
14109         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14110         on parameters and accordingly set the marshalling info.
14111
14112 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14113
14114         * class.cs: Optimizing slightly by removing redundant code after
14115         we switched to the `NoTypes' return value.
14116         (Property.DefineMethod): use NoTypes here too.
14117
14118         This fixes the bug I introduced in my last batch of changes.
14119
14120 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14121
14122         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14123
14124         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14125         Enums since those are types too. 
14126
14127         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14128
14129         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14130         thanks to a call during the lookup process.
14131
14132 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14133
14134         * statement.cs (Foreach): Lots of work to accomodate a particular
14135         kind of foreach statement that I had not kept in mind.  It is
14136         possible to have foreachs on classes that provide a GetEnumerator
14137         method that return objects that implement the "pattern" for using
14138         a foreach, there is no need to support GetEnumerator
14139         specifically. 
14140
14141         This is needed to compile nant.
14142
14143         * decl.cs: Only report 114 if the member is not `Finalize' and if
14144         the warning level is at least 2.
14145
14146         * class.cs: Moved the compare function from Method to
14147         MethodSignature. 
14148
14149         (MethodSignature.InheritableMemberSignatureCompare): Add new
14150         filter function that is used to extract inheritable methods from a
14151         class. 
14152
14153         (Method.Define): Use the new `inheritable_method_signature_filter'
14154         delegate
14155
14156         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14157         command. 
14158
14159 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14162
14163         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14164
14165         * expression.cs: Pass location information to
14166         ConvertImplicitStandard. 
14167
14168         * class.cs: Added debugging code to track return values from
14169         interfaces. 
14170
14171 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14172
14173         * expression.cs (Is.DoResolve): If either side of the `is' is an
14174         interface, do not flag the warning.
14175
14176         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14177         for interfaces
14178
14179         * report.cs: Allow for --fatal to be used with --probe.
14180
14181         * typemanager.cs (NoTypes): Move the definition for the empty Type
14182         array here. 
14183
14184         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14185         properties. 
14186         (TypeContainer.DefineProxy): New function used to proxy to parent
14187         implementations when implementing interfaces.
14188         (TypeContainer.ParentImplements): used to lookup if our parent
14189         implements a public function that is required by an interface.
14190         (TypeContainer.VerifyPendingMethods): Hook this up.
14191
14192         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14193         `modules' and `assemblies' arraylists into arrays.  We only grow
14194         these are the very early start up of the program, so this improves
14195         the speedof LookupType (nicely measured).
14196
14197         * expression.cs (MakeByteBlob): Replaced unsafe code with
14198         BitConverter, as suggested by Paolo.
14199
14200         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14201         folding of string concatenation, but if either side is a string,
14202         and the other is not, then return null, and let the runtime use
14203         the concatenation on the string plus the object (using
14204         `Object.ToString'). 
14205
14206 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14207
14208         Constant Folding has been implemented now.
14209
14210         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14211         the error instead on types that are not supported in one's
14212         complement. 
14213
14214         * constant.cs (Constant and all children): New set of functions to
14215         perform implict and explicit conversions.
14216
14217         * ecore.cs (EnumConstant): Implement the new functions to perform
14218         conversion by proxying to the child expression.
14219
14220         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14221         own separate setting that can not be turned off from the command
14222         line using --unchecked or --checked and is only controlled using
14223         the checked/unchecked statements and expressions.  This setting is
14224         used by the constant folder to flag errors.
14225
14226         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14227         ConstantCheckState as well.   
14228
14229         During Resolve, they also have to flag the state, because the
14230         constant folder runs completely in the Resolve phase.
14231
14232         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14233         well.
14234
14235 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14236
14237         * cfold.cs: New file, this file contains the constant folder.
14238
14239         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14240         argument to track whether we are using the resulting address to
14241         load or store a value and provide better error messages. 
14242
14243         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14244         new AddressOf arguments.
14245
14246         * statement.cs (Foreach.EmitCollectionForeach): Update
14247
14248         * expression.cs (Argument.Emit): Call AddressOf with proper
14249         arguments to track usage.
14250
14251         (New.DoEmit): Call AddressOf with new arguments.
14252
14253         (Unary.Emit): Adjust AddressOf call.
14254
14255 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14256
14257         * cs-parser.jay (member_access): Change the case for pre-defined types
14258         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14259         this suggestion.
14260
14261         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14262         a method body.
14263
14264         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14265         essentially like methods and apply attributes like MethodImplOptions to them too.
14266
14267         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14268         not being null.
14269
14270         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14271         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14272         is the DeclSpace.
14273
14274         * Update code everywhere accordingly.
14275
14276         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14277
14278         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14279
14280 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14281
14282         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14283         try performing lookups against those instead of jumping straight into using
14284         the 'using' clauses.
14285
14286         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14287
14288         (LookupType): Perform lookups in implicit parents too.
14289
14290         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14291         sequence as RootContext.LookupType. 
14292
14293         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14294         the various cases of namespace lookups into this method.
14295
14296 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14297
14298         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14299         in positional arguments)
14300
14301         * class.cs (Operator): Update the AllowedModifiers to contain
14302         extern. 
14303
14304         * cs-parser.jay: Update operator declaration to allow for the
14305         operator body to be empty.
14306
14307         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14308         values. 
14309
14310 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14311
14312         * class.cs (Method.Emit): Label parameters.
14313
14314         * driver.cs: Return 1 or 0 as the program exit code.
14315
14316 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14317
14318         * expression.cs: Special case the `null' object when trying to
14319         auto-compute the type, as anything can be explicitly converted to
14320         that. 
14321
14322         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14323         spotting this Paolo.
14324
14325         (Expression.ImplicitNumericConversion): Perform comparissions of
14326         the type using the underlying type in the case of an enumeration
14327         rather than using the enumeration type for the compare.
14328
14329         Cope with the underlying == type case, which is not possible to
14330         catch before. 
14331
14332         (Expression.ConvertNumericExplicit): Perform comparissions of
14333         the type using the underlying type in the case of an enumeration
14334         rather than using the enumeration type for the compare.
14335
14336         * driver.cs: If the user does not supply an extension, assume .exe
14337
14338         * cs-parser.jay (if_statement): Rewrote so that we can track the
14339         location for the if statement.
14340
14341         * expression.cs (Binary.ConstantFold): Only concat strings when
14342         the operation is "+", not everything ;-)
14343
14344         * statement.cs (Statement.EmitBoolExpression): Take a location
14345         argument. 
14346         (If, While, Do): Track location.
14347
14348         * expression.cs (Binary.ResolveOperator): In the object + string
14349         case, I was missing a call to ConvertImplicit
14350
14351 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14352
14353         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14354         Location arguments. Ensure we use RootContext.LookupType to do our work
14355         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14356
14357         * interface.cs (PopulateMethod): Handle the type of the parameter being
14358         null gracefully.
14359
14360         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14361         have a params method with no fixed arguments and a call is made with no
14362         arguments.
14363
14364 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14367         the verbatim-string-literal
14368
14369         * support.cs (InternalParameters.ParameterModifier): handle null
14370         fixed parameters.
14371         (InternalParameters.ParameterType): ditto.
14372
14373         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14374         duplicating the name of the variable parameter.
14375         (GetParameterByName): Fix bug where we were not looking up array
14376         paramters if they were the only present (thanks Paolo!).
14377         (GetParameterInfo): We only have an empty set of types if both
14378         fixed and array are set to null.
14379         (GetParameterInfo-idx): Handle FixedParameter == null
14380
14381         * cs-parser.jay: Handle the case where there is no catch
14382         statements (missing null test).
14383
14384 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14385
14386         * driver.cs (MainDriver): Be conservative on our command line
14387         handling.
14388
14389         Catch DirectoryNotFoundException when calling GetFiles.
14390
14391         (SplitPathAndPattern): Used to split the input specification into
14392         a path and a pattern that we can feed to Directory.GetFiles.
14393
14394 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14395
14396         * statement.cs (Fixed): Implement the last case of the Fixed
14397         statement (string handling).
14398
14399         * expression.cs (StringPtr): New class used to return a char * to
14400         a string;  Used by the Fixed statement.
14401
14402         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14403
14404         * expression.cs (Binary.ResolveOperator): Remove redundant
14405         MemberLookup pn parent type.
14406         Optimize union call, we do not need a union if the types are the same.
14407         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14408         type.
14409
14410         Specialize the use of MemberLookup everywhere, instead of using
14411         the default settings. 
14412
14413         (StackAlloc): Implement stackalloc keyword.
14414
14415         * cs-parser.jay: Add rule to parse stackalloc.
14416
14417         * driver.cs: Handle /h, /help, /?
14418
14419         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14420         before we supported unsafe code.
14421
14422         * makefile: add --unsafe to the self compilation of mcs.
14423
14424 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14425
14426         * expression.cs (PointerArithmetic): New class that is used to
14427         perform pointer arithmetic.
14428         (Binary.Resolve): Handle pointer arithmetic
14429         Handle pointer comparission.
14430         (ArrayPtr): Utility expression class that is used to take the
14431         address of an array.
14432
14433         (ElementAccess): Implement array access for pointers
14434
14435         * statement.cs (Fixed): Implement fixed statement for arrays, we
14436         are missing one more case before we are done.
14437
14438         * expression.cs (Indirection): Implement EmitAssign and set the
14439         ExprClass to Variable.  This allows pointer dereferences to be
14440         treated as variables, and to have values assigned to them.
14441
14442         * ecore.cs (Expression.StoreFromPtr): New utility function to
14443         store values dereferencing.
14444
14445 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14446
14447         * expression.cs (Binary.ResolveOperator): Ensure that we are
14448         not trying to operate on a void type - this fixes the reported
14449         bug.
14450
14451         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14452         the parent implementation is sealed.
14453
14454         * ../errors/cs0239.cs : Add.
14455
14456         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14457
14458         * typemanager.cs (unverifiable_code_type): Corresponds to 
14459         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14460         which have unsafe code in them.
14461
14462         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14463         unsafe context.
14464
14465 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14466
14467         * cs-tokenizer.cs: Add support for @"litreal strings"
14468
14469         Make tokenizer accept pre-processor directives
14470         on any column (remove the old C-like limitation). 
14471
14472         * rootcontext.cs (EmitCode): Emit any global attributes.
14473         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14474
14475         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14476
14477         * cs-parser.jay: Add support for global attributes.  
14478
14479 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14480
14481         * expression.cs (Indirection): New helper class.  Unary will
14482         create Indirection classes to be able to implement the
14483         IMemoryLocation interface on it.
14484
14485 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14486
14487         * cs-parser.jay (fixed_statement): reference the right statement.
14488
14489         * statement.cs (Fixed.Emit): Finish implementing the fixed
14490         statement for the &x case.
14491
14492 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14493
14494         * class.cs (Property.Define, Method.Define): Remove newslot when
14495         `implementing'.  
14496
14497         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14498         wrong.  NewSlot should only be used if the `new' keyword is present.
14499
14500         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14501         locating our system dir.  Sorry about this.
14502
14503 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14504
14505         * driver.cs (GetSystemDir): Compute correctly the location of our
14506         system assemblies.  I was using the compiler directory instead of
14507         the library directory.
14508
14509 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14510
14511         * expression.cs (BetterFunction): Put back in what Miguel commented out
14512         since it is the correct fix. The problem is elsewhere ;-)
14513
14514         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14515         parameters of the parms method are themselves compatible or not !
14516
14517         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14518         to check that a class implements an interface before saying that an implicit
14519         conversion was allowed. Use ImplementsInterface to do the checking.
14520
14521 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * class.cs (Method.Define): Track whether we are an explicit
14524         implementation or not.  And only call DefineMethodOverride if we
14525         are an explicit implementation.
14526
14527         (Property.DefineMethod): Ditto.
14528
14529 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14530
14531         * expression.cs (BetterFunction): Catch hideous bug which was
14532          preventing us from detecting ambiguous calls due to implicit casts i.e
14533         cs0121.
14534
14535 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * support.cs (Pair): Remove un-needed method.  I figured why I was
14538         getting the error in cs-parser.jay, the variable in a foreach loop
14539         is readonly, and the compiler does not really treat this as a variable.
14540
14541         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14542         instead of EQUALS in grammar.  
14543
14544         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14545
14546         * expression.cs (Unary.DoResolve): Check whether the argument is
14547         managed or not.
14548
14549 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * support.cs: Api for Pair to set a value.  Despite the fact that
14552         the variables are public the MS C# compiler refuses to compile
14553         code that accesses the field if the variable is part of a foreach
14554         statement. 
14555
14556         * statement.cs (Fixed): Begin implementation of the fixed
14557         statement.
14558
14559         (Block.AddVariable): Return the VariableInfo on success and null
14560         on failure instead of true/false. 
14561
14562         * cs-parser.jay (foreach): Catch errors on variables already
14563         defined (we were ignoring this value before) and properly unwind
14564         the block hierarchy
14565
14566         (fixed_statement): grammar for the fixed statement.
14567
14568 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14571         pointer types to be incretemented.
14572
14573         (SizeOf): Implement.
14574
14575         * cs-parser.jay (pointer_member_access): Implement
14576         expr->IDENTIFIER production.
14577
14578         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14579         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14580         on safe contexts.
14581
14582         (Unary): Implement indirection.
14583
14584         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14585         use in non-unsafe context).
14586
14587         (SimpleName.DoResolve): Check for pointers in field access on safe
14588         contexts. 
14589
14590         (Expression.LoadFromPtr): Factor the load-indirect code in this
14591         function.  This was duplicated in UnboxCast and ParameterReference
14592
14593 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14594
14595         * expression.cs (ComposedCast): report an error if a pointer cast
14596         is used in a safe region.
14597
14598         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14599         pointer type casts in unsafe context.
14600
14601         * codegen.cs (EmitContext): Set up IsUnsafe.
14602
14603         * cs-parser.jay (non_expression_type): Add productions for pointer
14604         casts. 
14605
14606         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14607         code.  We should not use force into static mode if the method is
14608         not virtual.  Fixes bug in MIS
14609
14610         * statement.cs (Do.Emit, While.Emit, For.Emit,
14611         Statement.EmitBoolExpression): Add support to Do and While to
14612         propagate infinite loop as `I do return' semantics.
14613
14614         Improve the For case to also test for boolean constants.
14615
14616         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14617         to the list of attributes we can add.
14618
14619         Remove `EmitContext' argument.
14620
14621         * class.cs (Method.Define): Apply parameter attributes.
14622         (Constructor.Define): Apply parameter attributes.
14623         (MethodCore.LabelParameters): Move here the core of labeling
14624         parameters. 
14625
14626         * support.cs (ReflectionParameters.ParameterModifier,
14627         InternalParameters.ParameterModifier): Use IsByRef on the type and
14628         only return the OUT bit for these parameters instead of in/out/ref
14629         flags.
14630
14631         This is because I miss-understood things.  The ParameterInfo.IsIn
14632         and IsOut represent whether the parameter has the [In] and [Out]
14633         attributes set.  
14634
14635 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14636
14637         * ecore.cs (FieldExpr.Emit): Release temporaries.
14638
14639         * assign.cs (LocalTemporary.Release): new function.
14640
14641         * codegen.cs (EmitContext.GetTemporaryStorage,
14642         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14643         temporary storage.  Now we can "put back" localbuilders when we
14644         are done with them
14645
14646 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14647
14648         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14649         need to make a copy of the variable to generate verifiable code.
14650
14651 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * driver.cs: Compute dynamically the system directory.
14654
14655         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14656         Slower, but more generally useful.  Used by the abstract
14657         registering implementation. 
14658
14659         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14660         the rules for the special rule on Type/instances.  First check if
14661         we have the same name, and if so, try that special static path
14662         rather than the instance path.
14663
14664 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14667         for, while and if.
14668
14669         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14670         Enum, ValueType, Delegate or Array for non-corlib compiles.
14671
14672         * cs-tokenizer.cs: Catch long identifiers (645)
14673
14674         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14675         piece of code.
14676
14677         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14678         fix, we were returning too early, so we were not registering
14679         pending methods from abstract classes.
14680
14681         Do not register pending methods if the class is abstract.
14682
14683         * expression.cs (Conditional.DoResolve): Report circular implicit
14684         conversions when we neecd to compute it for conditional
14685         expressions. 
14686
14687         (Is.DoResolve): If the expression is always of the provided type,
14688         flag warning 183.  If the expression can not ever be of the
14689         provided type flag warning 184.
14690
14691         * class.cs: Catch 169 as well.
14692
14693         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14694         read. 
14695
14696 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14697
14698         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14699
14700 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14701
14702         * interface.cs: (PopulateMethod): Check for pointers being defined
14703         only if the unsafe context is active.
14704         (PopulateProperty): ditto.
14705         (PopulateIndexer): ditto.
14706
14707         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14708         specified.  If pointers are present, make sure that they are
14709         present in an unsafe context.
14710         (Constructor, Constructor.Define): ditto.
14711         (Field, Field.Define): ditto.
14712         (Property, Property.Define): ditto.
14713         (Event, Event.Define): ditto.
14714
14715         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14716         hashtable if there are classes or structs defined.
14717
14718         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14719         code, as the constant resolution moved.
14720
14721         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14722         the metadata, so we can flag error 133. 
14723
14724         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14725         pointer is being declared in an unsafe context.
14726
14727 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * modifiers.cs (Modifiers.Check): Require a Location argument.
14730         Report error 227 for Unsafe use.
14731
14732         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14733
14734         * statement.cs (For.Emit): If the test is null, then report that
14735         we do `return', as we wont reach anything afterwards.
14736
14737         (Switch.SwitchGoverningType): Track the expression that matched
14738         the conversion.
14739
14740         * driver.cs: Allow negative numbers as an error code to flag.
14741
14742         * cs-parser.jay: Handle 1551.
14743
14744         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14745
14746 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14747
14748         * cs-parser.jay: Report 1518 (type declaration can only contain
14749         class, struct, interface, enum or delegate)
14750
14751         (switch_label): Report 1523 (keywords `case' or `default' must
14752         preced code)
14753
14754         (opt_switch_sections): Report 1522 (empty switch)
14755
14756         * driver.cs: Report 1515 (response file specified multiple times)
14757         Report 1516 (Source file specified multiple times).
14758
14759         * expression.cs (Argument.Resolve): Signal 1510
14760
14761         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14762         access not allowed in static code)
14763
14764 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14765
14766         * typemanager.cs (IsPointerType): Utility method which we are going
14767         to need a lot.
14768
14769         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14770         the object type, so we take care of that.
14771
14772         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14773
14774         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14775         added to non-params parameters :-)
14776
14777         * typemanager.cs (CSharpName): Include 'void' type too. 
14778
14779         (void_ptr_type): Include in the set of core types.
14780
14781         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14782         duplicating code.
14783
14784         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14785         an unsafe context.
14786
14787         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14788         completely forgotten about it.
14789
14790 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14791
14792         * cs-parser.jay (pointer_type): Add. This begins our implementation
14793         of parsing rules for unsafe code.
14794
14795         (unsafe_statement): Implement.
14796
14797         (embedded_statement): Modify to include the above.
14798
14799         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14800
14801         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14802         if the current context is an unsafe one.
14803
14804         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14805         are handled differently, we need separate rules for them.
14806
14807         (local_variable_declaration): Update to use local_variable_pointer_type
14808         to allow variable declarations of unmanaged pointer types.
14809
14810         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14811         in unsafe contexts.
14812
14813         * ../errors/cs0214.cs : Add.
14814
14815 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14816
14817         * makefile: remove 'response' file when cleaning.
14818
14819 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14820
14821         * cs-parser.jay: Report 1524.
14822
14823 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14824
14825         * typemanager.cs (RegisterMethod): drop checking if we have
14826         registered this from here
14827
14828 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14829
14830         * class.cs (Method.EmitDestructor): Implement calling our base
14831         destructor. 
14832
14833         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14834         value of InFinally.
14835
14836         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14837         this routine and will wrap the call in a try/catch block.  Deal
14838         with the case.
14839
14840 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14841
14842         * ecore.cs (Expression.MemberLookup): instead of taking a
14843         parameter `same_type' that was used to tell whether we could
14844         access private members we compute our containing type from the
14845         EmitContext.
14846
14847         (FieldExpr): Added partial support for volatile fields.  This does
14848         not work for volatile fields exposed from assemblies, as I can not
14849         figure out how to extract the modreq from it.
14850
14851         Updated all the source files to use this.
14852
14853         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14854         because it is referenced by MemberLookup very often. 
14855
14856 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14857
14858         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14859         TypeBuilder.GetCustomAttributes to retrieve what we need.
14860
14861         Get rid of redundant default_member_attr_type as this is the same as
14862         default_member_type which already exists.
14863
14864         * interface.cs, attribute.cs : Update accordingly.
14865
14866 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14867
14868         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14869         work for TYpeBuilders though.  Ravi, can you please fix this?
14870
14871         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14872
14873         * expression.cs (Argument.Emit): Handle the case of ref objects
14874         being passed to ref functions;  
14875
14876         (ParameterReference.EmitLoad): Loads the content of the pointer
14877         without dereferencing.
14878
14879 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14880
14881         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14882
14883 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14884
14885         * class.cs (Indexer.DefineMethod): Incorporate the interface
14886         type in the name of the method if we are doing explicit interface
14887         implementation.
14888
14889         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14890
14891         (BetterConversion): Fix extremely trivial bug where we were referring to
14892         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14893         again !
14894
14895         * ../errors/bug16.cs : Add although we have fixed it.
14896
14897 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14898
14899         * expression.cs (BaseIndexer): Begin implementation.
14900
14901         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14902
14903         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14904         production directly to remove a shift/reduce, and implement
14905         explicit interface implementation.
14906
14907         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14908         after a floating point suffix.
14909
14910         * expression.cs (DoNumericPromotions): Improved the conversion for
14911         uint/uint.  If we have a constant, we avoid doing a typecast to a
14912         larger type.
14913
14914         * class.cs (Indexer): Implement explicit interface implementation
14915         for indexers.
14916
14917 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14918
14919         * class.cs: make the default instance constructor public and hidebysig.
14920
14921 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14922
14923         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14924         so we can call it from elsewhere.
14925
14926         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14927         we emit it internally if the class has a defined indexer; otherwise the user
14928         emits it by decorating the class definition with the DefaultMemberAttribute.
14929
14930         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14931         attribute is not used on a type which defines an indexer.
14932
14933         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14934         character when we skip whitespace.
14935
14936         * ../errors/cs0646.cs : Add.
14937
14938 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14939
14940         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14941         again. 
14942
14943         * makefile: Add practical target `mcs3.exe' which builds the third
14944         generation compiler. 
14945
14946         * expression.cs (New): Fix structures constructor calling.
14947
14948         * class.cs (Property, Method, Indexer): Emit Final flag on the
14949         method if we are an interface implementation and we are not
14950         abstract. 
14951
14952         * ecore.cs (PropertyExpr): New public field `IsBase', tells
14953         whether this property is referencing a `base' method.
14954
14955         * expression.cs (Invocation.EmitCall): take an extra argument:
14956         is_base, this is used to determine whether the `call' or
14957         `callvirt' opcode should be used.
14958
14959
14960         * delegate.cs: update EmitCall.
14961
14962         * class.cs (Method.Define): Set NewSlot for the cases where we are
14963         not implementing an interface method.
14964
14965         (Property.Define): ditto.
14966
14967 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
14968
14969         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14970         'r'.  Allows mcs to parse itself fully.
14971
14972 2002-01-02  Ravi Pratap  <ravi@ximian.com>
14973
14974         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14975         of the number of initializers that require the InitializeArray method.
14976
14977         (CheckIndices): Store the Expression in all cases - not the plain value. Also
14978         update the above field where necessary.
14979
14980         (MakeByteBlob): Update accordingly.
14981
14982         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
14983         greater than 2.
14984
14985         (EmitDynamicInitializers): Update in accordance with the new optimization.
14986
14987         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
14988         same OpCode applies.
14989
14990         * cs-parser.jay : Fix some glaring errors I introduced.
14991
14992 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
14993
14994         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
14995         so that we can check for name clashes there too.
14996
14997         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
14998         for interface indexers.
14999
15000         * interfaces.cs (Define): Emit the default member attribute.
15001
15002         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15003         variable was being referred to while setting the value ;-)
15004
15005 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15008         byte-by-byte information when we know the data is zero.
15009
15010         Make the block always a multiple of 4, because
15011         DefineInitializedData has a bug.
15012
15013         * assign.cs: Fix, we should assign from the temporary, not from
15014         the source. 
15015
15016         * expression.cs (MakeByteBlob): Fix my incorrect code.
15017
15018 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15019
15020         * typemanager.cs (EnumToUnderlying): This function is used to get
15021         the underlying type from an enumeration, because it does not
15022         always work. 
15023
15024         * constant.cs: Use the I4_S form for values between -128 and 127.
15025
15026         * statement.cs (Block.LookupLabel): Looks up a label.
15027         (Block): Drop support for labeled blocks.
15028
15029         (LabeledStatement): New kind of statement that represents a label
15030         only.
15031
15032         (Goto): Finally implement this bad boy.
15033
15034         * cs-parser.jay: Update to reflect new mechanism to implement
15035         labels.
15036
15037 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15038
15039         * codegen.cs (EmitContext.This): a codegen property that keeps the
15040         a single instance of this instead of creating many different this
15041         instances. 
15042
15043         * delegate.cs (Delegate.DoResolve): Update to use the property;
15044
15045         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15046
15047         * expression.cs (BaseAccess.DoResolve): Ditto.
15048
15049 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15050
15051         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15052         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15053
15054         (InitCoreTypes): Update accordingly.
15055
15056         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15057         so we can quickly store the state.
15058
15059         (ApplyAttributes): Set the correct implementation flags
15060         for InternalCall methods.
15061
15062 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * expression.cs (EmitCall): if a method is not virtual, then do
15065         not use callvirt on it.
15066
15067         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15068         user defined stuff) requires the use of stobj, which takes an
15069         address on the stack instead of an array and an index.  So emit
15070         the Ldelema operation for it.
15071
15072         (EmitStoreOpcode): Use stobj for valuetypes.
15073
15074         (UnaryMutator.EmitCode): Use the right 1 value depending on
15075         whether we are dealing with int64/uint64, float or doubles.
15076
15077         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15078         constructors that I implemented last night.
15079
15080         (Constructor.IsDefault): Fix to work properly for static
15081         constructors.
15082
15083         * cs-parser.jay (CheckDef): report method signature errors.
15084         Update error number 103 to be 132.
15085
15086         * decl.cs: New AdditionResult enumeration value: MethodExists.
15087         Although we do this check for methods later on in the semantic
15088         analysis, catching repeated default constructors is so easy that
15089         we catch these here. 
15090
15091         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15092         promotions code.
15093
15094         (ParameterReference.EmitAssign, Emit): handle
15095         bools as bytes.
15096
15097         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15098         (ArrayAccess.EmitStoreOpcode): ditto.
15099
15100         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15101
15102         * expression.cs (MakeByteBlob): Complete all the missing types
15103         (uint, short, ushort, byte, sbyte)
15104
15105         * class.cs: Only init instance field initializers on instance
15106         constructors. 
15107
15108         Rename `constructors' to instance_constructors. 
15109
15110         (TypeContainer.AddConstructor): Only add constructors to the list
15111         if it is not static.
15112
15113         Make sure that we handle default_static_constructor independently
15114         everywhere where we handle instance_constructors
15115
15116 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * class.cs: Do not lookup or create a base initializer for a
15119         static constructor.
15120
15121         (ConstructorInitializer.Resolve): use the proper type to lookup
15122         for constructors.
15123
15124         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15125
15126         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15127         in DeclSpace. 
15128
15129         * decl.cs: CloseType is now an virtual method, the default
15130         implementation just closes this type.
15131
15132 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15133
15134         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15135         to PreserveSig by default. Also emit HideBySig on such methods.
15136
15137         Basically, set the defaults to standard values.
15138
15139         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15140         argument, if candidate is better, it can't be worse than the best !
15141
15142         (Invocation): Re-write bits to differentiate between methods being
15143         applicable in their expanded form and their normal form - for params
15144         methods of course.
15145
15146         Get rid of use_standard everywhere as only standard conversions are allowed
15147         in overload resolution. 
15148
15149         More spec conformance.
15150
15151 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15152
15153         * driver.cs: Add --timestamp, to see where the compiler spends
15154         most of its time.
15155
15156         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15157         `this' in static code.
15158
15159         (SimpleName.DoResolve): Implement in terms of a helper function
15160         that allows static-references to be passed upstream to
15161         MemberAccess.
15162
15163         (Expression.ResolveWithSimpleName): Resolve specially simple
15164         names when called by MemberAccess to implement the special
15165         semantics. 
15166
15167         (Expression.ImplicitReferenceConversion): Handle conversions from
15168         Null to reference types before others, as Null's type is
15169         System.Object. 
15170
15171         * expression.cs (Invocation.EmitCall): Handle the special case of
15172         calling methods declared on a reference type from a ValueType
15173         (Base classes System.Object and System.Enum)
15174
15175         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15176         the left hand side is a TypeExpr, not on every enumeration. 
15177
15178         (Binary.Resolve): If types are reference types, then do a cast to
15179         object on operators != and == of both arguments.
15180
15181         * typemanager.cs (FindMembers): Extract instance and static
15182         members if requested.
15183
15184         * interface.cs (PopulateProperty): Use void_type instead of null
15185         as the return type for the setter method.
15186
15187         (PopulateIndexer): ditto.
15188
15189 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15190
15191         * support.cs (ReflectionParameters): Fix minor bug where we
15192         were examining the wrong parameter for the ParamArray attribute.
15193
15194         Cope with requests for the type of the parameter at position
15195         greater than the params parameter's. We now return the element
15196         type of the params array as that makes more sense.
15197
15198         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15199         accordingly as we no longer have to extract the element type
15200         ourselves.
15201
15202         (Invocation.OverloadResolve): Update.
15203
15204 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15207         against IEnumerator, test whether the return value is a descendant
15208         of the IEnumerator interface.
15209
15210         * class.cs (Indexer.Define): Use an auxiliary method to implement
15211         the other bits of the method definition.  Begin support for
15212         explicit interface implementation.
15213
15214         (Property.DefineMethod): Use TypeManager.void_type instead of null
15215         for an empty return value.
15216
15217 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15218
15219         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15220         dealing with a FieldExpr which is composed of a FieldBuilder, in
15221         the code path we did extract the constant, but we should have
15222         obtained the underlying value to be able to cast it (otherwise we
15223         end up in an infinite loop, this is what Ravi was running into).
15224
15225         (ArrayCreation.UpdateIndices): Arrays might be empty.
15226
15227         (MemberAccess.ResolveMemberAccess): Add support for section
15228         14.5.4.1 that deals with the special case of E.I when E is a type
15229         and something else, that I can be a reference to a static member.
15230
15231         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15232         handle a particular array type to create byte blobs, it is just
15233         something we dont generate byteblobs for.
15234
15235         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15236         arguments. 
15237
15238         * location.cs (Push): remove the key from the hashtable that we
15239         are about to add.   This happens for empty files.
15240
15241         * driver.cs: Dispose files after we have parsed them.
15242
15243         (tokenize): new function that only runs the tokenizer on its
15244         input, for speed testing.
15245
15246 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15247
15248         * class.cs (Event.Define): Define the private field only if there
15249         are no accessors defined.
15250
15251         * expression.cs (ResolveMemberAccess): If there is no associated
15252         field with the event, that means we have an event defined with its
15253         own accessors and we should flag error cs0070 since transforming
15254         ourselves into a field is not valid in that case.
15255
15256         * ecore.cs (SimpleName.DoResolve): Same as above.
15257
15258         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15259         and charset to sane values.
15260
15261 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15262
15263         * assign.cs (DoResolve): Perform check on events only if they 
15264         are being accessed outside the declaring type.
15265
15266         * cs-parser.jay (event_declarations): Update rules to correctly
15267         set the type of the implicit parameter etc.
15268
15269         (add_accessor, remove_accessor): Set current local parameters.
15270
15271         * expression.cs (Binary): For delegate addition and subtraction,
15272         cast the return value from the method into the appropriate delegate
15273         type.
15274
15275 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15276
15277         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15278         of these as the workaround is unnecessary.
15279
15280         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15281         delegate data - none of that is needed at all.
15282
15283         Re-write bits to extract the instance expression and the delegate method
15284         correctly.
15285
15286         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15287         on delegates too.
15288
15289         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15290         of attaching attributes instead of duplicating code everywhere.
15291
15292         * everywhere : Update code to do attribute emission using the above method.
15293
15294 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * expression.cs (IsParamsMethodApplicable): if there are not
15297         parameters, return immediately.
15298
15299         * ecore.cs: The 0 literal can be implicity converted to an enum
15300         type. 
15301
15302         (SimpleName.DoResolve): First lookup the type, then lookup the
15303         members. 
15304
15305         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15306         want to get its address.  If the InstanceExpression is not
15307         addressable, store the result in a temporary variable, then get
15308         the address of it.
15309
15310         * codegen.cs: Only display 219 errors on warning level or above. 
15311
15312         * expression.cs (ArrayAccess): Make it implement the
15313         IMemoryLocation interface.
15314
15315         (Binary.DoResolve): handle the operator == (object a, object b)
15316         and operator != (object a, object b) without incurring into a
15317         BoxedCast (because 5 != o should never be performed).
15318
15319         Handle binary enumerator operators.
15320
15321         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15322         value type, otherwise use Ldelem_ref.
15323
15324         Use precomputed names;
15325
15326         (AddressOf): Implement address of
15327
15328         * cs-parser.jay (labeled_statement): Fix recursive block
15329         addition by reworking the production.
15330
15331         * expression.cs (New.DoEmit): New has a special case:
15332                 
15333                  If we are dealing with a ValueType, we have a few
15334                  situations to deal with:
15335                 
15336                     * The target of New is a ValueType variable, that is
15337                       easy, we just pass this as the variable reference
15338                 
15339                     * The target of New is being passed as an argument,
15340                       to a boxing operation or a function that takes a
15341                       ValueType.
15342                 
15343                       In this case, we need to create a temporary variable
15344                       that is the argument of New.
15345
15346
15347 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15348
15349         * rootcontext.cs (LookupType): Check that current_type is not null before
15350         going about looking at nested types.
15351
15352         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15353         not implement the IAssignMethod interface any more.
15354
15355         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15356         where we tranform them into FieldExprs if they are being resolved from within
15357         the declaring type.
15358
15359         * ecore.cs (SimpleName.DoResolve): Do the same here.
15360
15361         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15362
15363         * ../errors/bug10.cs : Add.
15364
15365         * ../errors/cs0070.cs : Add.
15366
15367         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15368
15369         * assign.cs : Get rid of EventIsLocal everywhere.
15370
15371 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15372
15373         * ecore.cs (ConvertIntLiteral): finished the implementation.
15374
15375         * statement.cs (SwitchLabel): Convert the value we are using as a
15376         key before looking up the table.
15377
15378 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15379
15380         * codegen.cs (EmitTopBlock): Require a Location argument now.
15381
15382         * cs-parser.jay (constructor_declarator): We need to setup
15383         current_local_parameters before we parse the
15384         opt_constructor_initializer, to allow the variables to be bound
15385         to the constructor arguments.
15386
15387         * rootcontext.cs (LookupType): First lookup nested classes in our
15388         class and our parents before we go looking outside our class.
15389
15390         * expression.cs (ConstantFold): Extract/debox the values at the
15391         beginnning. 
15392
15393         * rootcontext.cs (EmitCode): Resolve the constants first before we
15394         resolve the types.  This is not really needed, but it helps debugging.
15395
15396         * statement.cs: report location.
15397
15398         * cs-parser.jay: pass location to throw statement.
15399
15400         * driver.cs: Small bug fix.
15401
15402         * report.cs: Updated format to be 4-zero filled digits.
15403
15404 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15405
15406         * expression.cs (CheckIndices): Fix minor bug where the wrong
15407         variable was being referred to ;-)
15408
15409         (DoEmit): Do not call EmitStaticInitializers when the 
15410         underlying type is System.Object.
15411
15412 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15413
15414         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15415         and do the usual workaround for SRE.
15416
15417         * class.cs (MyEventBuilder.EventType): New member to get at the type
15418         of the event, quickly.
15419
15420         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15421
15422         * assign.cs (Assign.DoResolve): Handle the case when the target
15423         is an EventExpr and perform the necessary checks.
15424
15425         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15426         interface.
15427
15428         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15429
15430         (EventExpr): Set the type in the constructor itself since we 
15431         are meant to be born fully resolved.
15432
15433         (EventExpr.Define): Revert code I wrote earlier.
15434                 
15435         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15436         instance expression is null. The instance expression is a This in that case
15437         or a null, depending on whether it is a static method or not.
15438
15439         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15440         refers to more than one method.
15441
15442         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15443         and accordingly flag errors.
15444
15445 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15446
15447         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15448
15449 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15450
15451         * location.cs (ToString): Provide useful rutine.
15452
15453 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15456         objects, return the actual integral boxed.
15457
15458         * statement.cs (SwitchLabel): define an ILLabel for each
15459         SwitchLabel. 
15460
15461         (Switch.CheckSwitch): If the value is a Literal, extract
15462         the underlying literal.
15463
15464         Also in the unused hashtable we had, add the SwitchLabel so we can
15465         quickly look this value up.
15466
15467         * constant.cs: Implement a bunch of new constants.  Rewrite
15468         Literal based on this.  Made changes everywhere to adapt to this.
15469
15470         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15471         dereferencing array only once, and also copes with enumrations.
15472
15473         bytes are two bytes wide, not one.
15474
15475         (Cast): Perform constant conversions.
15476
15477         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15478         wrappers to the literals here.
15479
15480         * expression.cs (DoNumericPromotions): long literals can converted
15481         to ulong implicity (this is taken care of elsewhere, but I was
15482         missing this spot).
15483
15484         * ecore.cs (Expression.Literalize): Make the return type Literal,
15485         to improve type checking.
15486
15487         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15488
15489 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15490
15491         * literal.cs: Revert code from ravi that checked the bounds.  The
15492         bounds are sane by the definition of the type itself. 
15493
15494         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15495         need to actually look up in our parent hierarchy for interfaces
15496         implemented. 
15497
15498         * const.cs: Use the underlying type for enumerations
15499
15500         * delegate.cs: Compute the basename for the delegate creation,
15501         that should fix the delegate test case, and restore the correct
15502         Type Lookup semantics in rootcontext
15503
15504         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15505         referencing a nested type with the Reflection API is using the "+"
15506         sign. 
15507
15508         * cs-parser.jay: Do not require EOF token at the end.
15509
15510 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15511
15512         * rootcontext.cs (LookupType): Concatenate type names with
15513         a '.' instead of a '+' The test suite passes again.
15514
15515         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15516         field of the enumeration.
15517
15518         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15519         the case when the member is an EventExpr.
15520
15521         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15522         static has an associated instance expression.
15523
15524         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15525
15526         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15527
15528         * class.cs (Event.Define): Register event and perform appropriate checks
15529         for error #111.
15530
15531         We define the Add and Remove methods even if the use provides none because
15532         in that case, we provide default implementations ourselves.
15533
15534         Define a private field of the type of the event. This is done by the CSC compiler
15535         and we should be doing it too ;-)
15536
15537         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15538         More methods we use in code we generate.
15539
15540         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15541         is important.
15542
15543         (InitCoreTypes): Update accordingly for the above.
15544
15545         * class.cs (Event.Emit): Generate code for default accessors that we provide
15546
15547         (EmitDefaultMethod): Do the job in the above.
15548
15549         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15550         appropriate place.
15551
15552 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15553
15554         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15555         builders even if we were missing one.
15556
15557         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15558         pass the Basename as our class name instead of the Name.  The
15559         basename will be correctly composed for us.
15560
15561         * parameter.cs (Paramters): Now takes a Location argument.
15562
15563         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15564         make all the code call directly LookupType in RootContext and take
15565         this chance to pass the Location information everywhere.
15566
15567         * Everywhere: pass Location information.
15568
15569 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * class.cs (Constructor.Define): Updated way of detecting the
15572         length of the parameters.
15573
15574         (TypeContainer.DefineType): Use basename as the type name for
15575         nested types.
15576
15577         (TypeContainer.Define): Do not recursively define types here, as
15578         definition is taken care in order by the RootContext.
15579
15580         * tree.cs: Keep track of namespaces in a per-file basis.
15581
15582         * parameter.cs (Parameter.ComputeSignature): Update to use
15583         DeclSpace. 
15584
15585         (Parameters.GetSignature): ditto.
15586
15587         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15588         instead of a TypeContainer.
15589
15590         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15591         resolve names.  Because we need to be resolve in our context, not
15592         our parents.
15593
15594         * driver.cs: Implement response files.
15595
15596         * class.cs (TypeContainer.DefineType): If we are defined, do not
15597         redefine ourselves.
15598
15599         (Event.Emit): Emit the code for add/remove handlers.
15600         (Event.Define): Save the MethodBuilders for add/remove.
15601
15602         * typemanager.cs: Use pair here too.
15603
15604         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15605         DictionaryEntry requires the first argument to be non-null.  
15606
15607         (enum_declaration): Compute full name for registering the
15608         enumeration.
15609
15610         (delegate_declaration): Instead of using
15611         formal_parameter_list, use opt_formal_parameter_list as the list
15612         can be empty.
15613
15614         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15615         (EventParsing): New property that controls whether `add' and
15616         `remove' are returned as tokens or identifiers (for events);
15617
15618 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15619
15620         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15621         use MyEventBuilder only and let it wrap the real builder for us.
15622
15623         (MyEventBuilder): Revamp constructor etc.
15624
15625         Implement all operations that we perform on EventBuilder in precisely the same
15626         way here too.
15627
15628         (FindMembers): Update to use the EventBuilder member.
15629
15630         (Event.Emit): Update accordingly.
15631
15632 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15633
15634         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15635         by calling the appropriate methods.
15636
15637         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15638         useful.
15639
15640         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15641
15642 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15643
15644         * delegate.cs (Delegate.Populate): Check that the return type
15645         and various parameters types are indeed accessible.
15646
15647         * class.cs (Constructor.Define): Same here.
15648
15649         (Field.Define): Ditto.
15650
15651         (Event.Define): Ditto.
15652
15653         (Operator.Define): Check that the underlying Method defined itself
15654         correctly - so it's MethodBuilder should not be null.
15655
15656         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15657         expression happens to be null.
15658
15659         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15660         members but as of now we don't seem to be able to do anything really useful with it.
15661
15662         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15663         not the EventBuilder.
15664
15665 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15666
15667         * cs-tokenizer.cs: Add support for defines.
15668         Add support for #if, #elif, #else, #endif
15669
15670         (eval_var): evaluates a variable.
15671         (eval): stubbed for evaluating functions.
15672
15673         * cs-parser.jay: Pass the defines information
15674
15675         * driver.cs: Add --define command line option.
15676
15677         * decl.cs: Move MemberCore here.
15678
15679         Make it the base class for DeclSpace.  This allows us to catch and
15680         report 108 and 109 for everything now.
15681
15682         * class.cs (TypeContainer.Define): Extract all the members
15683         before populating and emit the warning 108 (new keyword required
15684         to override) instead of having each member implement this.
15685
15686         (MemberCore.Define): New abstract method, we will be using this in
15687         the warning reporting engine in Populate.
15688
15689         (Operator.Define): Adjust to new MemberCore protocol. 
15690
15691         * const.cs (Const): This does not derive from Expression, it is a
15692         temporary object we use to create fields, it is a MemberCore. 
15693
15694         * class.cs (Method.Define): Allow the entry point to be in a
15695         specific class.
15696
15697         * driver.cs: Rewrite the argument handler to clean it up a bit.
15698
15699         * rootcontext.cs: Made it just an auxiliary namespace feature by
15700         making everything static.
15701
15702         * driver.cs: Adapt code to use RootContext type name instead of
15703         instance variable.
15704
15705         * delegate.cs: Remove RootContext argument.
15706
15707         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15708         argument. 
15709
15710         * class.cs (Event.Define): The lookup can fail.
15711
15712         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15713
15714         * expression.cs: Resolve the this instance before invoking the code.
15715
15716 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * cs-parser.jay: Add a production in element_access that allows
15719         the thing to become a "type" reference.  This way we can parse
15720         things like "(string [])" as a type.
15721
15722         Note that this still does not handle the more complex rules of
15723         casts. 
15724
15725
15726         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15727
15728         * ecore.cs: (CopyNewMethods): new utility function used to
15729         assemble the list of methods from running FindMembers.
15730
15731         (MemberLookup): Rework FindMembers so that 
15732
15733 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * class.cs (TypeContainer): Remove Delegates who fail to be
15736         defined.
15737
15738         * delegate.cs (Populate): Verify that we dont get null return
15739         values.   TODO: Check for AsAccessible.
15740
15741         * cs-parser.jay: Use basename to emit error 574 (destructor should
15742         have the same name as container class), not the full name.
15743
15744         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15745         possible representation.  
15746
15747         Also implements integer type suffixes U and L.
15748
15749 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15750
15751         * expression.cs (ArrayCreation.DoResolve): We need to do the
15752         argument resolution *always*.
15753
15754         * decl.cs: Make this hold the namespace.  Hold the root context as
15755         well.
15756         (LookupType): Move here.
15757
15758         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15759
15760         * location.cs (Row, Name): Fixed the code, it was always returning
15761         references to the first file.
15762
15763         * interface.cs: Register properties defined through interfaces.
15764
15765         * driver.cs: Add support for globbing on the command line
15766
15767         * class.cs (Field): Make it derive from MemberCore as well.
15768         (Event): ditto.
15769
15770 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15771
15772         * class.cs (Event::Define): Check that the type of the event is a delegate
15773         type else flag error #66.
15774
15775         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15776         same.
15777
15778         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15779         values of EntryPoint, CharSet etc etc.
15780
15781         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15782
15783         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15784         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15785         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15786         which needs this to do its work.
15787
15788         * ../errors/cs0066.cs : Add.
15789
15790 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15791
15792         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15793         helper functions.
15794
15795         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15796         clears out the parameters field.
15797         (MemberSignatureCompare): Cleanup
15798
15799         (MemberCore): New base class used to share code between MethodCore
15800         and Property.
15801
15802         (RegisterRequiredImplementations) BindingFlags.Public requires
15803         either BindingFlags.Instace or Static.  Use instance here.
15804
15805         (Property): Refactored code to cope better with the full spec.
15806
15807         * parameter.cs (GetParameterInfo): Return an empty array instead
15808         of null on error.
15809
15810         * class.cs (Property): Abstract or extern properties have no bodies.
15811
15812         * parameter.cs (GetParameterInfo): return a zero-sized array.
15813
15814         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15815         method modifier validation to the typecontainer so we can reuse
15816         this on properties.
15817
15818         (MethodCore.ParameterTypes): return an empty sized array of types.
15819
15820         (Property.Define): Test property modifier validity.
15821
15822         Add tests for sealed/override too.
15823
15824         (Method.Emit): abstract or extern methods have no bodies.
15825
15826 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15827
15828         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15829         thing.
15830
15831         (Method::Define, ::Emit): Modify accordingly.
15832
15833         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15834
15835         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15836
15837         * makefile: Pass in /unsafe.
15838
15839 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * class.cs (MakeKey): Kill routine.
15842
15843         * class.cs (TypeContainer.Define): Correctly define explicit
15844         method implementations (they require the full interface name plus
15845         the method name).
15846
15847         * typemanager.cs: Deply the PtrHashtable here and stop using the
15848         lame keys.  Things work so much better.
15849
15850         This of course broke everyone who depended on `RegisterMethod' to
15851         do the `test for existance' test.  This has to be done elsewhere.
15852
15853         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15854         the object stupid Equals method (because, that like fails all over
15855         the place).  We still do not use it.
15856
15857         * class.cs (TypeContainer.SetRequiredInterface,
15858         TypeContainer.RequireMethods): Killed these two routines and moved
15859         all the functionality to RegisterRequiredImplementations.
15860
15861         (TypeContainer.RegisterRequiredImplementations): This routine now
15862         registers all the implementations required in an array for the
15863         interfaces and abstract methods.  We use an array of structures
15864         which can be computed ahead of time to reduce memory usage and we
15865         also assume that lookups are cheap as most classes will not
15866         implement too many interfaces.
15867
15868         We also avoid creating too many MethodSignatures.
15869
15870         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15871         clear the "pending" bit if we find that there are problems with
15872         the declaration.
15873
15874         (TypeContainer.VerifyPendingMethods): Update to report errors of
15875         methods that look like implementations but are not.
15876
15877         (TypeContainer.Define): Add support for explicit interface method
15878         implementation. 
15879
15880 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * typemanager.cs: Keep track of the parameters here instead of
15883         being a feature of the TypeContainer.
15884
15885         * class.cs: Drop the registration of parameters here, as
15886         InterfaceMethods are also interface declarations.
15887
15888         * delegate.cs: Register methods with the TypeManager not only with
15889         the TypeContainer.  This code was buggy.
15890
15891         * interface.cs: Full registation here.
15892
15893 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * expression.cs: Remove reducer for binary expressions, it can not
15896         be done this way.
15897
15898         * const.cs: Put here the code that used to go into constant.cs
15899
15900         * constant.cs: Put here the code for constants, this is a new base
15901         class for Literals.
15902
15903         * literal.cs: Make Literal derive from Constant.
15904
15905 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * statement.cs (Return.Emit): Report error 157 if the user
15908         attempts to return from a finally block.
15909
15910         (Return.Emit): Instead of emitting a return, jump to the end of
15911         the function.
15912
15913         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15914         LocalBuilder to store the result of the function.  ReturnLabel is
15915         the target where we jump.
15916
15917
15918 2001-12-09  Radek Doulik  <rodo@ximian.com>
15919
15920         * cs-parser.jay: remember alias in current namespace
15921
15922         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15923         namespaces
15924
15925         * class.cs (LookupAlias): lookup alias in my_namespace
15926
15927         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15928         aliases hashtable
15929         (LookupAlias): lookup alias in this and if needed in parent
15930         namespaces
15931
15932 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * support.cs: 
15935
15936         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15937         making things static.  I need this to avoid passing the
15938         TypeContainer when calling ParameterType.
15939
15940         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15941         that did string manipulation to compute the type and then call
15942         GetType.  Use Parameter.ParameterType instead.
15943
15944         * cs-tokenizer.cs: Consume the suffix for floating values.
15945
15946         * expression.cs (ParameterReference): figure out whether this is a
15947         reference parameter or not.  Kill an extra variable by computing
15948         the arg_idx during emission.
15949
15950         * parameter.cs (Parameters.GetParameterInfo): New overloaded
15951         function that returns whether a parameter is an out/ref value or not.
15952
15953         (Parameter.ParameterType): The type of the parameter (base,
15954         without ref/out applied).
15955
15956         (Parameter.Resolve): Perform resolution here.
15957         (Parameter.ExternalType): The full type (with ref/out applied).
15958
15959         * statement.cs (Using.Emit, Using.EmitExpression): Implement
15960         support for expressions on the using statement.
15961
15962 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
15963
15964         * statement.cs (Using.EmitLocalVariableDecls): Split the
15965         localvariable handling of the using statement.
15966
15967         (Block.EmitMeta): Keep track of variable count across blocks.  We
15968         were reusing slots on separate branches of blocks.
15969
15970         (Try.Emit): Emit the general code block, we were not emitting it. 
15971
15972         Check the type of the declaration to be an IDisposable or
15973         something that can be implicity converted to it. 
15974
15975         Emit conversions if required.
15976
15977         * ecore.cs (EmptyExpression): New utility class.
15978         (Expression.ImplicitConversionExists): New utility function.
15979
15980 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
15981
15982         * statement.cs (Using): Implement.
15983
15984         * expression.cs (LocalVariableReference): Support read only variables.
15985
15986         * statement.cs: Remove the explicit emit for the Leave opcode.
15987         (VariableInfo): Add a readonly field.
15988
15989 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * ecore.cs (ConvCast): new class used to encapsulate the various
15992         explicit integer conversions that works in both checked and
15993         unchecked contexts.
15994
15995         (Expression.ConvertNumericExplicit): Use new ConvCast class to
15996         properly generate the overflow opcodes.
15997
15998 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15999
16000         * statement.cs: The correct type for the EmptyExpression is the
16001         element_type, not the variable type.  Ravi pointed this out.
16002
16003 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16004
16005         * class.cs (Method::Define): Handle PInvoke methods specially
16006         by using DefinePInvokeMethod instead of the usual one.
16007
16008         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16009         above to do the task of extracting information and defining the method.
16010
16011 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16012
16013         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16014         of the condition for string type.
16015
16016         (Emit): Move that here. 
16017
16018         (ArrayCreation::CheckIndices): Keep string literals in their expression
16019         form.
16020
16021         (EmitDynamicInitializers): Handle strings appropriately.
16022
16023 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16024
16025         * codegen.cs (EmitContext): Replace multiple variables with a
16026         single pointer to the current Switch statement.
16027
16028         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16029         EmitContext.
16030
16031 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16032
16033         * statement.cs 
16034
16035         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16036         default'.
16037
16038         (Foreach.Emit): Foreach on arrays was not setting
16039         up the loop variables (for break/continue).
16040
16041         (GotoCase): Semi-implented.
16042
16043 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16044
16045         * attribute.cs (CheckAttribute): Handle system attributes by using
16046         Attribute.GetAttributes to examine information we need.
16047
16048         (GetValidPlaces): Same here.
16049
16050         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16051
16052         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16053
16054         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16055
16056         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16057
16058         (Method::Emit): Handle the case when we are a PInvoke method.
16059
16060 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * expression.cs: Use ResolveWithSimpleName on compound names.
16063
16064 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16065
16066         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16067         before trying to reduce it.
16068
16069         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16070
16071         * constant.cs (LookupConstantValue): Implement.
16072
16073         (EmitConstant): Use the above in emitting the constant.
16074
16075         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16076         that are user-defined by doing a LookupConstantValue on them.
16077
16078         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16079         too, like above.
16080
16081 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16082
16083         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16084
16085         (BaseAccess.DoResolve): Implement.
16086
16087         (MemberAccess.DoResolve): Split this routine into a
16088         ResolveMemberAccess routine that can be used independently
16089
16090 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16091
16092         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16093         As that share bits of the implementation.  Is returns a boolean,
16094         while As returns the Type that is being probed.
16095
16096 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16097
16098         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16099         instead of a Literal - much easier.
16100
16101         (EnumInTransit): Remove - utterly useless :-)
16102
16103         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16104
16105         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16106
16107         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16108         chain when we have no associated expression.
16109
16110 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16111
16112         * constant.cs (Define): Use Location while reporting the errror.
16113
16114         Also emit a warning when 'new' is used and there is no inherited
16115         member to hide.
16116
16117         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16118         populated.
16119
16120         (LookupEnumValue): Implement to lookup an enum member's value and define it
16121         if necessary.
16122
16123         (Populate): Re-write accordingly to use the above routine.
16124
16125 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16126
16127         * expression.cs (This): Fix prototype for DoResolveLValue to
16128         override the base class DoResolveLValue.
16129
16130         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16131         declarations) 
16132
16133         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16134         (we need to load the address of the field here).  This fixes
16135         test-22. 
16136
16137         (FieldExpr.DoResolveLValue): Call the DoResolve
16138         function to initialize the Instance expression.
16139
16140         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16141         correctly the GetEnumerator operation on a value type.
16142
16143         * cs-parser.jay: Add more simple parsing error catches.
16144
16145         * statement.cs (Switch): Add support for string switches.
16146         Handle null specially.
16147
16148         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16149
16150 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16151
16152         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16153
16154         (declare_local_constant): New helper function.
16155
16156         * statement.cs (AddConstant): Keep a separate record of constants
16157
16158         (IsConstant): Implement to determine if a variable is a constant.
16159
16160         (GetConstantExpression): Implement.
16161
16162         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16163
16164         * statement.cs (IsVariableDefined): Re-write.
16165
16166 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16167
16168         * class.cs (TypeContainer::FindMembers): Look for constants
16169         in the case when we are looking for MemberTypes.Field
16170
16171         * expression.cs (MemberAccess::DoResolve): Check that in the
16172         case we are a FieldExpr and a Literal, we are not being accessed
16173         by an instance reference.
16174
16175         * cs-parser.jay (local_constant_declaration): Implement.
16176
16177         (declaration_statement): Implement for constant declarations.
16178
16179 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16180
16181         * statement.cs (Switch): Catch double defaults.
16182
16183         (Switch): More work on the switch() statement
16184         implementation.  It works for integral values now, need to finish
16185         string support.
16186
16187
16188 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16189
16190         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16191         integer literals into other integer literals.  To be used by
16192         switch. 
16193
16194 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16195
16196         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16197         some memory.
16198
16199         (EmitDynamicInitializers): Cope with the above since we extract data
16200         directly from ArrayData now.
16201
16202         (ExpectInitializers): Keep track of whether initializers are mandatory
16203         or not.
16204
16205         (Bounds): Make it a hashtable to prevent the same dimension being 
16206         recorded for every element in that dimension.
16207
16208         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16209         from being found.
16210
16211         Also fix bug which was causing the indices to be emitted in the reverse
16212         order.
16213
16214 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16215
16216         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16217         unfinished.  They do not work, because the underlying code is
16218         sloppy.
16219
16220 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16221
16222         * cs-parser.jay: Remove bogus fixme.
16223
16224         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16225         on Switch statement.
16226
16227 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16228
16229         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16230         the same. 
16231
16232         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16233         parameter. Apparently, any expression is allowed. 
16234
16235         (ValidateInitializers): Update accordingly.
16236
16237         (CheckIndices): Fix some tricky bugs thanks to recursion.
16238
16239         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16240         I was being completely brain-dead.
16241
16242         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16243         and re-write acordingly.
16244
16245         (DelegateInvocation): Re-write accordingly.
16246
16247         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16248
16249         (MakeByteBlob): Handle types more correctly.
16250
16251         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16252         initialization from expressions but it is incomplete because I am a complete
16253         Dodo :-|
16254
16255 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16256
16257         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16258         on If.  Basically, we have to return `true' (ie, we do return to
16259         our caller) only if both branches of the if return.
16260
16261         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16262         short-circuit operators, handle them as short circuit operators. 
16263
16264         (Cast.DoResolve): Resolve type.
16265         (Cast.Cast): Take an expression as the target type.
16266
16267         * cs-parser.jay (cast_expression): Remove old hack that only
16268         allowed a limited set of types to be handled.  Now we take a
16269         unary_expression and we resolve to a type during semantic
16270         analysis.
16271
16272         Use the grammar productions from Rhys to handle casts (this is
16273         not complete like Rhys syntax yet, we fail to handle that corner
16274         case that C# has regarding (-x), but we will get there.
16275
16276 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16277
16278         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16279         field which is an array type.
16280
16281         * cs-parser.jay (declare_local_variables): Support array initialization too.
16282
16283         * typemanager.cs (MakeKey): Implement.
16284
16285         (everywhere): Use the above appropriately.
16286
16287         * cs-parser.jay (for_statement): Update for array initialization while
16288         declaring variables.
16289
16290         * ecore.cs : The error message was correct, it's the variable's names that
16291         were misleading ;-) Make the code more readable.
16292
16293         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16294         the correct type etc.
16295
16296         (ConvertExplicit): Handle Enum types by examining the underlying type.
16297
16298 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16299
16300         * parameter.cs (GetCallingConvention): Always return
16301         CallingConventions.Standard for now.
16302
16303 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16304
16305         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16306         and `r' after calling DoNumericPromotions.
16307
16308         * ecore.cs: Fix error message (the types were in the wrong order).
16309
16310         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16311         BindingFlags.Instance as well 
16312
16313         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16314         implicit int literal conversion in an empty cast so that we
16315         propagate the right type upstream.
16316
16317         (UnboxCast): new class used to unbox value types.
16318         (Expression.ConvertExplicit): Add explicit type conversions done
16319         by unboxing.
16320
16321         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16322         the target type before applying the implicit LongLiterals to ULong
16323         literal cast.
16324
16325 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * cs-parser.jay (for_statement): Reworked the way For works: now
16328         we declare manually any variables that are introduced in
16329         for_initializer to solve the problem of having out-of-band code
16330         emition (that is what got for broken).
16331
16332         (declaration_statement): Perform the actual variable declaration
16333         that used to be done in local_variable_declaration here.
16334
16335         (local_variable_declaration): Do not declare anything, just pass
16336         the information on a DictionaryEntry
16337
16338 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16339
16340         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16341         re-write of the logic to now make it recursive.
16342
16343         (UpdateIndices): Re-write accordingly.
16344
16345         Store element data in a separate ArrayData list in the above methods.
16346
16347         (MakeByteBlob): Implement to dump the array data into a byte array.
16348
16349 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16350
16351         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16352         into CheckIndices.
16353
16354         * constant.cs (Define): Implement.
16355
16356         (EmitConstant): Re-write fully.
16357
16358         Pass in location info.
16359
16360         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16361         respectively.
16362
16363         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16364         DictionaryEntry since we need location info too.
16365
16366         (constant_declaration): Update accordingly.
16367
16368         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16369         code into another method : UpdateIndices.
16370
16371 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16372
16373         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16374         some type checking etc.
16375
16376 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16377
16378         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16379         bits to provide dimension info if the user skips doing that.
16380
16381         Update second constructor to store the rank correctly.
16382
16383 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16384
16385         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16386         and try to implement.
16387
16388         * ../errors/cs0150.cs : Add.
16389
16390         * ../errors/cs0178.cs : Add.
16391
16392 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * statement.cs: Implement foreach on multi-dimensional arrays. 
16395
16396         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16397         name of the params argument.
16398
16399         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16400         initializing the array.
16401
16402         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16403         we can use this elsewhere.
16404
16405         * statement.cs: Finish implementation of foreach for single
16406         dimension arrays.
16407
16408         * cs-parser.jay: Use an out-of-band stack to pass information
16409         around, I wonder why I need this.
16410
16411         foreach_block: Make the new foreach_block the current_block.
16412
16413         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16414         function used to return a static Parameters structure.  Used for
16415         empty parameters, as those are created very frequently.
16416
16417         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16418
16419 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16420
16421         * interface.cs : Default modifier is private, not public. The
16422         make verify test passes again.
16423
16424 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16425
16426         * support.cs (ReflectionParameters): Fix logic to determine
16427         whether the last parameter is a params one. Test 9 passes again.
16428
16429         * delegate.cs (Populate): Register the builders we define with
16430         RegisterParameterForBuilder. Test 19 passes again.
16431
16432         * cs-parser.jay (property_declaration): Reference $6 instead
16433         of $$ to get at the location.
16434
16435         (indexer_declaration): Similar stuff.
16436
16437         (attribute): Ditto.
16438
16439         * class.cs (Property): Register parameters for the Get and Set methods
16440         if they exist. Test 23 passes again.
16441
16442         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16443         call to EmitArguments as we are sure there aren't any params arguments. 
16444         Test 32 passes again.
16445
16446         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16447         IndexOutOfRangeException. 
16448
16449         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16450         Test 33 now passes again.
16451
16452 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16453
16454         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16455         broke a bunch of things.  Will have to come up with a better way
16456         of tracking locations.
16457
16458         * statement.cs: Implemented foreach for single dimension arrays.
16459
16460 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16461
16462         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16463         an error.  This removes the lookup from the critical path.
16464
16465         * cs-parser.jay: Removed use of temporary_loc, which is completely
16466         broken. 
16467
16468 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16469
16470         * support.cs (ReflectionParameters.ParameterModifier): Report
16471         whether the argument is a PARAMS argument or not.
16472
16473         * class.cs: Set the attribute `ParamArrayAttribute' on the
16474         parameter argument.
16475
16476         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16477         and cons_param_array_attribute (ConstructorInfo for
16478         ParamArrayAttribute)., 
16479
16480         * codegen.cs: Emit the return using the `Return' statement, that
16481         way we can report the error correctly for missing return values. 
16482
16483         * class.cs (Method.Emit): Clean up.
16484
16485         * expression.cs (Argument.Resolve): Take another argument: the
16486         location where this argument is used.  Notice that this is not
16487         part of the "Argument" class as to reduce the size of the
16488         structure (we know the approximate location anyways).
16489
16490         Test if the argument is a variable-reference, if not, then
16491         complain with a 206.
16492
16493         (Argument.Emit): Emit addresses of variables.
16494
16495         (Argument.FullDesc): Simplify.
16496
16497         (Invocation.DoResolve): Update for Argument.Resolve.
16498
16499         (ElementAccess.DoResolve): ditto.
16500
16501         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16502         method should be virtual, as this method is always virtual.
16503
16504         (NewDelegate.DoResolve): Update for Argument.Resolve.
16505
16506         * class.cs (ConstructorInitializer.DoResolve): ditto.
16507
16508         * attribute.cs (Attribute.Resolve): ditto.
16509
16510 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16513
16514         * expression.cs (ParameterReference): Drop IStackStorage and implement
16515         IAssignMethod instead. 
16516
16517         (LocalVariableReference): ditto.
16518
16519         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16520         IAssignMethod instead. 
16521
16522 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16523
16524         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16525         enumerations that are used in heavily used structures derive from
16526         byte in a laughable and pathetic attempt to reduce memory usage.
16527         This is the kind of pre-optimzations that you should not do at
16528         home without adult supervision.
16529
16530         * expression.cs (UnaryMutator): New class, used to handle ++ and
16531         -- separatedly from the other unary operators.  Cleans up the
16532         code, and kills the ExpressionStatement dependency in Unary.
16533
16534         (Unary): Removed `method' and `Arguments' from this class, making
16535         it smaller, and moving it all to SimpleCall, so I can reuse this
16536         code in other locations and avoid creating a lot of transient data
16537         strucutres when not required.
16538
16539         * cs-parser.jay: Adjust for new changes.
16540
16541 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16542
16543         * enum.cs (Enum.Populate): If there is a failure during
16544         definition, return
16545
16546         * cs-parser.jay (opt_enum_base): we used to catch type errors
16547         here, but this is really incorrect.  The type error should be
16548         catched during semantic analysis.
16549
16550 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16551
16552         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16553         current_local_parameters as expected since I, in my stupidity, had forgotten
16554         to do this :-)
16555
16556         * attribute.cs (GetValidPlaces): Fix stupid bug.
16557
16558         * class.cs (Method::Emit): Perform check on applicability of attributes.
16559
16560         (Constructor::Emit): Ditto.
16561
16562         (Field::Emit): Ditto.
16563
16564         (Field.Location): Store location information.
16565
16566         (Property, Event, Indexer, Operator): Ditto.
16567
16568         * cs-parser.jay (field_declaration): Pass in location for each field.
16569
16570         * ../errors/cs0592.cs : Add.
16571
16572 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16573
16574         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16575
16576         (InitCoreTypes): Update accordingly.
16577
16578         (RegisterAttrType, LookupAttr): Implement.
16579
16580         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16581         info about the same.
16582
16583         (Resolve): Update to populate the above as necessary.
16584
16585         (Error592): Helper.
16586
16587         (GetValidPlaces): Helper to the above.
16588
16589         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16590
16591         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16592
16593 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16594
16595         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16596
16597         * ../errors/cs0617.cs : Add.
16598
16599 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16600
16601         * enum.cs (Emit): Rename to Populate to be more consistent with what
16602         we expect it to do and when exactly it is called.
16603
16604         * class.cs, rootcontext.cs : Update accordingly.
16605
16606         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16607         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16608
16609         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16610
16611         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16612         of a fieldinfo using the above, when dealing with a FieldBuilder.
16613
16614 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16615
16616         * ../errors/cs0031.cs : Add.
16617
16618         * ../errors/cs1008.cs : Add.
16619
16620         * ../errrors/cs0543.cs : Add.
16621
16622         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16623         enum type.
16624
16625         (FindMembers): Implement.
16626
16627         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16628         enums and delegates too.
16629
16630         (enum_types): Rename to builder_to_enum.
16631
16632         (delegate_types): Rename to builder_to_delegate.
16633
16634         * delegate.cs (FindMembers): Implement.
16635
16636 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16637
16638         * typemanager.cs (IsEnumType): Implement.
16639
16640         * enum.cs (Emit): Re-write parts to account for the underlying type
16641         better and perform checking etc.
16642
16643         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16644         of the underlying type.
16645
16646         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16647         value
16648
16649         * enum.cs (error31): Helper to report error #31.
16650
16651         * cs-parser.jay (enum_declaration): Store location of each member too.
16652
16653         * enum.cs (member_to_location): New hashtable. 
16654
16655         (AddEnumMember): Update location hashtable.
16656
16657         (Emit): Use the location of each member while reporting errors.
16658
16659 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * cs-parser.jay: A for_initializer if is a
16662         local_variable_declaration really ammount to have an implicit
16663         block with the variable declaration and no initializer for for.
16664
16665         * statement.cs (For.Emit): Cope with null initializers.
16666
16667         This fixes the infinite loop on for initializers.
16668
16669 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16670
16671         * enum.cs: More cleanup.
16672
16673         * ecore.cs: Remove dead code.
16674
16675         * class.cs (Property.Emit): More simplification.
16676         (Event.Emit): ditto.
16677
16678         Reworked to have less levels of indentation.
16679
16680 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16681
16682         * class.cs (Property): Emit attributes.
16683
16684         (Field): Ditto.
16685
16686         (Event): Ditto.
16687
16688         (Indexer): Ditto.
16689
16690         (Operator): Ditto.
16691
16692         * enum.cs (Emit): Ditto.
16693
16694         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16695         Enums too.
16696
16697         * class.cs (Field, Event, etc.): Move attribute generation into the
16698         Emit method everywhere.
16699
16700         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16701         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16702         as we had no way of defining nested enums !
16703
16704         * rootcontext.cs : Adjust code accordingly.
16705
16706         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16707
16708 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16709
16710         * expression.cs (EvalConstantExpression): Move into ecore.cs
16711
16712         * enum.cs (Enum): Rename some members and make them public and readonly
16713         according to our convention.
16714
16715         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16716         nothing else.
16717
16718         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16719
16720         (Enum::Emit): Write a simple version for now which doesn't try to compute
16721         expressions. I shall modify this to be more robust in just a while.
16722
16723         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16724
16725         (TypeContainer::CloseType): Create the Enum types too.
16726
16727         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16728
16729         * expression.cs (EvalConstantExpression): Get rid of completely.
16730
16731         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16732         user-defined values and other cases.
16733
16734         (IsValidEnumLiteral): Helper function.
16735
16736         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16737         out there in the case we had a literal FieldExpr.
16738
16739         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16740
16741         (Literalize): Revamp a bit to take two arguments.
16742
16743         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16744
16745 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16746
16747         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16748
16749         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16750
16751         (Resolve): Use the above to ensure we have proper initializers.
16752
16753 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16754
16755         * expression.cs (Expression::EvalConstantExpression): New method to 
16756         evaluate constant expressions.
16757
16758         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16759
16760 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16763         in an array.
16764
16765         (Binary.ResolveOperator): Handle operator != (object a, object b)
16766         and operator == (object a, object b);
16767
16768         (Binary.DoNumericPromotions): Indicate whether the numeric
16769         promotion was possible.
16770
16771         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16772         Implement.  
16773
16774         Made the ArrayAccess implement interface IAssignMethod instead of
16775         IStackStore as the order in which arguments are passed reflects
16776         this.
16777
16778         * assign.cs: Instead of using expr.ExprClass to select the way of
16779         assinging, probe for the IStackStore/IAssignMethod interfaces.
16780
16781         * typemanager.cs: Load InitializeArray definition.
16782
16783         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16784         static data that can be used to initialize arrays. 
16785
16786 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * expression.cs: Handle operator== and operator!= for booleans.
16789
16790         (Conditioal.Reduce): Implement reducer for the ?: operator.
16791
16792         (Conditional.Resolve): Implement dead code elimination.
16793
16794         (Binary.Resolve): Catch string literals and return a new
16795         concatenated string.
16796
16797         (Unary.Reduce): Implement reduction of unary expressions.
16798
16799         * ecore.cs: Split out the expression core handling here.
16800
16801         (Expression.Reduce): New method used to perform constant folding
16802         and CSE.  This is needed to support constant-expressions. 
16803
16804         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16805         targets, and optimize for !x.
16806
16807 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16808
16809         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16810         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16811         set custom atttributes.
16812
16813         * literal.cs (Literal::GetValue): New abstract method to return the actual
16814         value of the literal, cast as an object.
16815
16816         (*Literal): Implement GetValue method.
16817
16818         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16819         expressions to the arraylist but objects of type Argument.
16820
16821         * class.cs (TypeContainer::Emit): Emit our attributes too.
16822
16823         (Method::Emit, Constructor::Emit): Ditto.
16824
16825         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16826         to be ignoring earlier.
16827
16828 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16829
16830         * attribute.cs (AttributeSection::Define): Implement to do the business
16831         of constructing a CustomAttributeBuilder.
16832
16833         (Attribute): New trivial class. Increases readability of code.  
16834
16835         * cs-parser.jay : Update accordingly.
16836
16837         (positional_argument_list, named_argument_list, named_argument): New rules
16838
16839         (attribute_arguments): Use the above so that we are more correct.
16840
16841 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16842
16843         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16844         to perform all checks for a method with a params parameter.
16845
16846         (Invocation::OverloadResolve): Update to use the above method and therefore
16847         cope correctly with params method invocations.
16848
16849         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16850         params too.
16851
16852         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16853         constructors in our parent too because we can't afford to miss out on 
16854         protected ones ;-)
16855
16856         * attribute.cs (AttributeSection): New name for the class Attribute
16857
16858         Other trivial changes to improve readability.
16859
16860         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16861         use the new class names.
16862
16863 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16864
16865         * class.cs (Method::Define): Complete definition for params types too
16866
16867         (Indexer::Define): Ditto.
16868
16869         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16870         Cope everywhere with a request for info about the array parameter.
16871
16872 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16873
16874         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16875
16876         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16877         local_variable_type to extract the string corresponding to the type.
16878
16879         (local_variable_type): Fixup the action to use the new helper method.
16880
16881         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16882         go.
16883
16884         * expression.cs : Clean out code which uses the above.
16885
16886 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16887
16888         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16889         and bale out if necessary by returning a false.
16890
16891         (RegisterProperty): Ditto.
16892
16893         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16894         and print out appropriate error messages.
16895
16896         * interface.cs (everywhere): Ditto.
16897
16898         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16899         location to constructor.
16900
16901         * class.cs (Property, Event, Indexer): Update accordingly.
16902
16903         * ../errors/cs111.cs : Added.
16904
16905         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16906         of a method, as laid down by the spec.
16907
16908         (Invocation::OverloadResolve): Use the above method.
16909
16910 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16911
16912         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16913         now take a TypeContainer and a Parameters object.
16914
16915         (ParameterData): Modify return type of ParameterModifier method to be 
16916         Parameter.Modifier and not a string.
16917
16918         (ReflectionParameters, InternalParameters): Update accordingly.
16919
16920         * expression.cs (Argument::GetParameterModifier): Same here.
16921
16922         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16923         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16924         symbol in it at all so maybe this is only for now.
16925
16926 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16927
16928         * support.cs (InternalParameters): Constructor now takes an extra argument 
16929         which is the actual Parameters class.
16930
16931         (ParameterDesc): Update to provide info on ref/out modifiers.
16932
16933         * class.cs (everywhere): Update call to InternalParameters to pass in
16934         the second argument too.
16935
16936         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16937         to return the modifier info [ref/out etc]
16938
16939         (InternalParameters, ReflectionParameters): Implement the above.
16940
16941         * expression.cs (Argument::ParameterModifier): Similar function to return
16942         info about the argument's modifiers.
16943
16944         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16945         too.
16946
16947         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16948         a new SetFormalParameters object which we pass to InternalParameters.
16949
16950 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16951
16952         * expression.cs (NewArray): Merge into the ArrayCreation class.
16953
16954 2001-10-29  Ravi Pratap  <ravi@ximian.com>
16955
16956         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
16957         NewUserdefinedArray into one as there wasn't much of a use in having
16958         two separate ones.
16959
16960         * expression.cs (Argument): Change field's name to ArgType from Type.
16961
16962         (Type): New readonly property which returns the proper type, taking into 
16963         account ref/out modifiers.
16964
16965         (everywhere): Adjust code accordingly for the above.
16966
16967         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16968         whether we are emitting for a ref or out parameter.
16969
16970         * expression.cs (Argument::Emit): Use the above field to set the state.
16971
16972         (LocalVariableReference::Emit): Update to honour the flag and emit the
16973         right stuff.
16974
16975         * parameter.cs (Attributes): Set the correct flags for ref parameters.
16976
16977         * expression.cs (Argument::FullDesc): New function to provide a full desc.
16978
16979         * support.cs (ParameterData): Add method ParameterDesc to the interface.
16980
16981         (ReflectionParameters, InternalParameters): Implement the above method.
16982
16983         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
16984         reporting errors.
16985
16986         (Invocation::FullMethodDesc): Ditto. 
16987
16988 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
16989
16990         * cs-parser.jay: Add extra production for the second form of array
16991         creation. 
16992
16993         * expression.cs (ArrayCreation): Update to reflect the above
16994         change. 
16995
16996         * Small changes to prepare for Array initialization.
16997
16998 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
16999
17000         * typemanager.cs (ImplementsInterface): interface might be null;
17001         Deal with this problem;
17002
17003         Also, we do store negative hits on the cache (null values), so use
17004         this instead of calling t.GetInterfaces on the type everytime.
17005
17006 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17007
17008         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17009
17010         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17011         split functionality out into different classes.
17012
17013         (New::FormArrayType): Move into NewBuiltinArray.
17014
17015         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17016         quite useless.
17017
17018         (NewBuiltinArray): New class to handle creation of built-in arrays.
17019
17020         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17021         account creation of one-dimensional arrays.
17022
17023         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17024
17025         (NewUserdefinedArray::DoResolve): Implement.
17026
17027         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17028
17029         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17030         we maintain inside the TypeManager. This is necessary to perform lookups on the
17031         module builder.
17032
17033         (LookupType): Update to perform GetType on the module builders too.     
17034
17035         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17036
17037         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17038
17039 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17040
17041         * expression.cs (New::DoResolve): Implement guts of array creation.
17042
17043         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17044
17045 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17046
17047         * expression.cs: Fix bug I introduced lsat night that broke
17048         Delegates. 
17049
17050         (Expression.Resolve): Report a 246 error (can not resolve name)
17051         if we find a SimpleName in the stream.
17052
17053         (Expression.ResolveLValue): Ditto.
17054
17055         (Expression.ResolveWithSimpleName): This function is a variant of
17056         ResolveName, this one allows SimpleNames to be returned without a
17057         warning.  The only consumer of SimpleNames is MemberAccess
17058
17059 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17060
17061         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17062         might arrive here.  I have my doubts that this is correct.
17063
17064         * statement.cs (Lock): Implement lock statement.
17065
17066         * cs-parser.jay: Small fixes to support `lock' and `using'
17067
17068         * cs-tokenizer.cs: Remove extra space
17069
17070         * driver.cs: New flag --checked, allows to turn on integer math
17071         checking. 
17072
17073         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17074         Threading.Monitor.Exit 
17075
17076 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17079         Expression Class to be IndexerAccess.
17080
17081         Notice that Indexer::DoResolve sets the eclass to Value.
17082
17083 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * class.cs (TypeContainer::Emit): Emit code for indexers.
17086
17087         * assign.cs (IAssignMethod): New interface implemented by Indexers
17088         and Properties for handling assignment.
17089
17090         (Assign::Emit): Simplify and reuse code. 
17091
17092         * expression.cs (IndexerAccess, PropertyExpr): Implement
17093         IAssignMethod, clean up old code. 
17094
17095 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17096
17097         * typemanager.cs (ImplementsInterface): New method to determine if a type
17098         implements a given interface. Provides a nice cache too.
17099
17100         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17101         method.
17102
17103         (ConvertReferenceExplicit): Ditto.
17104
17105         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17106         various methods, with correct names etc.
17107
17108         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17109         Operator.UnaryNegation.
17110
17111         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17112         we have a unary plus or minus operator.
17113
17114         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17115         UnaryMinus.
17116
17117         * everywhere : update accordingly.
17118
17119         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17120         respectively.
17121
17122         * class.cs (Method::Define): For the case where we are implementing a method
17123         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17124         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17125
17126 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17127
17128         * interface.cs (FindMembers): Implement to work around S.R.E
17129         lameness.
17130
17131         * typemanager.cs (IsInterfaceType): Implement.
17132
17133         (FindMembers): Update to handle interface types too.
17134
17135         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17136         use IsAssignableFrom as that is not correct - it doesn't work.
17137
17138         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17139         and accordingly override EmitStatement.
17140
17141         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17142         using the correct logic :-)
17143
17144 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17145
17146         * ../errors/cs-11.cs : Add to demonstrate error -11 
17147
17148 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17151         then pass this as a hint to ResolveLValue.
17152
17153         * expression.cs (FieldExpr): Add Location information
17154
17155         (FieldExpr::LValueResolve): Report assignment to readonly
17156         variable. 
17157
17158         (Expression::ExprClassFromMemberInfo): Pass location information.
17159
17160         (Expression::ResolveLValue): Add new method that resolves an
17161         LValue. 
17162
17163         (Expression::DoResolveLValue): Default invocation calls
17164         DoResolve. 
17165
17166         (Indexers): New class used to keep track of indexers in a given
17167         Type. 
17168
17169         (IStackStore): Renamed from LValue, as it did not really describe
17170         what this did.  Also ResolveLValue is gone from this interface and
17171         now is part of Expression.
17172
17173         (ElementAccess): Depending on the element access type
17174
17175         * typemanager.cs: Add `indexer_name_type' as a Core type
17176         (System.Runtime.CompilerServices.IndexerNameAttribute)
17177
17178         * statement.cs (Goto): Take a location.
17179
17180 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17181
17182         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17183         if two delegates are compatible.
17184
17185         (NewDelegate::DoResolve): Update to take care of the case when
17186         we instantiate a delegate from another delegate.
17187
17188         * typemanager.cs (FindMembers): Don't even try to look up members
17189         of Delegate types for now.
17190
17191 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17192
17193         * delegate.cs (NewDelegate): New class to take care of delegate
17194         instantiation.
17195
17196         * expression.cs (New): Split the delegate related code out into 
17197         the NewDelegate class.
17198
17199         * delegate.cs (DelegateInvocation): New class to handle delegate 
17200         invocation.
17201
17202         * expression.cs (Invocation): Split out delegate related code into
17203         the DelegateInvocation class.
17204
17205 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17206
17207         * expression.cs (New::DoResolve): Implement delegate creation fully
17208         and according to the spec.
17209
17210         (New::DoEmit): Update to handle delegates differently.
17211
17212         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17213         because of which we were printing out arguments in reverse order !
17214
17215         * delegate.cs (VerifyMethod): Implement to check if the given method
17216         matches the delegate.
17217
17218         (FullDelegateDesc): Implement.
17219
17220         (VerifyApplicability): Implement.
17221
17222         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17223         delegate invocations too.
17224
17225         (Invocation::Emit): Ditto.
17226
17227         * ../errors/cs1593.cs : Added.
17228
17229         * ../errors/cs1594.cs : Added.
17230
17231         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17232
17233 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17234
17235         * typemanager.cs (intptr_type): Core type for System.IntPtr
17236
17237         (InitCoreTypes): Update for the same.
17238
17239         (iasyncresult_type, asynccallback_type): Ditto.
17240
17241         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17242         correct.
17243
17244         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17245         too.
17246
17247         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17248         the builders for the 4 members of a delegate type :-)
17249
17250         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17251         type.
17252
17253         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17254
17255         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17256
17257 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17258
17259         * statement.cs (Break::Emit): Implement.   
17260         (Continue::Emit): Implement.
17261
17262         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17263         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17264         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17265         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17266         end loop
17267
17268         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17269         properties that track the label for the current loop (begin of the
17270         loop and end of the loop).
17271
17272 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17273
17274         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17275         use of emitting anything at all.
17276
17277         * class.cs, rootcontext.cs : Get rid of calls to the same.
17278
17279         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17280
17281         (Populate): Define the constructor correctly and set the implementation
17282         attributes.
17283
17284         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17285         have been defined.
17286
17287         (AddDelegateType): Implement.
17288
17289         (IsDelegateType): Implement helper method.
17290
17291         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17292
17293         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17294         and accordingly handle it.
17295
17296         * delegate.cs (Populate): Take TypeContainer argument.
17297         Implement bits to define the Invoke method. However, I still haven't figured out
17298         how to take care of the native int bit :-(
17299
17300         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17301         Qualify the name of the delegate, not its return type !
17302
17303         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17304         conversion.
17305
17306         (StandardConversionExists): Checking for array types turns out to be recursive.
17307
17308         (ConvertReferenceExplicit): Implement array conversion.
17309
17310         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17311
17312 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17313
17314         * cs-parser.jay (delegate_declaration): Store the fully qualified
17315         name as it is a type declaration.
17316
17317         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17318         readonly.
17319
17320         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17321         as TypeContainer::DefineType.
17322
17323         (Populate): Method in which all the definition of the various methods (Invoke)
17324         etc is done.
17325
17326         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17327         see.
17328
17329         (CloseDelegate): Finally creates the delegate.
17330
17331         * class.cs (TypeContainer::DefineType): Update to define delegates.
17332         (Populate, Emit and CloseType): Do the same thing here too.
17333
17334         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17335         delegates in all these operations.
17336
17337 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * expression.cs: LocalTemporary: a new expression used to
17340         reference a temporary that has been created.
17341
17342         * assign.cs: Handle PropertyAccess back here, so that we can
17343         provide the proper semantic access to properties.
17344
17345         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17346         a few more explicit conversions. 
17347
17348         * modifiers.cs: `NEW' modifier maps to HideBySig.
17349
17350         * expression.cs (PropertyExpr): Make this into an
17351         ExpressionStatement, and support the EmitStatement code path. 
17352
17353         Perform get/set error checking, clean up the interface.
17354
17355         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17356         them into toplevel access objects.
17357
17358 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17359
17360         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17361         SRE.
17362
17363         * typemanager.cs: Keep track here of our PropertyBuilders again to
17364         work around lameness in SRE.
17365
17366 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17367
17368         * expression.cs (LValue::LValueResolve): New method in the
17369         interface, used to perform a second resolution pass for LValues. 
17370
17371         (This::DoResolve): Catch the use of this in static methods.
17372
17373         (This::LValueResolve): Implement.
17374
17375         (This::Store): Remove warning, assigning to `this' in structures
17376         is 
17377
17378         (Invocation::Emit): Deal with invocation of
17379         methods on value types.  We need to pass the address to structure
17380         methods rather than the object itself.  (The equivalent code to
17381         emit "this" for structures leaves the entire structure on the
17382         stack instead of a pointer to it). 
17383
17384         (ParameterReference::DoResolve): Compute the real index for the
17385         argument based on whether the method takes or not a `this' pointer
17386         (ie, the method is static).
17387
17388         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17389         value types returned from functions when we need to invoke a
17390         method on the sturcture.
17391
17392
17393 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17394
17395         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17396         defining the type in the Modulebuilder or Typebuilder. This is to take
17397         care of nested types which need to be defined on the TypeBuilder using
17398         DefineNestedMethod.
17399
17400         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17401         methods in RootContext, only ported to be part of TypeContainer.
17402
17403         (TypeContainer::GetInterfaceOrClass): Ditto.
17404
17405         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17406
17407         * interface.cs (Interface::DefineInterface): New method. Does exactly
17408         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17409         too.
17410
17411         (Interface::GetInterfaces): Move from RootContext here and port.
17412
17413         (Interface::GetInterfaceByName): Same here.
17414
17415         * rootcontext.cs (ResolveTree): Re-write.
17416
17417         (PopulateTypes): Re-write.
17418
17419         * class.cs (TypeContainer::Populate): Populate nested types too.
17420         (TypeContainer::Emit): Emit nested members too.
17421
17422         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17423         instead just use the name argument passed in as it is already fully
17424         qualified.
17425
17426         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17427         to TypeContainer mapping to see if a type is user-defined.
17428
17429         * class.cs (TypeContainer::CloseType): Implement. 
17430
17431         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17432         the default constructor.
17433
17434         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17435         twice.
17436
17437         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17438
17439         * interface.cs (CloseType): Create the type here.
17440
17441         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17442         the hierarchy.
17443
17444         Remove all the methods which are now in TypeContainer.
17445
17446 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17447
17448         * delegate.cs (Define): Re-write bits to define the delegate
17449         correctly.
17450
17451 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17452
17453         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17454
17455         * expression.cs (ImplicitReferenceConversion): handle null as well
17456         as a source to convert to any reference type.
17457
17458         * statement.cs (Return): Perform any implicit conversions to
17459         expected return type.  
17460
17461         Validate use of return statement.  
17462
17463         * codegen.cs (EmitContext): Pass the expected return type here.
17464
17465         * class.cs (Method, Constructor, Property): Pass expected return
17466         type to EmitContext.
17467
17468 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17469
17470         * expression.cs: Make DoResolve take an EmitContext instead of a
17471         TypeContainer.
17472
17473         Replaced `l' and `location' for `loc', for consistency.
17474
17475         (Error, Warning): Remove unneeded Tc argument.
17476
17477         * assign.cs, literal.cs, constant.cs: Update to new calling
17478         convention. 
17479
17480         * codegen.cs: EmitContext now contains a flag indicating whether
17481         code is being generated in a static method or not.
17482
17483         * cs-parser.jay: DecomposeQI, new function that replaces the old
17484         QualifiedIdentifier.  Now we always decompose the assembled
17485         strings from qualified_identifier productions into a group of
17486         memberaccesses.
17487
17488 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17489
17490         * rootcontext.cs: Deal with field-less struct types correctly now
17491         by passing the size option to Define Type.
17492
17493         * class.cs: Removed hack that created one static field. 
17494
17495 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17496
17497         * statement.cs: Moved most of the code generation here. 
17498
17499 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17500
17501         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17502         seem very right.
17503
17504         (ElementAccess): Remove useless bits for now - keep checks as the spec
17505         says.
17506
17507 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17508
17509         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17510         and start performing checks according to the spec.
17511
17512 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17513
17514         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17515         rank_specifiers instead.
17516
17517         (rank_specifiers): Change the order in which the rank specifiers are stored
17518
17519         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17520
17521         * expression.cs (ElementAccess): Implement the LValue interface too.
17522
17523 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17524
17525         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17526         except that user defined conversions are not included.
17527
17528         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17529         perform the conversion of the return type, if necessary.
17530
17531         (New::DoResolve): Check whether we are creating an array or an object
17532         and accordingly do the needful.
17533
17534         (New::Emit): Same here.
17535
17536         (New::DoResolve): Implement guts of array creation.
17537
17538         (New::FormLookupType): Helper function.
17539
17540 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17541
17542         * codegen.cs: Removed most of the code generation here, and move the
17543         corresponding code generation bits to the statement classes. 
17544
17545         Added support for try/catch/finalize and throw.
17546
17547         * cs-parser.jay: Added support for try/catch/finalize.
17548
17549         * class.cs: Catch static methods having the flags override,
17550         virtual or abstract.
17551
17552         * expression.cs (UserCast): This user cast was not really doing
17553         what it was supposed to do.  Which is to be born in fully resolved
17554         state.  Parts of the resolution were being performed at Emit time! 
17555
17556         Fixed this code.
17557
17558 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * expression.cs: Implicity convert the result from UserCast.
17561
17562 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17563
17564         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17565         prevented it from working correctly. 
17566
17567         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17568         merely ConvertImplicit.
17569
17570 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17571
17572         * typemanager.cs: Make the LookupTypeContainer function static,
17573         and not per-instance.  
17574
17575         * class.cs: Make static FindMembers (the one that takes a Type
17576         argument). 
17577
17578         * codegen.cs: Add EmitForeach here.
17579
17580         * cs-parser.jay: Make foreach a toplevel object instead of the
17581         inline expansion, as we need to perform semantic analysis on it. 
17582
17583 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17584
17585         * expression.cs (Expression::ImplicitUserConversion): Rename to
17586         UserDefinedConversion.
17587
17588         (Expression::UserDefinedConversion): Take an extra argument specifying 
17589         whether we look for explicit user conversions too.
17590
17591         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17592
17593         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17594
17595         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17596         with the appropriate arguments.
17597
17598         * cs-parser.jay (cast_expression): Record location too.
17599
17600         * expression.cs (Cast): Record location info.
17601
17602         (Expression::ConvertExplicit): Take location argument.
17603
17604         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17605         to determine if we are doing explicit conversions.
17606
17607         (UserCast::Emit): Update accordingly.
17608
17609         (Expression::ConvertExplicit): Report an error if everything fails.
17610
17611         * ../errors/cs0030.cs : Add.
17612
17613 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17614
17615         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17616         virtual and newslot bits. 
17617
17618         * class.cs (TypeContainer::RegisterRequiredImplementations):
17619         Record methods we need.
17620
17621         (TypeContainer::MakeKey): Helper function to make keys for
17622         MethodBases, since the Methodbase key is useless.
17623
17624         (TypeContainer::Populate): Call RegisterRequiredImplementations
17625         before defining the methods.   
17626
17627         Create a mapping for method_builders_to_methods ahead of time
17628         instead of inside a tight loop.
17629
17630         (::RequireMethods):  Accept an object as the data to set into the
17631         hashtable so we can report interface vs abstract method mismatch.
17632
17633 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17634
17635         * report.cs: Make all of it static.
17636
17637         * rootcontext.cs: Drop object_type and value_type computations, as
17638         we have those in the TypeManager anyways.
17639
17640         Drop report instance variable too, now it is a global.
17641
17642         * driver.cs: Use try/catch on command line handling.
17643
17644         Add --probe option to debug the error reporting system with a test
17645         suite. 
17646
17647         * report.cs: Add support for exiting program when a probe
17648         condition is reached.
17649
17650 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17651
17652         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17653         we do a forcible conversion regardless of type, to check if 
17654         ForceConversion returns a null.
17655
17656         (Binary::error19): Use location to report error.
17657
17658         (Unary::error23): Use location here too.
17659
17660         * ../errors/cs0019.cs : Check in.
17661
17662         * ../errors/cs0023.cs : Check in.
17663
17664         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17665         case of a non-null MethodInfo object with a length of 0 !
17666
17667         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17668         an applicable member - according to the spec :-)
17669         Also fix logic to find members in base types.
17670
17671         (Unary::ResolveOperator): Same here.
17672
17673         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17674         as I was getting thoroughly confused between this and error19 :-)
17675
17676         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17677         (::FindMostEncompassedType): Implement.
17678         (::FindMostEncompassingType): Implement.
17679         (::StandardConversionExists): Implement.
17680
17681         (UserImplicitCast): Re-vamp. We now need info about most specific
17682         source and target types so that we can do the necessary conversions.
17683
17684         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17685         mathematical union with no duplicates.
17686
17687 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17688
17689         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17690         in order from base classes to child classes, so that we can in
17691         child classes look up in our parent for method names and
17692         attributes (required for handling abstract, virtual, new, override
17693         constructs: we need to instrospect our base class, and if we dont
17694         populate the classes in order, the introspection might be
17695         incorrect.  For example, a method could query its parent before
17696         the parent has any methods and would determine that the parent has
17697         no abstract methods (while it could have had them)).
17698
17699         (RootContext::CreateType): Record the order in which we define the
17700         classes.
17701
17702 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17703
17704         * class.cs (TypeContainer::Populate): Also method definitions can
17705         fail now, keep track of this.
17706
17707         (TypeContainer::FindMembers): Implement support for
17708         DeclaredOnly/noDeclaredOnly flag.
17709
17710         (Constructor::Emit) Return the ConstructorBuilder.
17711
17712         (Method::Emit) Return the MethodBuilder. 
17713         Check for abstract or virtual methods to be public.
17714
17715         * rootcontext.cs (RootContext::CreateType): Register all the
17716         abstract methods required for the class to be complete and the
17717         interface methods that must be implemented. 
17718
17719         * cs-parser.jay: Report error 501 (method requires body if it is
17720         not marked abstract or extern).
17721
17722         * expression.cs (TypeOf::Emit): Implement.
17723
17724         * typemanager.cs: runtime_handle_type, new global type.
17725
17726         * class.cs (Property::Emit): Generate code for properties.
17727
17728 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17729
17730         * expression.cs (Unary::ResolveOperator): Find operators on base type
17731         too - we now conform exactly to the spec.
17732
17733         (Binary::ResolveOperator): Same here.
17734
17735         * class.cs (Operator::Define): Fix minor quirk in the tests.
17736
17737         * ../errors/cs0215.cs : Added.
17738
17739         * ../errors/cs0556.cs : Added.
17740
17741         * ../errors/cs0555.cs : Added.
17742
17743 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17746         single integer which is really efficient
17747
17748 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17749
17750         *  expression.cs (Expression::ImplicitUserConversion): Use location
17751         even in the case when we are examining True operators.
17752  
17753         * class.cs (Operator::Define): Perform extensive checks to conform
17754         with the rules for operator overloading in the spec.
17755
17756         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17757         some of the other conversions mentioned in the spec.
17758
17759         * typemanager.cs (array_type): New static member for the System.Array built-in
17760         type.
17761
17762         (cloneable_interface): For System.ICloneable interface.
17763
17764         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17765         we start resolving the tree and populating types.
17766
17767         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17768  
17769 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * expression.cs (Expression::ExprClassFromMemberInfo,
17772         Expression::Literalize): Create literal expressions from
17773         FieldInfos which are literals.
17774
17775         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17776         type casts, because they were wrong.  The test suite in tests
17777         caught these ones.
17778
17779         (ImplicitNumericConversion): ushort to ulong requires a widening
17780         cast. 
17781
17782         Int32 constant to long requires widening cast as well.
17783
17784         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17785         for integers because the type on the stack is not i4.
17786
17787 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17788
17789         * expression.cs (report118): require location argument. 
17790
17791         * parameter.cs: Do not dereference potential null value.
17792
17793         * class.cs: Catch methods that lack the `new' keyword when
17794         overriding a name.  Report warnings when `new' is used without
17795         anything being there to override.
17796
17797         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17798
17799         * class.cs: Only add constructor to hashtable if it is non-null
17800         (as now constructors can fail on define).
17801
17802         (TypeManager, Class, Struct): Take location arguments.
17803
17804         Catch field instance initialization in structs as errors.
17805
17806         accepting_filter: a new filter for FindMembers that is static so
17807         that we dont create an instance per invocation.
17808
17809         (Constructor::Define): Catch errors where a struct constructor is
17810         parameterless 
17811
17812         * cs-parser.jay: Pass location information for various new
17813         constructs. 
17814
17815         * delegate.cs (Delegate): take a location argument.
17816
17817         * driver.cs: Do not call EmitCode if there were problesm in the
17818         Definition of the types, as many Builders wont be there. 
17819
17820         * decl.cs (Decl::Decl): Require a location argument.
17821
17822         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17823         into integers, and find the most appropiate integer for it.
17824
17825         * literal.cs: Implement ULongLiteral.
17826
17827         * rootcontext.cs: Provide better information about the location of
17828         failure when CreateType fails.
17829
17830 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17831
17832         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17833         as well.
17834
17835         * expression.cs (Binary::CheckShiftArguments): Add missing type
17836         computation.
17837         (Binary::ResolveOperator): Add type to the logical and and logical
17838         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17839         before.
17840
17841         (Binary::DoNumericPromotions): In the case where either argument
17842         is ulong (and most signed types combined with ulong cause an
17843         error) perform implicit integer constant conversions as well.
17844
17845 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17846
17847         * expression.cs (UserImplicitCast): Method should always be
17848         non-null. 
17849         (Invocation::BetterConversion): Simplified test for IntLiteral.
17850
17851         (Expression::ImplicitNumericConversion): Split this routine out.
17852         Put the code that performs implicit constant integer conversions
17853         here. 
17854
17855         (Expression::Resolve): Become a wrapper around DoResolve so we can
17856         check eclass and type being set after resolve.
17857
17858         (Invocation::Badness): Remove this dead function
17859
17860         (Binary::ResolveOperator): Do not compute the expensive argumnets
17861         unless we have a union for it.
17862
17863         (Probe::Emit): Is needs to do an isinst and then
17864         compare against null.
17865
17866         (::CanConvert): Added Location argument.  If the Location argument
17867         is null (Location.Null), then we do not report errors.  This is
17868         used by the `probe' mechanism of the Explicit conversion.  We do
17869         not want to generate an error for something that the user
17870         explicitly requested to be casted.  But the pipeline for an
17871         explicit cast first tests for potential implicit casts.
17872
17873         So for now, if the Location is null, it means `Probe only' to
17874         avoid adding another argument.   Might have to revise this
17875         strategy later.
17876
17877         (ClassCast): New class used to type cast objects into arbitrary
17878         classes (used in Explicit Reference Conversions).
17879
17880         Implement `as' as well.
17881
17882         Reverted all the patches from Ravi below: they were broken:
17883
17884                 * The use of `level' as a mechanism to stop recursive
17885                   invocations is wrong.  That was there just to catch the
17886                   bug with a strack trace but not as a way of addressing
17887                   the problem.
17888
17889                   To fix the problem we have to *understand* what is going
17890                   on and the interactions and come up with a plan, not
17891                   just get things going.
17892
17893                 * The use of the type conversion cache that I proposed
17894                   last night had an open topic: How does this work across
17895                   protection domains.  A user defined conversion might not
17896                   be public in the location where we are applying the
17897                   conversion, a different conversion might be selected
17898                   (ie, private A->B (better) but public B->A (worse),
17899                   inside A, A->B applies, but outside it, B->A will
17900                   apply).
17901
17902                 * On top of that (ie, even if the above is solved),
17903                   conversions in a cache need to be abstract.  Ie, `To
17904                   convert from an Int to a Short use an OpcodeCast', not
17905                   `To convert from an Int to a Short use the OpcodeCast on
17906                   the variable 5' (which is what this patch was doing).
17907
17908 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17909
17910         * expression.cs (Invocation::ConversionExists): Re-write to use
17911         the conversion cache
17912
17913         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17914         cache all conversions done, not just user-defined ones.
17915
17916         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17917         to determine if a conversion exists instead of acutually trying to 
17918         perform the conversion. It's faster too.
17919
17920         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17921         and only then attempt the implicit conversion.
17922
17923 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17924
17925         * expression.cs (ConvertImplicit): Use a cache for conversions
17926         already found. Check level of recursion and bail out if necessary.
17927
17928 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17931         Export standard methods that we expect for string operations.
17932
17933         * statement.cs (Block::UsageWarning): Track usage of variables and
17934         report the errors for not used variables.
17935
17936         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17937         operator. 
17938
17939 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17940
17941         * codegen.cs: remove unnneded code 
17942
17943         * expression.cs: Removed BuiltinTypeAccess class
17944
17945         Fix the order in which implicit conversions are
17946         done.  
17947
17948         The previous fixed dropped support for boxed conversions (adding a
17949         test to the test suite now)
17950
17951         (UserImplicitCast::CanConvert): Remove test for source being null,
17952         that code is broken.  We should not feed a null to begin with, if
17953         we do, then we should track the bug where the problem originates
17954         and not try to cover it up here.
17955
17956         Return a resolved expression of type UserImplicitCast on success
17957         rather than true/false.  Ravi: this is what I was talking about,
17958         the pattern is to use a static method as a "constructor" for
17959         objects. 
17960
17961         Also, do not create arguments until the very last minute,
17962         otherwise we always create the arguments even for lookups that
17963         will never be performed. 
17964
17965         (UserImplicitCast::Resolve): Eliminate, objects of type
17966         UserImplicitCast are born in a fully resolved state. 
17967
17968         * typemanager.cs (InitCoreTypes): Init also value_type
17969         (System.ValueType). 
17970
17971         * expression.cs (Cast::Resolve): First resolve the child expression.
17972
17973         (LValue): Add new method AddressOf to be used by
17974         the `&' operator.  
17975
17976         Change the argument of Store to take an EmitContext instead of an
17977         ILGenerator, because things like FieldExpr need to be able to call
17978         their children expression to generate the instance code. 
17979
17980         (Expression::Error, Expression::Warning): Sugar functions for
17981         reporting errors.
17982
17983         (Expression::MemberLookup): Accept a TypeContainer instead of a
17984         Report as the first argument.
17985
17986         (Expression::ResolvePrimary): Killed.  I still want to improve
17987         this as currently the code is just not right.
17988
17989         (Expression::ResolveMemberAccess): Simplify, but it is still
17990         wrong. 
17991
17992         (Unary::Resolve): Catch errors in AddressOf operators.
17993
17994         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
17995         index to a byte for the short-version, or the compiler will choose
17996         the wrong Emit call, which generates the wrong data.
17997
17998         (ParameterReference::Emit, ::Store): same.
17999
18000         (FieldExpr::AddressOf): Implement.
18001
18002         * typemanager.cs: TypeManager: made public variable instead of
18003         property.
18004
18005         * driver.cs: document --fatal.
18006
18007         * report.cs (ErrorMessage, WarningMessage): new names for the old
18008         Error and Warning classes.
18009
18010         * cs-parser.jay (member_access): Turn built-in access to types
18011         into a normal simplename
18012
18013 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18014
18015         * expression.cs (Invocation::BetterConversion): Fix to cope
18016         with q being null, since this was introducing a bug.
18017
18018         * expression.cs (ConvertImplicit): Do built-in conversions first.
18019
18020 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18021
18022         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18023
18024 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18025
18026         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18027         I had introduced long ago (what's new ?).
18028
18029         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18030         the work of all the checking. 
18031         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18032         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18033
18034         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18035         that is the right way. 
18036
18037         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18038         overloading resolution. Use everywhere instead of cutting and pasting code.
18039
18040         (Binary::ResolveOperator): Use MakeUnionSet.
18041
18042         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18043         we have to convert to bool types. Not complete yet.
18044
18045 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18046
18047         * typemanager.cs (TypeManager::CSharpName): support ushort.
18048
18049         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18050         to provide an expression that performsn an implicit constant int
18051         conversion (section 6.1.6).
18052         (Expression::ConvertImplicitRequired): Reworked to include
18053         implicit constant expression conversions.
18054
18055         (Expression::ConvertNumericExplicit): Finished.
18056
18057         (Invocation::Emit): If InstanceExpression is null, then it means
18058         that we perform a call on this.
18059
18060 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18061
18062         * expression.cs (Unary::Emit): Remove some dead code.
18063         (Probe): Implement Resolve and Emit for `is'.
18064         (Expression::ConvertImplicitRequired): Attempt to do constant
18065         expression conversions here.  Maybe should be moved to
18066         ConvertImplicit, but I am not sure.
18067         (Expression::ImplicitLongConstantConversionPossible,
18068         Expression::ImplicitIntConstantConversionPossible): New functions
18069         that tell whether is it possible to apply an implicit constant
18070         expression conversion.
18071
18072         (ConvertNumericExplicit): Started work on explicit numeric
18073         conversions.
18074
18075         * cs-parser.jay: Update operator constants.
18076
18077         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18078         (Parameters::GetSignature): Hook up VerifyArgs here.
18079         (Parameters::VerifyArgs): Verifies that no two arguments have the
18080         same name. 
18081
18082         * class.cs (Operator): Update the operator names to reflect the
18083         ones that the spec expects (as we are just stringizing the
18084         operator names).
18085
18086         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18087         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18088         previous usage did only work for our methods.
18089         (Expression::ConvertImplicit): Handle decimal implicit numeric
18090         conversions as well.
18091         (Expression::InternalTypeConstructor): Used to invoke constructors
18092         on internal types for default promotions.
18093
18094         (Unary::Emit): Implement special handling for the pre/post
18095         increment/decrement for overloaded operators, as they need to have
18096         the same semantics as the other operators.
18097
18098         (Binary::ResolveOperator): ditto.
18099         (Invocation::ConversionExists): ditto.
18100         (UserImplicitCast::Resolve): ditto.
18101
18102 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18103
18104         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18105         operator, return after emitting body. Regression tests pass again !
18106
18107         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18108         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18109         (Invocation::OverloadResolve): Ditto.
18110         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18111
18112         * everywhere : update calls to the above methods accordingly.
18113
18114 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18115
18116         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18117
18118         * expression.cs (ExpressionStatement): New base class used for
18119         expressions that can appear in statements, so that we can provide
18120         an alternate path to generate expression that do not leave a value
18121         on the stack.
18122
18123         (Expression::Emit, and all the derivatives): We no longer return
18124         whether a value is left on the stack or not.  Every expression
18125         after being emitted leaves a single value on the stack.
18126
18127         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18128         facilties of ExpressionStatement if possible.
18129
18130         * cs-parser.jay: Update statement_expression.
18131
18132 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18133
18134         * driver.cs: Change the wording of message
18135
18136 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18137
18138         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18139         the type of the expression to the return type of the method if
18140         we have an overloaded operator match ! The regression tests pass again !
18141         (Unary::ResolveOperator): Ditto.
18142
18143         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18144         to find "op_Implicit", not "implicit" ;-)
18145         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18146         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18147
18148         * everywhere : Correct calls to the above accordingly.
18149
18150         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18151         (ConvertImplicit): Do user-defined conversion if it exists.
18152
18153 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18154
18155         * assign.cs: track location.
18156         (Resolve): Use implicit conversions on assignment.
18157
18158         * literal.cs: Oops.  Not good, Emit of short access values should
18159         pass (Bytes) or the wrong argument will be selected.
18160
18161         * expression.cs (Unary::Emit): Emit code for -expr.
18162
18163         (Unary::ResolveOperator): Handle `Substract' for non-constants
18164         (substract from zero from the non-constants).
18165         Deal with Doubles as well. 
18166
18167         (Expression::ConvertImplicitRequired): New routine that reports an
18168         error if no implicit conversion exists. 
18169
18170         (Invocation::OverloadResolve): Store the converted implicit
18171         expressions if we make them
18172
18173 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18174
18175         * class.cs (ConstructorInitializer): Take a Location argument.
18176         (ConstructorBaseInitializer): Same here.
18177         (ConstructorThisInitializer): Same here.
18178
18179         * cs-parser.jay : Update all calls accordingly.
18180
18181         * expression.cs (Unary, Binary, New): Take location argument.
18182         Update accordingly everywhere.
18183
18184         * cs-parser.jay : Update all calls to the above to take a location
18185         argument.
18186
18187         * class.cs : Ditto.
18188
18189 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18190
18191         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18192         (Invocation::BetterConversion): Same here
18193         (Invocation::ConversionExists): Ditto.
18194
18195         (Invocation::ConversionExists): Implement.
18196
18197 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18198
18199         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18200         Also take an additional TypeContainer argument.
18201
18202         * All over : Pass in TypeContainer as argument to OverloadResolve.
18203
18204         * typemanager.cs (CSharpName): Update to check for the string type and return
18205         that too.
18206
18207         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18208         a given method.
18209
18210 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18211
18212         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18213         (Invocation::BetterFunction): Implement.
18214         (Invocation::BetterConversion): Implement.
18215         (Invocation::ConversionExists): Skeleton, no implementation yet.
18216
18217         Okay, things work fine !
18218
18219 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18220
18221         * typemanager.cs: declare and load enum_type, delegate_type and
18222         void_type. 
18223
18224         * expression.cs (Expression::Emit): Now emit returns a value that
18225         tells whether a value is left on the stack or not.  This strategy
18226         might be reveted tomorrow with a mechanism that would address
18227         multiple assignments.
18228         (Expression::report118): Utility routine to report mismatches on
18229         the ExprClass.
18230
18231         (Unary::Report23): Report impossible type/operator combination
18232         utility function.
18233
18234         (Unary::IsIncrementableNumber): Whether the type can be
18235         incremented or decremented with add.
18236         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18237         complemented. 
18238         (Unary::ResolveOperator): Implement ++, !, ~,
18239
18240         (Invocation::Emit): Deal with new Emit convetion.
18241
18242         * All Expression derivatives: Updated their Emit method to return
18243         whether they leave values on the stack or not.
18244
18245         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18246         stack for expressions that are statements. 
18247
18248 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18249
18250         * expression.cs (LValue): New interface.  Must be implemented by
18251         LValue objects.
18252         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18253         LValue interface.
18254
18255         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18256         interface for generating code, simplifies the code.
18257
18258 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18259
18260         * expression.cs (everywhere): Comment out return statements in ::Resolve
18261         methods to avoid the warnings.
18262
18263 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18264
18265         * driver.cs (parse): Report error 2001 if we can not open the
18266         source file.
18267
18268         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18269         not resolve it.
18270
18271         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18272         object. 
18273
18274         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18275         otherwise nested blocks end up with the same index.
18276
18277         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18278
18279         * expression.cs:  Instead of having FIXMEs in the Resolve
18280         functions, throw exceptions so it is obvious that we are facing a
18281         bug. 
18282
18283         * cs-parser.jay (invocation_expression): Pass Location information.
18284
18285         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18286         Use a basename for those routines because .NET does not like paths
18287         on them. 
18288
18289         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18290         already defined.
18291
18292 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18293
18294         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18295         are loading the correct data types (throws an exception if not).
18296         (TypeManager::InitCoreTypes): Use CoreLookupType
18297
18298         * expression.cs (Unary::ResolveOperator): return the child
18299         expression for expressions which are just +expr.
18300         (Unary::ResolveOperator): Return negative literals for -LITERAL
18301         expressions (otherwise they are Unary {Literal}).
18302         (Invocation::Badness): Take into account `Implicit constant
18303         expression conversions'.
18304
18305         * literal.cs (LongLiteral): Implement long literal class.
18306         (IntLiteral): export the `Value' of the intliteral. 
18307
18308 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18309
18310         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18311
18312         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18313         instead of 'Operator'
18314
18315         * expression.cs (Binary::ResolveOperator): Update accordingly.
18316         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18317         and 'Minus'
18318
18319         * cs-parser.jay (unary_expression): Update to use the new names.
18320
18321         * gen-treedump.cs (GetUnary): Same here.
18322
18323         * expression.cs (Unary::Resolve): Implement.
18324         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18325         operators are found instead of making noise ;-)
18326         (Unary::ResolveOperator): New method to do precisely the same thing which
18327         Binary::ResolveOperator does for Binary expressions.
18328         (Unary.method, .Arguments): Add.
18329         (Unary::OperName): Implement.   
18330         (Unary::ForceConversion): Copy and Paste !
18331
18332         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18333         a unary operator.
18334
18335         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18336         for the inbuilt operators. Only overloading works for now ;-)
18337
18338 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18341         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18342
18343         * expression.cs (This::Emit): Implement. 
18344         (This::Resolve): Implement.
18345         (TypeOf:Resolve): Implement.
18346         (Expression::ResolveSimpleName): Add an implicit this to instance
18347         field references. 
18348         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18349         Bind instance variable to Field expressions.
18350         (FieldExpr::Instance): New field used to track the expression that
18351         represents the object instance.
18352         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18353         binding 
18354         (FieldExpr::Emit): Implement.
18355
18356         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18357         the last instruction contains a return opcode to avoid generating
18358         the last `ret' instruction (this generates correct code, and it is
18359         nice to pass the peverify output).
18360
18361         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18362         initializer for static and instance variables.
18363         (Constructor::Emit): Allow initializer to be null in the case of
18364         static constructors.  Only emit initializer for instance
18365         constructors. 
18366
18367         (TypeContainer::FindMembers): Return a null array if there are no
18368         matches.
18369
18370         Also fix the code for the MemberTypes.Method branch, as it was not
18371         scanning that for operators (or tried to access null variables before).
18372
18373         * assign.cs (Assign::Emit): Handle instance and static fields. 
18374
18375         * TODO: Updated.
18376
18377         * driver.cs: Stop compilation if there are parse errors.
18378
18379         * cs-parser.jay (constructor_declaration): Provide default base
18380         initializer for non-static constructors.
18381         (constructor_declarator): Do not provide a default base
18382         initializers if none was specified.
18383         Catch the fact that constructors should not have parameters.
18384
18385         * class.cs: Do not emit parent class initializers for static
18386         constructors, that should be flagged as an error.
18387
18388 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18389
18390         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18391         Move back code into TypeContainer::Populate.
18392
18393 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18394
18395         * class.cs (TypeContainer::AddConstructor): Fix the check to
18396         compare against Name, not Basename. 
18397         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18398
18399         * cs-parser.jay : Update accordingly.
18400
18401         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18402         for methods, don't forget to look into the operators too.
18403         (RegisterMethodBuilder): Helper method to take care of this for
18404         methods, constructors and operators.
18405         (Operator::Define): Completely revamp.
18406         (Operator.OperatorMethod, MethodName): New fields.
18407         (TypeContainer::Populate): Move the registering of builders into
18408         RegisterMethodBuilder.
18409         (Operator::Emit): Re-write.
18410
18411         * expression.cs (Binary::Emit): Comment out code path to emit method
18412         invocation stuff for the case when we have a user defined operator. I am
18413         just not able to get it right !
18414
18415 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18416
18417         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18418         argument. 
18419
18420         (Expression::MemberLookup): Provide a version that allows to
18421         specify the MemberTypes and BindingFlags. 
18422
18423         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18424         so it was not fetching variable information from outer blocks.
18425
18426         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18427         Beforefieldinit as it was buggy.
18428
18429         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18430         that Ravi put here.  
18431
18432         * class.cs (Constructor::Emit): Only emit if block is not null.
18433         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18434         deal with this by semantically definining it as if the user had
18435         done it.
18436
18437         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18438         constructors as we now "emit" them at a higher level.
18439
18440         (TypeContainer::DefineDefaultConstructor): Used to define the
18441         default constructors if none was provided.
18442
18443         (ConstructorInitializer): Add methods Resolve and Emit. 
18444
18445         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18446
18447 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18448
18449         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18450         the default constructor builder with our hashtable for methodbuilders
18451         to methodcores.
18452
18453         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18454         and argument_count is 0 in which case we have a match.
18455         (Binary::ResolveOperator): More null checking and miscellaneous coding
18456         style cleanup.
18457
18458 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18459
18460         * rootcontext.cs (IsNameSpace): Compare against null.
18461
18462         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18463
18464         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18465         and Unary::Operator.
18466
18467         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18468         accordingly.
18469
18470         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18471         we have overloaded operators.
18472         (Binary::ResolveOperator): Implement the part which does the operator overload
18473         resolution.
18474
18475         * class.cs (Operator::Emit): Implement.
18476         (TypeContainer::Emit): Emit the operators we have too.
18477
18478         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18479         the case when we have a user-defined operator.
18480
18481 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18482
18483         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18484
18485 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18486
18487         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18488         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18489         (Constructor::Emit): Implement.
18490         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18491         if we have no work to do. 
18492         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18493         Emit method.
18494
18495         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18496         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18497
18498         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18499         of parent.parent.
18500
18501 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18502
18503         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18504         in the source.
18505         (Tree::RecordNamespace): Method to do what the name says ;-)
18506         (Tree::Namespaces): Property to get at the namespaces hashtable.
18507
18508         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18509         keep track.
18510
18511         * rootcontext.cs (IsNamespace): Fixed it :-)
18512
18513 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18514
18515         * class.cs (TypeContainer::FindMembers): Add support for
18516         constructors. 
18517         (MethodCore): New class that encapsulates both the shared aspects
18518         of a Constructor and a Method.  
18519         (Method, Constructor): Factored pieces into MethodCore.
18520
18521         * driver.cs: Added --fatal which makes errors throw exceptions.
18522         Load System assembly as well as part of the standard library.
18523
18524         * report.cs: Allow throwing exceptions on errors for debugging.
18525
18526         * modifiers.cs: Do not use `parent', instead use the real type
18527         container to evaluate permission settings.
18528
18529         * class.cs: Put Ravi's patch back in.  He is right, and we will
18530         have to cope with the
18531
18532 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18533
18534         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18535         FamORAssem, not FamANDAssem.
18536
18537 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18538
18539         * driver.cs: Added --parse option that only parses its input files
18540         and terminates.
18541
18542         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18543         incorrect.  IsTopLevel is not used to tell whether an object is
18544         root_types or not (that can be achieved by testing this ==
18545         root_types).  But to see if this is a top-level *class* (not
18546         necessarly our "toplevel" container). 
18547
18548 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18549
18550         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18551         parent instead of a direct call to GetType.
18552
18553 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18554
18555         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18556         Modifiers.TypeAttr. This should just be a call to that method.
18557
18558         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18559         object so that we can determine if we are top-level or not.
18560
18561         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18562         TypeContainer too.
18563
18564         * enum.cs (Enum::Define): Ditto.
18565
18566         * modifiers.cs (FieldAttr): Re-write.
18567
18568         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18569         (TypeContainer::HaveStaticConstructor): New property to provide access
18570         to precisely that info.
18571
18572         * modifiers.cs (MethodAttr): Re-write.
18573         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18574
18575         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18576         of top-level types as claimed.
18577
18578 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18579
18580         * expression.cs (MemberLookup): Fruitless attempt to lookup
18581         constructors.  Maybe I need to emit default constructors?  That
18582         might be it (currently .NET emits this for me automatically).
18583         (Invocation::OverloadResolve): Cope with Arguments == null.
18584         (Invocation::EmitArguments): new function, shared by the new
18585         constructor and us.
18586         (Invocation::Emit): Handle static and instance methods.  Emit
18587         proper call instruction for virtual or non-virtual invocations.
18588         (New::Emit): Implement.
18589         (New::Resolve): Implement.
18590         (MemberAccess:Resolve): Implement.
18591         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18592         to track instances.
18593         (FieldExpr::Resolve): Set type.
18594
18595         * support.cs: Handle empty arguments.
18596                 
18597         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18598         SimpleLookup): Auxiliary routines to help parse a qualifier
18599         identifier.  
18600
18601         Update qualifier_identifier rule.
18602
18603         * codegen.cs: Removed debugging messages.
18604
18605         * class.cs: Make this a global thing, this acts just as a "key" to
18606         objects that we might have around.
18607
18608         (Populate): Only initialize method_builders_to_methods once.
18609
18610         * expression.cs (PropertyExpr): Initialize type from the
18611         PropertyType. 
18612
18613         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18614         Resolve pattern.  Attempt to implicitly convert value to boolean.
18615         Emit code.
18616
18617         * expression.cs: Set the type for the int32/int32 argument case.
18618         (Binary::ResolveOperator): Set the return type to boolean for
18619         comparission operators
18620
18621         * typemanager.cs: Remove debugging print code.
18622
18623         (Invocation::Resolve): resolve type.
18624
18625         * class.cs: Allocate a MemberInfo of the correct size, as the code
18626         elsewhere depends on the test to reflect the correct contents.
18627
18628         (Method::) Keep track of parameters, due to System.Reflection holes
18629
18630         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18631         mapping here.
18632
18633         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18634         of the exact size and return that.
18635
18636         (Class::LookupMethodByBuilder): New function that maps
18637         MethodBuilders to its methods.  Required to locate the information
18638         on methods because System.Reflection bit us again.
18639
18640         * support.cs: New file, contains an interface ParameterData and
18641         two implementations: ReflectionParameters and InternalParameters
18642         used to access Parameter information.  We will need to grow this
18643         as required.
18644
18645         * expression.cs (Invocation::GetParameterData): implement a cache
18646         and a wrapper around the ParameterData creation for methods. 
18647         (Invocation::OverloadResolve): Use new code.
18648
18649 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18650
18651         * class.cs (TypeContainer::EmitField): Remove and move into 
18652         (Field::Define): here and modify accordingly.
18653         (Field.FieldBuilder): New member.
18654         (TypeContainer::Populate): Update accordingly.
18655         (TypeContainer::FindMembers): Implement.
18656
18657 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18658
18659         * statement.cs: (VariableInfo::VariableType): New field to be
18660         initialized with the full type once it is resolved. 
18661
18662 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18663
18664         * parameter.cs (GetParameterInfo): Use a type cache to compute
18665         things only once, and to reuse this information
18666
18667         * expression.cs (LocalVariableReference::Emit): Implement.
18668         (OpcodeCast::Emit): fix.
18669
18670         (ParameterReference::Resolve): Implement.
18671         (ParameterReference::Emit): Implement.
18672
18673         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18674         that are expressions need to stay as Expressions.
18675
18676         * typemanager.cs (CSharpName): Returns the C# name of a type if
18677         possible. 
18678
18679         * expression.cs (Expression::ConvertImplicit): New function that
18680         implements implicit type conversions.
18681
18682         (Expression::ImplicitReferenceConversion): Implements implicit
18683         reference conversions.
18684
18685         (EmptyCast): New type for transparent casts.
18686
18687         (OpcodeCast): New type for casts of types that are performed with
18688         a sequence of bytecodes.
18689
18690         (BoxedCast): New type used for casting value types into reference
18691         types.  Emits a box opcode.
18692
18693         (Binary::DoNumericPromotions): Implements numeric promotions of
18694         and computation of the Binary::Type.
18695
18696         (Binary::EmitBranchable): Optimization.
18697
18698         (Binary::Emit): Implement code emission for expressions.
18699
18700         * typemanager.cs (TypeManager): Added two new core types: sbyte
18701         and byte.
18702
18703 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18704
18705         * class.cs (TypeContainer::FindMembers): Method which does exactly
18706         what Type.FindMembers does, only we don't have to use reflection. No
18707         implementation yet.
18708
18709         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18710         typecontainer objects as we need to get at them.
18711         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18712
18713         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18714         typecontainer object.
18715
18716         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18717         of just a Report object.
18718
18719 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18720
18721         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18722         "remove_"
18723         (TypeContainer::Populate): Now define the delegates of the type too.
18724         (TypeContainer.Delegates): Property to access the list of delegates defined
18725         in the type.
18726
18727         * delegates.cs (Delegate::Define): Implement partially.
18728
18729         * modifiers.cs (TypeAttr): Handle more flags.
18730
18731 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18732
18733         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18734         and not <=
18735         (Operator::Define): Re-write logic to get types by using the LookupType method
18736         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18737         (Indexer::Define): Ditto.
18738         (Event::Define): Ditto.
18739         (Property::Define): Ditto.
18740
18741 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18742
18743         * class.cs (TypeContainer::Populate): Now define operators too. 
18744         (TypeContainer.Operators): New property to access the list of operators
18745         in a type.
18746         (Operator.OperatorMethodBuilder): New member to hold the method builder
18747         for the operator we are defining.
18748         (Operator::Define): Implement.
18749
18750 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18751
18752         * class.cs (Event::Define): Make the prefixes of the accessor methods
18753         addOn_ and removeOn_ 
18754
18755         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18756         of the location being passed in too. Ideally, this should go later since all
18757         error reporting should be done through the Report object.
18758
18759         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18760         (Populate): Iterate thru the indexers we have and define them too.
18761         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18762         for the get and set accessors.
18763         (Indexer::Define): Implement.
18764
18765 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18766
18767         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18768         my previous implementation, did not work.
18769
18770         * typemanager.cs: Add a couple of missing types (the longs).
18771
18772         * literal.cs: Use TypeManager.bool_type instead of getting it.
18773
18774         * expression.cs (EventExpr): New kind of expressions.
18775         (Expressio::ExprClassFromMemberInfo): finish
18776
18777 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18778
18779         * assign.cs: Emit stores to static fields differently.
18780
18781 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18782
18783         * Merge in changes and adjust code to tackle conflicts. Backed out my
18784         code in Assign::Resolve ;-) 
18785
18786 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18787
18788         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18789         instead Report.Error and also pass in the location.
18790         (CSharpParser::Lexer): New readonly property to return the reference
18791         to the Tokenizer object.
18792         (declare_local_variables): Use Report.Error with location instead of plain 
18793         old error.
18794         (CheckDef): Ditto.
18795
18796         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18797         (Operator.CheckBinaryOperator): Ditto.
18798
18799         * cs-parser.jay (operator_declarator): Update accordingly.
18800
18801         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18802         (CheckBinaryOperator): Same here.
18803
18804         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18805         on the name without any prefixes of namespace names etc. This is because we
18806         already might have something already fully qualified like 
18807         'System.Console.WriteLine'
18808
18809         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18810
18811 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18812
18813         * cs-tokenizer.cs (location): Return a string which also contains
18814         the file name.
18815
18816         * expression.cs (ElementAccess): New class for expressions of the
18817         type 'element access.'
18818         (BaseAccess): New class for expressions of the type 'base access.'
18819         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18820         respectively.
18821
18822         * cs-parser.jay (element_access): Implement action.
18823         (base_access): Implement actions.
18824         (checked_expression, unchecked_expression): Implement.
18825
18826         * cs-parser.jay (local_variable_type): Correct and implement.
18827         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18828
18829         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18830
18831         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18832         name and the specifiers.
18833
18834         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18835
18836         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18837         making them all public ;-)
18838
18839         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18840         class anyways.
18841
18842 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18843
18844         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18845         PropertyExprs.
18846         (FieldExpr, PropertyExprs): New resolved expressions.
18847         (SimpleName::MemberStaticCheck): Perform static checks for access
18848         to non-static fields on static methods. Maybe this should be
18849         generalized for MemberAccesses. 
18850         (SimpleName::ResolveSimpleName): More work on simple name
18851         resolution. 
18852
18853         * cs-parser.jay (primary_expression/qualified_identifier): track
18854         the parameter index.
18855
18856         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18857         (EmitContext::EmitBoolExpression): Chain to expression generation
18858         instead of temporary hack.
18859         (::EmitStatementExpression): Put generic expression code generation.
18860
18861         * assign.cs (Assign::Emit): Implement variable assignments to
18862         local variables, parameters and fields.
18863
18864 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18865
18866         * statement.cs (Block::GetVariableInfo): New method, returns the
18867         VariableInfo for a variable name in a block.
18868         (Block::GetVariableType): Implement in terms of GetVariableInfo
18869
18870         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18871         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18872
18873 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18874
18875         * cs-parser.jay (operator_declaration): Continue on my quest : update
18876         to take attributes argument.
18877         (event_declaration): Ditto.
18878         (enum_declaration): Ditto.
18879         (indexer_declaration): Ditto.
18880
18881         * class.cs (Operator::Operator): Update constructor accordingly.
18882         (Event::Event): Ditto.
18883
18884         * delegate.cs (Delegate::Delegate): Same here.
18885
18886         * enum.cs (Enum::Enum): Same here.
18887
18888 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18889
18890         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18891
18892         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18893
18894         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18895         being passed around as an arraylist.
18896         (Attributes::AddAttribute): Method to add attribute sections.
18897
18898         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18899         (struct_declaration): Update accordingly.
18900         (constant_declaration): Update.
18901         (field_declaration): Update.
18902         (method_header): Update.
18903         (fixed_parameter): Update.
18904         (parameter_array): Ditto.
18905         (property_declaration): Ditto.
18906         (destructor_declaration): Ditto.
18907
18908         * class.cs (Struct::Struct): Update constructors accordingly.
18909         (Class::Class): Ditto.
18910         (Field::Field): Ditto.
18911         (Method::Method): Ditto.
18912         (Property::Property): Ditto.
18913         (TypeContainer::OptAttribute): update property's return type.
18914
18915         * interface.cs (Interface.opt_attributes): New member.
18916         (Interface::Interface): Update to take the extra Attributes argument.
18917
18918         * parameter.cs (Parameter::Parameter): Ditto.
18919
18920         * constant.cs (Constant::Constant): Ditto.
18921
18922         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18923         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18924         the attributes as a parameter.
18925         (InterfaceProperty): Update constructor call.
18926         (InterfaceEvent): Ditto.
18927         (InterfaceMethod): Ditto.
18928         (InterfaceIndexer): Ditto.
18929
18930         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18931         pass the attributes too.
18932         (interface_event_declaration): Ditto.
18933         (interface_property_declaration): Ditto.
18934         (interface_method_declaration): Ditto.
18935         (interface_declaration): Ditto.
18936
18937 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * class.cs (Method::Define): Track the "static Main" definition to
18940         create an entry point. 
18941
18942         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18943         EntryPoint if we find it. 
18944
18945         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18946         (EmitContext::ig): Make this variable public.
18947
18948         * driver.cs: Make the default output file be the first file name
18949         with the .exe extension.  
18950
18951         Detect empty compilations
18952
18953         Handle various kinds of output targets.  Handle --target and
18954         rename -t to --dumper.
18955
18956         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18957         methods inherited from Expression return now an Expression.  This
18958         will is used during the tree rewriting as we resolve them during
18959         semantic analysis.
18960
18961         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18962         the spec.  Missing entirely is the information about
18963         accessability of elements of it.
18964
18965         (Expression::ExprClassFromMemberInfo): New constructor for
18966         Expressions that creates a fully initialized Expression based on
18967         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18968         a Type.
18969
18970         (Invocation::Resolve): Begin implementing resolution of invocations.
18971
18972         * literal.cs (StringLiteral):  Implement Emit.
18973
18974 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18975
18976         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18977         member.
18978
18979 2001-09-04  Ravi Pratap  <ravi@ximian.com>
18980
18981         * cs-parser.jay (attribute_arguments): Implement actions.
18982         (attribute): Fix bug in production. Implement action.
18983         (attribute_list): Implement.
18984         (attribute_target): Implement.
18985         (attribute_target_specifier, opt_target_specifier): Implement
18986         (CheckAttributeTarget): New method to check if the attribute target
18987         is valid.
18988         (attribute_section): Implement.
18989         (opt_attributes): Implement.
18990
18991         * attribute.cs : New file to handle attributes.
18992         (Attribute): Class to hold attribute info.
18993
18994         * cs-parser.jay (opt_attribute_target_specifier): Remove production
18995         (attribute_section): Modify production to use 2 different rules to 
18996         achieve the same thing. 1 s/r conflict down !
18997         Clean out commented, useless, non-reducing dimension_separator rules.
18998
18999         * class.cs (TypeContainer.attributes): New member to hold list
19000         of attributes for a type.
19001         (Struct::Struct): Modify to take one more argument, the attribute list.
19002         (Class::Class): Ditto.
19003         (Field::Field): Ditto.
19004         (Method::Method): Ditto.
19005         (Property::Property): Ditto.
19006
19007         * cs-parser.jay (struct_declaration): Update constructor call to
19008         pass in the attributes too.
19009         (class_declaration): Ditto.
19010         (constant_declaration): Ditto.
19011         (field_declaration): Ditto.
19012         (method_header): Ditto.
19013         (fixed_parameter): Ditto.
19014         (parameter_array): Ditto.
19015         (property_declaration): Ditto.
19016
19017         * constant.cs (Constant::Constant): Update constructor similarly.
19018         Use System.Collections.
19019
19020         * parameter.cs (Parameter::Parameter): Update as above.
19021
19022 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19023
19024         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19025         (TypeContainer.delegates): New member to hold list of delegates.
19026
19027         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19028         this time as I seem to be on crack ;-)
19029
19030 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19031
19032         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19033         tell whether an identifier represents a namespace.
19034
19035         * expression.cs (NamespaceExpr): A namespace expression, used only
19036         temporarly during expression resolution.
19037         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19038         utility functions to resolve names on expressions.
19039
19040 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19041
19042         * codegen.cs: Add hook for StatementExpressions. 
19043
19044         * class.cs: Fix inverted test for static flag in methods.
19045
19046 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19047
19048         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19049         to make it coincide with MS' number.
19050         (Operator::CheckBinaryOperator): Ditto.
19051
19052         * ../errors/errors.txt : Remove error numbers added earlier.
19053
19054         * ../errors/cs1019.cs : Test case for error # 1019
19055
19056         * ../errros/cs1020.cs : Test case for error # 1020
19057
19058         * cs-parser.jay : Clean out commented cruft.
19059         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19060         used anywhere - non-reducing rule.
19061         (namespace_declarations): Non-reducing rule - comment out.
19062
19063         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19064         with TypeContainer::AddEnum.
19065
19066         * delegate.cs : New file for delegate handling classes.
19067         (Delegate): Class for declaring delegates.
19068
19069         * makefile : Update.
19070
19071         * cs-parser.jay (delegate_declaration): Implement.
19072
19073 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19074
19075         * class.cs (Event::Define): Implement.
19076         (Event.EventBuilder): New member.
19077
19078         * class.cs (TypeContainer::Populate): Update to define all enums and events
19079         we have.
19080         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19081         readonly fields for all these cases ?
19082
19083 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19084
19085         * class.cs (Property): Revamp to use the convention of making fields readonly.
19086         Accordingly modify code elsewhere.
19087
19088         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19089         the Define method of the Property class.
19090
19091         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19092         trivial bug.
19093         (TypeContainer::Populate): Update to define all the properties we have. Also
19094         define all enumerations.
19095
19096         * enum.cs (Define): Implement.
19097
19098 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19099
19100         * cs-parser.jay (overloadable_operator): The semantic value is an
19101         enum of the Operator class.
19102         (operator_declarator): Implement actions.
19103         (operator_declaration): Implement.
19104
19105         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19106         validity of definitions.
19107         (Operator::CheckBinaryOperator): Static method to check for binary operators
19108         (TypeContainer::AddOperator): New method to add an operator to a type.
19109
19110         * cs-parser.jay (indexer_declaration): Added line to actually call the
19111         AddIndexer method so it gets added ;-)
19112
19113         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19114         already taken care of by the MS compiler ?  
19115
19116 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19117
19118         * class.cs (Operator): New class for operator declarations.
19119         (Operator::OpType): Enum for the various operators.
19120
19121 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19122
19123         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19124         ostensibly handle this in semantic analysis.
19125
19126         * cs-parser.jay (general_catch_clause): Comment out
19127         (specific_catch_clauses, specific_catch_clause): Ditto.
19128         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19129         (catch_args, opt_catch_args): New productions.
19130         (catch_clause): Rewrite to use the new productions above
19131         (catch_clauses): Modify accordingly.
19132         (opt_catch_clauses): New production to use in try_statement
19133         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19134         and re-write the code in the actions to extract the specific and
19135         general catch clauses by being a little smart ;-)
19136
19137         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19138         Hooray, try and catch statements parse fine !
19139
19140 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19141
19142         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19143         string from the hashtable of variables.
19144
19145         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19146         I end up making that mistake ;-)
19147         (catch_clauses): Fixed gross error which made Key and Value of the 
19148         DictionaryEntry the same : $1 !!
19149
19150 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19151
19152         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19153
19154         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19155         when the add and remove accessors are specified. 
19156
19157 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19158
19159         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19160         information about indexer_declarator.
19161         (indexer_declarator): Implement actions.
19162         (parsing_indexer): New local boolean used to keep track of whether
19163         we are parsing indexers or properties. This is necessary because 
19164         implicit_parameters come into picture even for the get accessor in the 
19165         case of an indexer.
19166         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19167
19168         * class.cs (Indexer): New class for indexer declarations.
19169         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19170         (TypeContainer::indexers): New member to hold list of indexers for the
19171         type.
19172
19173 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19174
19175         * cs-parser.jay (add_accessor_declaration): Implement action.
19176         (remove_accessor_declaration): Implement action.
19177         (event_accessors_declaration): Implement
19178         (variable_declarators): swap statements for first rule - trivial.
19179
19180         * class.cs (Event): New class to hold information about event
19181         declarations.
19182         (TypeContainer::AddEvent): New method to add an event to a type
19183         (TypeContainer::events): New member to hold list of events.
19184
19185         * cs-parser.jay (event_declaration): Implement actions.
19186
19187 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19188
19189         * cs-parser.jay (dim_separators): Implement. Make it a string
19190         concatenating all the commas together, just as they appear.
19191         (opt_dim_separators): Modify accordingly
19192         (rank_specifiers): Update accordingly. Basically do the same
19193         thing - instead, collect the brackets here.
19194         (opt_rank_sepcifiers): Modify accordingly.
19195         (array_type): Modify to actually return the complete type string
19196         instead of ignoring the rank_specifiers.
19197         (expression_list): Implement to collect the expressions
19198         (variable_initializer): Implement. We make it a list of expressions
19199         essentially so that we can handle the array_initializer case neatly too.
19200         (variable_initializer_list): Implement.
19201         (array_initializer): Make it a list of variable_initializers
19202         (opt_array_initializer): Modify accordingly.
19203
19204         * expression.cs (New::NType): Add enumeration to help us
19205         keep track of whether we have an object/delegate creation
19206         or an array creation.
19207         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19208         members to hold data about array creation.
19209         (New:New): Modify to update NewType
19210         (New:New): New Overloaded contructor for the array creation
19211         case.
19212
19213         * cs-parser.jay (array_creation_expression): Implement to call
19214         the overloaded New constructor.
19215
19216 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19217
19218         * class.cs (TypeContainer::Constructors): Return member
19219         constructors instead of returning null.
19220
19221 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19222
19223         * typemanager.cs (InitCoreTypes): Initialize the various core
19224         types after we have populated the type manager with the user
19225         defined types (this distinction will be important later while
19226         compiling corlib.dll)
19227
19228         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19229         on Expression Classification.  Now all expressions have a method
19230         `Resolve' and a method `Emit'.
19231
19232         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19233         generation from working.     Also add some temporary debugging
19234         code. 
19235
19236 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19237
19238         * codegen.cs: Lots of code generation pieces.  This is only the
19239         beginning, will continue tomorrow with more touches of polish.  We
19240         handle the fundamentals of if, while, do, for, return.  Others are
19241         trickier and I need to start working on invocations soon.
19242
19243         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19244         s.InitStatement. 
19245
19246         * codegen.cs (EmitContext): New struct, used during code
19247         emission to keep a context.   Most of the code generation will be
19248         here. 
19249
19250         * cs-parser.jay: Add embedded blocks to the list of statements of
19251         this block.  So code generation proceeds in a top down fashion.
19252
19253 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19254
19255         * statement.cs: Add support for multiple child blocks.
19256
19257 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19258
19259         * codegen.cs (EmitCode): New function, will emit the code for a
19260         Block of code given a TypeContainer and its ILGenerator. 
19261
19262         * statement.cs (Block): Standard public readonly optimization.
19263         (Block::Block constructors): Link children. 
19264         (Block::Child): Child Linker.
19265         (Block::EmitVariables): Emits IL variable declarations.
19266
19267         * class.cs: Drop support for MethodGroups here, delay until
19268         Semantic Analysis.
19269         (Method::): Applied the same simplification that I did before, and
19270         move from Properties to public readonly fields.
19271         (Method::ParameterTypes): Returns the parameter types for the
19272         function, and implements a cache that will be useful later when I
19273         do error checking and the semantic analysis on the methods is
19274         performed.
19275         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19276         and made a method, optional argument tells whether this is a class
19277         or a structure to apply the `has-this' bit.
19278         (Method::GetCallingConvention): Implement, returns the calling
19279         convention. 
19280         (Method::Define): Defines the type, a second pass is performed
19281         later to populate the methods.
19282
19283         (Constructor::ParameterTypes): implement a cache similar to the
19284         one on Method::ParameterTypes, useful later when we do semantic
19285         analysis. 
19286
19287         (TypeContainer::EmitMethod):  New method.  Emits methods.
19288
19289         * expression.cs: Removed MethodGroup class from here.
19290
19291         * parameter.cs (Parameters::GetCallingConvention): new method.
19292
19293 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19294
19295         * class.cs (TypeContainer::Populate): Drop RootContext from the
19296         argument. 
19297
19298         (Constructor::CallingConvention): Returns the calling convention.
19299         (Constructor::ParameterTypes): Returns the constructor parameter
19300         types. 
19301
19302         (TypeContainer::AddConstructor): Keep track of default constructor
19303         and the default static constructor.
19304
19305         (Constructor::) Another class that starts using `public readonly'
19306         instead of properties. 
19307
19308         (Constructor::IsDefault): Whether this is a default constructor. 
19309
19310         (Field::) use readonly public fields instead of properties also.
19311
19312         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19313         track of static constructors;  If none is used, turn on
19314         BeforeFieldInit in the TypeAttributes. 
19315
19316         * cs-parser.jay (opt_argument_list): now the return can be null
19317         for the cases where there are no arguments. 
19318
19319         (constructor_declarator): If there is no implicit `base' or
19320         `this', then invoke the default parent constructor. 
19321
19322         * modifiers.cs (MethodAttr): New static function maps a set of
19323         modifiers flags into a MethodAttributes enum
19324         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19325         MethodAttr, TypeAttr to represent the various mappings where the
19326         modifiers are used.
19327         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19328
19329 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19330
19331         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19332         method arguments.
19333
19334         * interface.cs (PopulateIndexer): Implemented the code generator
19335         for interface indexers.
19336
19337 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * interface.cs (InterfaceMemberBase): Now we track the new status
19340         here.  
19341
19342         (PopulateProperty): Implement property population.  Woohoo!  Got
19343         Methods and Properties going today. 
19344
19345         Removed all the properties for interfaces, and replaced them with
19346         `public readonly' fields. 
19347
19348 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19349
19350         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19351         initialize their hashtables/arraylists only when they are needed
19352         instead of doing this always.
19353
19354         * parameter.cs: Handle refs and out parameters.
19355
19356         * cs-parser.jay: Use an ArrayList to construct the arguments
19357         instead of the ParameterCollection, and then cast that to a
19358         Parameter[] array.
19359
19360         * parameter.cs: Drop the use of ParameterCollection and use
19361         instead arrays of Parameters.
19362
19363         (GetParameterInfo): Use the Type, not the Name when resolving
19364         types. 
19365
19366 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19369         and instead use public readonly fields.
19370
19371         * class.cs: Put back walking code for type containers.
19372
19373 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * class.cs (MakeConstant): Code to define constants.
19376
19377         * rootcontext.cs (LookupType): New function.  Used to locate types 
19378
19379
19380 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19381
19382         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19383         this System.Reflection code is.  Kudos to Microsoft
19384
19385         * typemanager.cs: Implement a type cache and avoid loading all
19386         types at boot time.  Wrap in LookupType the internals.  This made
19387         the compiler so much faster.  Wow.  I rule!
19388
19389         * driver.cs: Make sure we always load mscorlib first (for
19390         debugging purposes, nothing really important).
19391
19392         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19393         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19394
19395         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19396         on namespaces that have been imported using the `using' keyword.
19397
19398         * class.cs (TypeContainer::TypeAttr): Virtualize.
19399         (Class::TypeAttr): Return attributes suitable for this bad boy.
19400         (Struct::TypeAttr): ditto.
19401         Handle nested classes.
19402         (TypeContainer::) Remove all the type visiting code, it is now
19403         replaced with the rootcontext.cs code
19404
19405         * rootcontext.cs (GetClassBases): Added support for structs. 
19406
19407 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * interface.cs, statement.cs, class.cs, parameter.cs,
19410         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19411         Drop use of TypeRefs, and use strings instead.
19412
19413 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19414
19415         * rootcontext.cs: 
19416
19417         * class.cs (Struct::Struct): set the SEALED flags after
19418         checking the modifiers.
19419         (TypeContainer::TypeAttr): new property, returns the
19420         TypeAttributes for a class.  
19421
19422         * cs-parser.jay (type_list): Oops, list production was creating a
19423         new list of base types.
19424
19425         * rootcontext.cs (StdLib): New property.
19426         (GetInterfaceTypeByName): returns an interface by type name, and
19427         encapsulates error handling here.
19428         (GetInterfaces): simplified.
19429         (ResolveTree): Encapsulated all the tree resolution here.
19430         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19431         types. 
19432
19433         * driver.cs: Add support for --nostdlib, to avoid loading the
19434         default assemblies.
19435         (Main): Do not put tree resolution here. 
19436
19437         * rootcontext.cs: Beginning of the class resolution.
19438
19439 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * rootcontext.cs: Provide better error reporting. 
19442
19443         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19444
19445         * rootcontext.cs (CreateInterface): Handle the case where there
19446         are no parent interfaces.
19447
19448         (CloseTypes): Routine to flush types at the end.
19449         (CreateInterface): Track types.
19450         (GetInterfaces): Returns an array of Types from the list of
19451         defined interfaces.
19452
19453         * typemanager.c (AddUserType): Mechanism to track user types (puts
19454         the type on the global type hash, and allows us to close it at the
19455         end). 
19456
19457 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19458
19459         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19460         RecordInterface instead.
19461
19462         * cs-parser.jay: Updated to reflect changes above.
19463
19464         * decl.cs (Definition): Keep track of the TypeBuilder type that
19465         represents this type here.  Not sure we will use it in the long
19466         run, but wont hurt for now.
19467
19468         * driver.cs: Smaller changes to accomodate the new code.
19469
19470         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19471         when done. 
19472
19473         * rootcontext.cs (CreateInterface):  New method, used to create
19474         the System.TypeBuilder type for interfaces.
19475         (ResolveInterfaces): new entry point to resolve the interface
19476         hierarchy. 
19477         (CodeGen): Property, used to keep track of the code generator.
19478
19479 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * cs-parser.jay: Add a second production for delegate_declaration
19482         with `VOID'.
19483
19484         (enum_body): Put an opt_comma here instead of putting it on
19485         enum_body or enum_member_declarations so we can handle trailing
19486         commas on enumeration members.  Gets rid of a shift/reduce.
19487
19488         (type_list): Need a COMMA in the middle.
19489
19490         (indexer_declaration): Tell tokenizer to recognize get/set
19491
19492         * Remove old targets.
19493
19494         * Re-add the parser target.
19495
19496 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19497
19498         * cs-parser.jay: Add precendence rules for a number of operators
19499         ot reduce the number of shift/reduce conflicts in the grammar.
19500
19501 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19502
19503         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19504         and put it here.
19505
19506         Get rid of old crufty code.
19507
19508         * rootcontext.cs: Use this to keep track of the parsed
19509         representation and the defined types available to the program. 
19510
19511         * gen-treedump.cs: adjust for new convention.
19512
19513         * type.cs: Split out the type manager, and the assembly builder
19514         from here. 
19515
19516         * typemanager.cs: the type manager will live here now.
19517
19518         * cil-codegen.cs: And the code generator here. 
19519
19520 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19521
19522         * makefile: Fixed up for easy making.
19523
19524 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19525
19526         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19527         the 
19528
19529         (unary_expression): Expand pre_increment_expression and
19530         post_decrement_expression to reduce a shift/reduce.
19531
19532 2001-07-11  Simon Cozens
19533
19534         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19535
19536         Improve allow_keyword_as_indent name.
19537
19538 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19539
19540         * Adjustments for Beta2. 
19541
19542 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * decl.cs: Added `Define' abstract method.
19545         (InTransit): new property, used to catch recursive definitions. 
19546
19547         * interface.cs: Implement `Define'. 
19548
19549         * modifiers.cs: Map Modifiers.constants to
19550         System.Reflection.TypeAttribute flags.
19551
19552         * class.cs: Keep track of types and user-defined types.
19553         (BuilderInit): New method for creating an assembly
19554         (ResolveType): New function to launch the resolution process, only
19555         used by interfaces for now.
19556
19557         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19558         that are inserted into the name space. 
19559
19560 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19561
19562         * ARGH.  I have screwed up my tree so many times due to the use of
19563         rsync rather than using CVS.  Going to fix this at once. 
19564
19565         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19566         load types.
19567
19568 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19569
19570         * Experiment successful: Use System.Type rather that our own
19571         version of Type.  
19572
19573 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19574
19575         * cs-parser.jay: Removed nsAliases from here.
19576
19577         Use new namespaces, handle `using XXX;' 
19578
19579         * namespace.cs: Reimplemented namespace handling, use a recursive
19580         definition of the class.  Now we can keep track of using clauses
19581         and catch invalid using clauses.
19582
19583 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19584
19585         * gen-treedump.cs: Adapted for all the renaming.
19586
19587         * expression.cs (Expression): this class now has a Type property
19588         which returns an expression Type.
19589
19590         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19591         `Type', as this has a different meaning now in the base
19592
19593 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19594
19595         * interface.cs, class.cs: Removed from all the sources the
19596         references to signature computation, as we can not do method
19597         signature computation during the parsing time, as we are not
19598         trying to solve at that point distinguishing:
19599
19600         class X {
19601                 void a (Blah x) {}
19602                 void a (NS.Blah x) {}
19603         }
19604
19605         Which depending on the context might be valid or not, as we do not
19606         know if Blah is the same thing as NS.Blah at that point.
19607
19608         * Redid everything so the code uses TypeRefs now instead of
19609         Types.  TypeRefs are just temporary type placeholders, that need
19610         to be resolved.  They initially have a pointer to a string and the
19611         current scope in which they are used.  This is used later by the
19612         compiler to resolve the reference to an actual Type. 
19613
19614         * DeclSpace is no longer a CIR.Type, and neither are
19615         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19616         are all DeclSpaces, but no Types. 
19617
19618         * type.cs (TypeRefManager): This implements the TypeRef manager,
19619         which keeps track of all the types that need to be resolved after
19620         the parsing has finished. 
19621
19622 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19623
19624         * ARGH.  We are going to have to store `foreach' as a class rather
19625         than resolving it, as we need to verify error 1579 after name
19626         resolution.   *OR* we could keep a flag that says `This request to
19627         IEnumerator comes from a foreach statement' which we can then use
19628         to generate the error.
19629
19630 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19631
19632         * class.cs (TypeContainer.AddMethod): we now add methods to the
19633         MethodGroup instead of the method hashtable.  
19634
19635         * expression.cs: Add MethodGroup abstraction, which gets us one
19636         step closer to the specification in the way we handle method
19637         declarations.  
19638
19639         * cs-parser.jay (primary_expression): qualified_identifier now
19640         tried to match up an identifier to a local variable reference or
19641         to a parameter reference.
19642
19643         current_local_parameters is now a parser global variable that
19644         points to the current parameters for the block, used during name
19645         lookup.
19646
19647         (property_declaration): Now creates an implicit `value' argument to
19648         the set accessor.
19649
19650 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19651
19652         * parameter.cs: Do not use `param' arguments as part of the
19653         signature, per the spec.
19654
19655 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19656
19657         * decl.cs: Base class for classes, structs and interfaces.  This
19658         is the "Declaration Space" 
19659
19660         * cs-parser.jay: Use CheckDef for checking declaration errors
19661         instead of having one on each function.
19662
19663         * class.cs: Factor out some code for handling error handling in
19664         accordance to the "Declarations" section in the "Basic Concepts"
19665         chapter in the ECMA C# spec.
19666
19667         * interface.cs: Make all interface member classes derive from
19668         InterfaceMemberBase.
19669
19670 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * Many things: all interfaces are parsed and generated in
19673         gen-treedump.  Support for member variables, constructors,
19674         destructors, properties, constants is there.
19675
19676         Beginning of the IL backend, but very little done, just there for
19677         testing purposes. 
19678
19679 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * cs-parser.jay: Fix labeled statement.
19682
19683         * cs-tokenizer.cs (escape): Escape " and ' always.
19684         ref_line, ref_name: keep track of the line/filename as instructed
19685         by #line by the compiler.
19686         Parse #line.
19687
19688 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19689
19690         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19691         to match the values in System.CodeDOM.
19692
19693         Divid renamed to Divide.
19694
19695         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19696         statements. 
19697         (Statements.set): remove.
19698
19699         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19700         statements. 
19701
19702         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19703         falseStatements always have valid values. 
19704
19705         * cs-parser.jay: Use System.CodeDOM now.
19706