Fix #73038.
[mono.git] / mcs / mcs / ChangeLog
1 2005-03-26  Raja R Harinath  <harinath@acm.org>
2
3         Fix #73038.
4         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5         fails to resolve, ensure that the LHS is still resolved as an
6         lvalue.
7
8 2005-03-25  Raja R Harinath  <harinath@acm.org>
9
10         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11         ec.ContainerType.
12         (Enum.current_ec): Remove.
13         (Enum.LookupEnumValue): Remove EmitContext argument.
14         Just uses the one created during DefineType.
15         (Enum.FindMembers): Update.
16         * expression.cs (MemberAccess.DoResolve): Update.
17
18 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
19
20         * assign.cs (Assign.DoResolve): Check for CS1717 when
21         source and target are same (uses Equals).
22
23         * expression.cs (LocalVariableReference, ParameterReference,
24         This): Implemented Equals, GetHashCode.
25
26         * statement.cs (Block.GetParameterReference): Removed useless
27         local variable.
28
29 2005-03-22  Raja R Harinath  <rharinath@novell.com>
30
31         Fix cs0128.cs
32         * statement.cs (Block.AddVariable): Ensure that we skip implicit
33         blocks before deciding whether the error is cs0136 or cs0128.
34
35         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
36         (using_alias_directive, using_namespace_directive): Pass
37         MemberName, not an expression to Namespace.UsingAlias and
38         Namespace.Using.
39         (MakeName): Use the MemberName of the namespace.
40         * namespace.cs (Namespace.MemberName): New.
41         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
42         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
43         Likewise.
44         * decl.cs (MemberName.Name): Make readonly.
45         (MemberName.FromDotted): New "constructor".
46         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
47         (MemberCore.Name): Compute from MemberName on demand.
48         (MemberCore.SetMemberName): Provide a way to change the
49         MemberName.
50         (MemberCore.AddToContainer): Don't take a fullname parameter.
51         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
52         fully qualified name of the container to the member name.
53         (TypeContainer.AddToTypeContainer): Use a fully qualified name
54         only if the type is a member of the root container.
55         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
56         MemberName.Left rather than searching for an embedded ".".
57         (PartialContainer.CreatePart): Update to changes in RootContext.
58         (MemberBase.ShortName): Turn into a property.  Use
59         MemberCore.SetMemberName.
60         (MemberBase.ExplicitInterfaceName): Remove.
61         (MemberBase.UpdateMemberName): Remove.
62         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
63         (PropertyBase.SetMemberName): New override.
64         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
65         (Tree.GetDecl): New.
66         (Tree.AllDecls): Rename from Decls.
67         * attribute.cs, enum.cs, report.cs: Update to changes.
68         * driver.cs (MainDriver): Use MemberName.FromDotted on
69         RootContext.MainClass.
70
71 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
72
73         * class.cs (FixedField.Define): Check for CS1664 and more sanity
74         checks.
75
76         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
77
78 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
79
80         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
81         property accessor modifiers.
82
83         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
84         fixed buffer attribute (CS1716).
85         (PropertyMethod.HasCustomAccessModifier): When property accessor
86         has custom modifier.
87
88         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
89         modifiers.
90         (PropertyExpr.DoResolveLValue): Add CS0272.
91
92 2005-03-17  Miguel de Icaza  <miguel@novell.com>
93
94         * convert.cs: When converting to a pointer, use the proper Conv.U
95         or Conv.I depending on the source data type.
96
97         * cs-tokenizer.cs: Make the size for large decimal constants,
98         fixes #72957.
99
100 2005-03-17  Martin Baulig  <martin@ximian.com>
101
102         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
103         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
104
105 2005-03-17  Martin Baulig  <martin@ximian.com>
106
107         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
108         to bool so we can return an error condition.
109         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
110         returned an error.
111
112 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
113
114         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
115         attributes.
116
117 2005-03-16  Raja R Harinath  <rharinath@novell.com>
118
119         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
120         Refactor to avoid traversing the list of assemblies, and to avoid
121         string concatenation.
122         * typemanager.cs (guid_attr_type): Remove.
123         (negative_hits, pointers, references): Remove hashes.
124         (type_hash): New.
125         (GetConstructedType): New.  Uses type_hash to handle constructed
126         types (arrays, references, pointers).
127         (GetReferenceType, GetPointerType): Use it.
128         (GetNestedType): New.  Uses type_hash to handle nested types of
129         reflected types.
130         (LookupType, LookupTypeDirect): Remove.
131         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
132         'types' hash and LookupTypeReflection directly.
133         (params_string, params_object): Use GetConstructedType.
134         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
135         top-level types.
136         (Namespace.Lookup): Use cached_types.
137         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
138         provided by old TypeManager.LookupType.
139         * rootcontext.cs (MakeFQN): Remove.
140         * decl.cs (DeclSpace.MakeFQN): Likewise.
141         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
142         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
143         TypeManager.GetConstructedType.
144         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
145
146 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
147
148         * class.cs (TypeContainer.CircularDepException) New nested
149         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
150
151         * cs-parser.jay: Reports CS1527 for any namespace element.
152
153         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
154         Added CS0407.
155
156         * expression.cs (ParameterReference.IsAssigned): Changed error to
157         CS0269.
158         (Error_WrongNumArguments): Moved CS0245 detection here.
159
160         * statement.cs (Return.Resolve): Add CS1622 report.
161
162 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
163
164         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
165
166 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
167
168         * attribute.cs expression.cs: Get rid of some allocations.
169
170 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
171
172         * doc.cs : just eliminate the latest change.
173
174 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
175
176         * doc.cs : commented out the latest change. It breaks xml-030.cs
177
178 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
179
180         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
181           fail. So invoke CreateType() in FindDocumentedType().
182
183 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
184
185         * cs-tokenizer.cs : added IsKeyword().
186         * doc.cs : Detect keyword incorrectly used as identifier.
187           Allow identifiers prefixed by @.
188
189 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
190
191         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
192         It caused exception in namespace resolving (again!).
193         
194         * class.cs (Class.ctor): Removed exit.
195         (PropertyMethod.ctor): ditto.
196         
197         * codegen.cs (Codegen.Reset): Reset static data.
198         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
199         
200         * cs-tokenizer.cs (Cleanup): Removed.
201         
202         * driver.cs (GetSystemDir): Rewrote to one line command.
203         It caused problem with unloaded dynamic modules.
204         (UnixParseOption): Removed Exit.
205         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
206         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
207         Now can be mcs used as library.
208         
209         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
210         empty location.
211         
212         * location.cs (Reset): Reset static data.
213         
214         * namespace.cs (Reset): Reset static data.
215         
216         * report.cs (Report.Reset): Reset static data.
217         
218         * rootcontext.cs (RootContext.Reset): Reset static data.
219         
220         * tree.cs (RootTypes.ctor): Use Location.Null
221         
222         * typemanager.cs (TypeManager.Reset): Reset static data.
223         (CoreLookupType): Removed Exit.
224         (TypeHandle.Reset): Reset static data.
225         
226 2005-03-10  Raja R Harinath  <rharinath@novell.com>
227
228         Fix #73516.
229         * typemanager.cs (ComputeNamespaces): Import namespaces from
230         referenced modules too.
231
232 2005-03-09  Raja R Harinath  <rharinath@novell.com>
233
234         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
235         than '.'.
236
237 2005-03-09  Raja R Harinath  <rharinath@novell.com>
238
239         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
240         enclosing DeclSpace.  This ensures that a name-lookup populates
241         more caches and there are fewer 'TypeExpression's.  Carve out
242         nested type lookup into ...
243         (LookupNestedTypeInHierarchy): ... this.
244
245 2005-03-09  Raja R Harinath  <rharinath@novell.com>
246
247         Clean up a few partial-class semantics.  
248         Fixes test-357.cs and cs1618-2.cs.
249         * cs-parser.jay (struct_declaration): Use 'current_class' as
250         parent of newly-created struct.  Remove call to Register ().
251         Use 'pop_current_class' to complete handing the current struct.
252         (interface_declaration): Likewise.
253         (class_declaration): Likewise.
254         (enum_declaration): Use 'current_class' as parent of newly created
255         enum.
256         (delegate_declaration): Likewise.
257         (pop_current_class): New function.  This is used to handle closing
258         up the 'current_class' and 'current_container', and pointing them
259         to the enclosing class/container.
260         (CSharpParser): Initialize 'current_class' too.
261         * decl.cs (MemberCore): Add check for invariant: a partial
262         container is not a parsed entity, and thus does not enclose any
263         parsed members.
264         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
265         (DeclSpace.BaseTypeExpr): Use it.
266         (DeclSpace.LookupType): Add check for invariant.
267         * class.cs (TypeContainer): Add check for invariant: a nested
268         class should have the same NamespaceEntry as its enclosing class.
269         (TypeContainer.EmitFieldInitializers): Make virtual.
270         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
271         MemberCore.
272         (TypeContainer.Register): Remove.
273         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
274         null.  Use TypeResolveEmitContext for resolving base types and
275         interfaces.  Move initialization of Parts.TypeBuilder here from
276         ...
277         (TypeContainer.DefineNestedTypes): ... here.
278         (PartialContainer): Take a Namespace not a NamespaceEntry.
279         (PartialContainer.Create): Don't use Register.  Call the
280         appropriate Add... function directly.
281         (ClassPart): Take both the PartialContainer and the enclosing
282         class as constructor arguments.
283         (ClassPart.EmitFieldInitializers): Override.
284         (ClassPart.PartFindNestedTypes): Remove.
285         (FieldBase.GetInitializerExpression): Resolve the initializer
286         expression in the emit context of the enclosing class.
287         * tree.cs (RootTypes): Remove Register ().
288         
289 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
290
291         * cs-parser.jay: Removed CS0134.
292         
293         * driver.cs: Removed CS1901.
294         
295         * expression.cs (SizeOf.DoResolve): Don't report CS0233
296         for predefined types.
297
298 2005-03-07  Duncan Mak  <duncan@novell.com>
299
300         * codegen.cs (Save):  Catch UnauthorizedAccessException as
301         well. Fixes bug #73454.
302
303 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
304
305         * cs-tokenizer.cs (xtoken): Add CS1035.
306         
307         * class.cs (MethodData.Define): Add CS0683.
308         (FieldMember.ctor): Add CS0681.
309
310 2005-03-07  Raja R Harinath  <rharinath@novell.com>
311
312         * ecore.cs (SimpleName.DoResolve): Rename from
313         SimpleName.DoResolveAllowStatic.
314         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
315         Pass 'intermediate' flag to MemberStaticCheck.
316         (SimpleName.MemberStaticCheck): Skip "static check" only in case
317         of "intermediate" lookups via MemberAccess.
318         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
319         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
320
321 2005-03-07  Raja R Harinath  <rharinath@novell.com>
322
323         Fix #73394.
324         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
325         slipped in because of variable names that are identical to a
326         builtin type's BCL equivalent ('string String;', 'int Int32;').
327         (PropertyExpr.EmitInstance): Likewise.
328
329 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
330
331         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
332         
333         * report.cs (warning_ignore_table): Made public.
334
335 2005-03-04  Raja R Harinath  <rharinath@novell.com>
336
337         Fix #73282.
338         * class.cs (MethodData.Emit): Pass 'container' to
339         container.GetObsoleteAttribute instead of 'container.Parent'.
340
341 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
342
343         * cs-parser.jay: Add 1534 error test.
344
345         * iterators.cs (Yield.CheckContext): Add error 1629.
346         (Iterator.ctor): Save unsafe modifier.
347         (MoveNextMethod.DoEmit): Restore unsafe context.
348
349         * namespace.cs (UsingAlias): Better error message.
350
351 2005-03-03  Dan Winship  <danw@novell.com>
352
353         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
354         the warning message [#73219]
355
356 2005-03-03  Raja R Harinath  <rharinath@novell.com>
357
358         Fix compile with MCS 1.0.0.0.
359         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
360         w_restore to not depend on string constant folding.
361
362 2005-03-03  Raja R Harinath  <rharinath@novell.com>
363
364         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
365         CS0246 check to users who passed 'silent = false'.
366         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
367         check.
368         (SimpleName.SimpleNameResolve): Update.
369         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
370         (MemberAccess.IdenticalNameAndTypeName): Update.
371         * doc.cs (FindDocumentedTypeNonArray): Update.
372
373 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
374
375         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
376         * parameters.cs (ComputeAndDefineParameters): Remove.
377         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
378         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
379         Use GetParameterInfo.
380
381 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
382
383         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
384
385 2005-03-02  Raja R Harinath  <rharinath@novell.com>
386
387         Unify DeclSpace.LookupType and DeclSpace.FindType.
388         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
389         is in charge of defining nested types on demand.
390         (DeclSpace.LookupType): Use it when the current_type is a
391         TypeBuilder.  Use LookupTypeDirect for reflected types.
392         (DeclSpace.FindType): Remove.
393         (DeclSpace.LookupInterfaceOrClass): Likewise.
394         (DeclSpace.DefineTypeAndParents): Likewise.
395         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
396         DeclSpace.LookupType.
397         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
398         * typemanager.cs (LookupType): Simplify.
399         (AddUserType): Remove type from negative_hits.
400         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
401         * class.cs (TypeContainer.FindMembers): Move handling of nested
402         types ...
403         (TypeContainer.FindMembers_NestedTypes): ... here.
404         (TypeContainer.FindNestedType): Implement override.
405         (ClassPart.FindNestedType): Delegate to PartialContainer.
406         (ClassPart.PartFindNestedType): Looks up the nested types of the
407         part alone.
408
409 2005-03-02  Martin Baulig  <martin@ximian.com>
410
411         * class.cs (TypeContainer.DoDefineMembers): We also need a default
412         static constructor in static classes.
413
414 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
415
416         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
417         sizeParamIndex is not specified.
418
419 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
420
421         Fix #73117
422         * report.cs (WarningMessage.IsEnabled): Missing null check.
423
424 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
425
426         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
427         in the fields and not in the properties.
428
429 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
430
431         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
432         fields as well.
433
434 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
435
436         * attribute.cs: Small refactoring (improved robustness).
437         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
438         (ValidateGuid): Removed.
439         (Resolve): Removed referenced to above mentioned.
440         (GetAttributeUsage): Made private and changed to work without
441         class assistance.
442         (GetIndexerAttributeValue): Don't crash.
443         (GetConditionalAttributeValue): Ditto.
444         (GetClsCompliantAttributeValue): Ditto.
445         (ExtractSecurityPermissionSet): All attributes exceptions are
446         error 648.
447         (GetPropertyValue): New helper.
448         (GetMethodImplOptions): New method.
449         (DefinePInvokeMethod): Reuse common code. Implemented handling of
450         some missing properties.
451         
452         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
453         (Method.ApplyAttributeBuilder): Updated.
454         
455         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
456         exception.
457
458 2005-02-28  Raja R Harinath  <rharinath@novell.com>
459
460         Fix #73052.
461         * report.cs (Report.SymbolRelatedToPreviousError): Handle
462         non-simple types (array, pointer, reference).
463
464 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
465
466         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
467
468         * class.cs (MethodCore.IsDuplicateImplementation): Special error
469         for operators.
470         (Method.CheckBase): Catch wrong destructor here.
471         (MethodData.Define): Add errors 550, 668.
472
473         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
474
475         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
476
477         * pending.cs (VerifyPendingMethods): Add error 551.
478
479         * typemanager.cs (CSharpName): Next error report helper.
480
481 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
482
483         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
484         attributes. Removed useless attribute double check.
485         It saves almost 2MBs for corlib.
486
487 2005-02-25  Raja R Harinath  <rharinath@novell.com>
488
489         Fix #72924.
490         * statement.cs (ExpressionStatement.Resolve): Make robust to being
491         called twice in case of error.
492
493 2005-02-23  Chris Toshok  <toshok@ximian.com>
494
495         Fix compiler portions of #72827.
496         * statement.cs (Block.Emit): call Begin/EndScope on the
497         EmitContext instead of the ILGenerator.
498
499         * codegen.cs (EmitContext.BeginScope): new method, call
500         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
501         we have one.)
502         (EmitContext.BeginScope): same, but EndScope and CloseScope
503
504         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
505         offset and call the superclass's OpenScope(int) with it.
506         (SymbolWriter.CloseScope): get the current il
507         offset and call superclass's CloseScope(int) with it.
508
509 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
510
511         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
512         CS1677 for out and ref as well.
513
514         * class.cs (Method.Define): Add error CS1599 detection.
515         
516         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
517         
518         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
519         
520         * delegate.cs (Delegate.Define): Add error CS1599 detection.
521         
522         * support.cs.cs (ModifierDesc): New helper method.
523
524 2005-02-23  Raja R Harinath  <rharinath@novell.com>
525             Abin Thomas  <projectmonokochi@rediffmail.com>
526             Anoob V E  <projectmonokochi@rediffmail.com>
527             Harilal P R  <projectmonokochi@rediffmail.com>
528
529         Fix #57851, #72718.
530         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
531         MemberLookup (used for error reporting) actually returns a result.
532         Fix error report number (122, not 112).
533
534 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
535             Anoob V E  <projectmonokochi@rediffmail.com>
536             Harilal P R  <projectmonokochi@rediffmail.com>
537
538         Fix #71134.
539         * pending.cs (PendingImplementation.GetAbstractMethods):
540         Find NonPublic members too.
541
542 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
543
544         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
545         Fixed error 217.
546         
547         * class.cs (MethodCore.CheckMethodAgainstBase):
548         Add error 239 report.
549
550 2005-02-21  Raja R Harinath  <rharinath@novell.com>
551
552         Fix #68955.
553         * expression.cs (Invocation.IsApplicable): Make public.
554         (Invocation.IsParamsMethodApplicable): Likewise.
555         * delegate.cs (Delegate.VerifyApplicability): Don't use
556         Invocation.VerifyArgumentCompat for parameter applicability
557         testing.  Use Invocation.IsApplicable and
558         Invocation.IsParamsMethodApplicable.
559
560 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
561
562         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
563         
564         * class.cs (Operator.Define): Add error 217 report.
565         
566 2005-02-21  Raja R Harinath  <rharinath@novell.com>
567
568         * namespace.cs (UsingEntry.Resolve): Undo change below.
569
570 2005-02-21  Raja R Harinath  <rharinath@novell.com>
571
572         Fix #72756.
573         * ecore.cs (Expression.MemberLookupFailed): Add argument to
574         disable the error message when the extended MemberLookup also
575         fails.
576         (Expression.MemberLookupFinal): Update.
577         (SimpleName.DoSimpleNameResolve): Update.
578         * expression.cs (MemberAccess.ResolveNamespaceOrType):
579         Don't use MemberLookupFinal.
580         (New.DoResolve): Update.
581         (BaseAccess.CommonResolve): Update.
582
583 2005-02-21  Raja R Harinath  <rharinath@novell.com>
584
585         Fix #72732.
586         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
587         occured previously, don't resolve again.
588
589 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
590
591         Fix #69949
592         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
593         argument. Call ResolveAttributeUsage for unresolved.
594         when types doesn't match ctor arguments.
595         
596         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
597         for nested attribute classes.
598         (Class.attribute_usage): Removed.
599         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
600         for attribute class.
601         
602         * ecore.cs (IsAttribute): Removed.
603         
604         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
605         
606         * rootcontext.cs (RegisterAttribute): Removed, attributes are
607         now normal types.
608         (attribute_types): Removed.
609         (EmitCode): Global attributes are emited as the latest.
610
611 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
612
613         * class.cs (EmitFieldInitializers): Don't emit field initializer
614         for default values when optimilization is on.
615         
616         * constant.cs (Constant.IsDefaultValue): New property.
617         
618         * driver.cs: Add /optimize handling.
619         
620         * constant.cs,
621         * ecore.cs,
622         * literal.cs: Implement new IsDefaultValue property.
623         
624         * rootcontext.cs (Optimize): New field, holds /optimize option.
625
626 2005-02-18  Raja R Harinath  <rharinath@novell.com>
627
628         Fix crasher in re-opened #72347.
629         * namespace.cs (Namespace.Lookup): Return null if
630         DeclSpace.DefineType returns null.
631
632         Fix #72678.
633         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
634
635 2005-02-18  Raja R Harinath  <rharinath@novell.com>
636
637         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
638         now returns null if it cannot resolve to an lvalue.
639         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
640         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
641         returned null.  Remove check for SimpleName.
642         (EventExpr.DoResolveLValue): New.
643         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
644         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
645         error from ...
646         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
647         avoid CS0131 error.
648         (Unary.ResolveOperator): Move CS0211 check ...
649         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
650         CS0131 error.
651         (Unary.DoResolveLValue): Simplify.
652         (AddressOf.DoResolveLValue): New.
653         (ArrayAccess.DoResolveLValue): New.
654
655 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
656
657         * attribute.cs (Attribute.Resolve): Add arguments casting for
658         when types doesn't match ctor arguments.
659
660 2005-02-16  Raja R Harinath  <rharinath@novell.com>
661
662         Fix parts of #63202.
663         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
664         lookup of operator in base type.  Ensure that all checks happen
665         when the operator resolves to an "op_..." method.
666
667 2005-02-15  Raja R Harinath  <rharinath@novell.com>
668
669         Fix #71992.
670         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
671         'ignore_cs0104' parameter.  Pass it to ...
672         (NamespaceEntry.Lookup): ... this.
673         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
674         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
675         (TypeLookupExpression.DoResolveAsTypeStep): Update.
676         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
677         Update.  Request that cs0104 errors be ignored.
678         (ComposedCast.ResolveAsTypeStep): Update.
679
680 2005-02-14  Raja R Harinath  <rharinath@novell.com>
681
682         Fix #59209.
683         * expression.cs (Invocation.BetterFunction): Remove support for
684         comparing virtual functions and their overrides.
685         (Invocation.IsOverride): New.
686         (Invocation.OverloadResolve): Don't consider 'override' functions
687         during candidate selection.  Store them in a lookaside list.
688         If the selected method is a 'virtual' function, use the list to
689         find any overrides that are closer to the LHS type.
690
691 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
692
693         * expression.cs (New.DoResolve): Add complex core type reduction.
694         (New.Constantify): Converts complex core type syntax like 'new int ()'
695         to simple constant.
696         
697 2005-02-14  Raja R Harinath  <rharinath@novell.com>
698
699         * decl.cs (EntryType.EntryType): New constructor to create an
700         updated copy of a cache entry.
701         (MemberCache.AddMethods): Use it.
702         (MemberCache.ClearDeclaredOnly): Remove.
703         (MemberCache.MemberCache): Update.
704
705 2005-02-11  Miguel de Icaza  <miguel@novell.com>
706
707         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
708         variable.  This one is represents the actual low-level declaration
709         of the method, as opposed to the semantic level `IsStatic'.   
710
711         An anonymous method which is hosted into a static method might be
712         actually an instance method.  IsStatic would reflect the
713         container, while MethodIsStatic represents the actual code
714         generated.
715
716         * expression.cs (ParameterReference): Use the new MethodIsStatic
717         instead of IsStatic.
718
719         * anonymous.cs (AnonymousMethod.Compatible): Pass the
720         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
721         set on the current EmitContext. 
722
723         * expression.cs (Cast): Overload DoResolveLValue so we can pass
724         resolve our casted expression as an LValue.  This triggers the
725         proper LValue processing that is later required by Assign.
726
727         This fixes 72347.
728
729         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
730
731 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
732
733         C# 2.0 Fixed buffer implementation
734
735         * anonymous.cs: Update after RegisterHelperClass renaming.
736
737         * attribute.cs (AttributeTester.fixed_buffer_cache):
738         Cache of external fixed buffers.
739         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
740         implementation if field is fixed buffer else null.
741
742         * class.cs
743         (TypeContainer.AddField): Accept FieldMember instead of Field.
744         (FieldBase.IsFieldClsCompliant): Extracted code from
745         VerifyClsCompliance descendant customization.
746         (FixedField): New class handles fixed buffer fields.
747         (FixedFieldExternal): Keeps information about imported fixed
748         buffer.
749         (IFixedField): Make access to internal or external fixed buffer
750         same.
751
752         * cs-parser.jay: Add fixed buffer parsing.
753
754         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
755         buffer.
756
757         * expression.cs (Indirection): Extended implementation to accept
758         fixed buffer field.
759         (PointerArithmetic.Emit): Get element from fixed buffer as well.
760         (ElementAccess.MakePointerAccess): Get type as parameter.
761         (DoResolve): Add fixed buffer field expression conversion.
762         (DoResolveLValue): Ditto.
763         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
764         (ArrayPtr): Derives from FixedBufferPtr.
765         (ArrayPtr.Emit): Add extra emit for array elements.
766
767         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
768
769         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
770         for compiler generated types.
771         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
772
773         * statement.cs (Fixed): Refactored to be easier add fixed buffer
774         and consume less memory.
775         (Fixed.Resolve): Add fixed buffer case.
776
777         * typemanager.cs (compiler_generated_attr_ctor,
778         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
779         (HasElementType): Add our own implementation to work on every
780         runtime.
781
782 2005-02-11  Miguel de Icaza  <miguel@novell.com>
783
784         * anonymous.cs (CaptureContext): Track whether `this' has been
785         referenced.   
786
787         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
788         only captured `this' if it was implicitly done (instance
789         methods/variables were used). 
790
791         * codegen.cs (EmitContext.CaptureThis): New method to flag that
792         `this' must be captured.
793
794 2005-01-30  Miguel de Icaza  <miguel@novell.com>
795  
796         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
797         is null it means that there has been no need to capture anything,
798         so we just create a sibling.
799
800         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
801
802         Just a partial fix.  The other half is fairly elusive.
803         
804 2005-02-10  Raja R Harinath  <rharinath@novell.com>
805
806         Fix #52586, cs0121-4.cs.
807         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
808         and return a hashtable.
809         (MemberCache.ClearDeclaredOnly): New.
810         (MemberCache.MemberCache): Update to change.  Make a deep copy of
811         the method_hash of a base type too.
812         (MemberCache.AddMethods): Adapt to having a deep copy of the base
813         type methods.  Overwrite entries with the same MethodHandle so
814         that the ReflectedType is correct.  The process leaves in base
815         virtual functions and their overrides as distinct entries.
816         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
817         matters since it was boxed in a ArrayList before.
818         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
819         modifier.
820         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
821         case of a virtual function and its override (choose the overload
822         as better).
823         (Invocation.OverloadResolve): Avoid 'override' members during
824         'applicable_type' calculation.
825
826 2005-02-09  Raja R Harinath  <rharinath@novell.com>
827
828         Combine two near-redundant caches.
829         * typemanager.cs (method_params): Rename from method_internal_params.
830         (TypeManager.GetParameterData): New.  Replace
831         Invocation.GetParameterData.
832         (TypeManager.LookupParametersByBuilder): Remove.
833         * expression.cs (Invocation.method_parameter_cache): Remove.
834         (Invocation.GetParameterData): Remove.
835         Update to changes.
836         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
837         Update to changes.
838
839 2005-02-08  Raja R Harinath  <rharinath@novell.com>
840
841         Fix #72015.
842         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
843         TypeManager.multicast_delegate_type is null, resolve it by looking
844         up "System.MulticastDelegate".
845         * rootcontext.cs (RootContext.ResolveCore): Simplify.
846
847 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
848             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
849             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
850
851         Fix cs0164.cs.
852         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
853         (LabeledStatement.AddReference): New.  Set 'referenced'.
854         (Goto.Resolve): Use it.
855
856 2005-02-05  John Luke  <john.luke@gmail.com>
857
858         * driver.cs: remove duplicate -doc line in Usage ()
859
860 2005-02-04  Raja R Harinath  <rharinath@novell.com>
861
862         * location.cs (Location.AddFile): Fix CS2002 error report.
863
864 2005-02-02  Martin Baulig  <martin@ximian.com>
865
866         * delegate.cs (Delegate.DefineType): Report an internal error if
867         TypeManager.multicast_delegate_type is null.  See bug #72015 for
868         details.        
869
870 2005-02-02  Raja R Harinath  <rharinath@novell.com>
871
872         Fix a crasher in a variant of #31984.
873         * const.cs (Constant.CheckBase): New override that defers the
874         new-or-override check in case the base type hasn't been populated
875         yet.
876         (Constant.Define): Ensure the new-or-override check is performed.
877
878 2005-02-01  Duncan Mak  <duncan@ximian.com>
879
880         * const.cs (LookupConstantValue): Check that `ce' is not null
881         before calling GetValue ().
882
883 2005-02-01  Raja R Harinath  <rharinath@novell.com>
884
885         Fix test-334.cs (#69519).
886         * cs-parser.jay (using_alias_directive): Pass in an expression to
887         NamespaceEntry.UsingAlias.
888         (using_namespace_directive): Pass in an expression to
889         NamespaceEntry.Using.
890         (namespace_name): Don't flatten to a string.
891         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
892         (NamespaceEntry.AliasEntry.Resolve): Lookup using
893         ResolveAsTypeStep.
894         (NamespaceEntry.UsingEntry): Likewise.
895         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
896         changes.
897         (NamespaceEntry.LookupForUsing): Remove.
898         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
899         names.
900         (NamespaceEntry.Lookup): Remove support for dotted names.
901
902 2005-02-01  Raja R Harinath  <rharinath@novell.com>
903
904         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
905         split into two.
906         (NamespaceEntry.ImplicitParent): Compute on demand.
907         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
908         parallels the current.
909         (NamespaceEntry.LookupForUsing): Use it.
910         (NamespaceEntry.Lookup): If the current namespace-entry is
911         implicit, don't search aliases and using tables.
912
913 2005-02-01  Raja R Harinath  <rharinath@novell.com>
914
915         Fix #31984.
916         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
917         BaseCache here.
918         (TypeContainer.BaseCache): Compute on demand.
919         (TypeContainer.FindMembers): Define constants and types if they're
920         not already created.
921         (FieldMember.Define): Move resetting of ec.InUnsafe before error
922         check.
923         * const.cs (Constant.Define): Make idempotent.
924
925 2005-01-29  Miguel de Icaza  <miguel@novell.com>
926
927         * pending.cs: Produce better code (no nops produced by using Ldarg
928         + value).
929         
930         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
931         i - 1' it should be arg + 1.
932
933         Fixes bug #71819.
934
935 2005-01-28  Raja R Harinath  <rharinath@novell.com>
936
937         * attribute.cs (Attribute.CheckAttributeType): Make private
938         non-virtual.
939         (Attribute.ResolveType): Make virtual.
940         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
941         handling of RootContext.Tree.Types.
942
943 2005-01-27  Raja R Harinath  <rharinath@novell.com>
944
945         Update attribute-handling to use the SimpleName/MemberAccess
946         mechanisms.
947         * cs-parser.jay (attribute): Pass in an expression to the
948         constructors of Attribute and GlobalAttribute.
949         * attribute.cs (Attribute): Take an expression for the name.
950         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
951         passed in attribute name expression.
952         (Attribute.CheckAttributeType): Use it.
953         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
954         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
955         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
956         argument to prevent error messages if the lookup fails.
957
958 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
959
960         * expression.cs (Indirection): Implemented IVariable interface
961         to support indirection in AddressOf operator.
962         (PointerArithmetic.Emit): Add optimalization for case where
963         result can be precomputed.
964
965 2005-01-26  Martin Baulig  <martin@ximian.com>
966
967         * class.cs (TypeContainer.AttributeTargets): Return the correct
968         AttributeTargets depending on our `Kind' instead of throwing an
969         exception; fixes #71632.
970
971 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
972
973         Fix #71257
974         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
975         constant members.
976
977 2005-01-25  Raja R Harinath  <rharinath@novell.com>
978
979         Fix #71602.
980         * expression.cs (MemberAccess.DoResolve): Don't complain with
981         cs0572 when the LHS of a member access has identical name and type
982         name.
983
984 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
985
986         Fix #71651, #71675
987         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
988         CreatePermission.
989         Create custom PermissionSet only for PermissionSetAttribute.
990
991 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
992
993         Fix #71649
994         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
995         delegates in static class.
996
997 2005-01-24  Martin Baulig  <martin@ximian.com>
998
999         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1000         merging an implicit block, just use its reachability.
1001
1002         * statement.cs (Block.Resolve): Make the unreachable code check
1003         work wrt. implicit blocks; see test-337 from #63842.
1004
1005 2005-01-21  Alp Toker  <alp@atoker.com>
1006  
1007         * cs-parser.jay: destructor_declaration's container is PartialContainer
1008         not Class when partial types are used, so use Kind prop instead of
1009         'is'.
1010         
1011 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
1012
1013         * cs-parser.jay: Improve error reporting when an interface
1014         declares new types.
1015
1016 2005-01-20  Dick Porter  <dick@ximian.com>
1017
1018         * support.cs: SeekableStreamReader fix from Sandor Dobos
1019         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
1020         chars are read.  Fixes bug 70369.
1021
1022 2005-01-20  Raja R Harinath  <rharinath@novell.com>
1023
1024         * cs-parser.jay (catch_clause): Simplify current_block handling
1025         somewhat.
1026
1027 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
1028
1029         * convert.cs (ImplicitStandardConversionExists): Synchronize the
1030         code with ImplicitStandardConversion to handle the implicit
1031         conversion of method groups into valid delegate invocations. 
1032
1033         The problem is that in parameter handling we were using this code
1034         path.  Fixes bug #64698
1035
1036 2005-01-19  Raja R Harinath  <rharinath@novell.com>
1037
1038         * cs-parser.jay: Fix several infelicities.
1039         - Avoid assigning to the parser value stack.  Code like 
1040           '$3 = null' is unclean.  Synthesize a value for the code block
1041           instead. 
1042         - Avoid using oob_stack for storing location information.  Use ...
1043         (_mark_): ... this.  New (empty) rule.  Saves the current location
1044         in $$.
1045         (foreach_statement): Avoid using oob_stack for current_block
1046         handling.  Use technique used in for_statement and
1047         using_statement.  Synthesize a value for the code block to store
1048         additional intermediate information.
1049
1050 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
1051
1052         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
1053         of a different type is only allowed to private fields of a
1054         containing type, not on fields of a base class.
1055
1056         See test-174.cs and error cs0122-9.cs
1057
1058 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1059
1060         Fix test-335.cs (bug #58126).
1061         * cs-parser.jay (argument): Split out non-expression parts of the
1062         rule into 'non_simple_argument'.
1063         (invocation_expression): Support parenthesized invocations with
1064         multiple arguments, and with single non-simple arguments.
1065
1066 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1067
1068         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
1069         places.
1070
1071 2005-01-12  Raja R Harinath  <rharinath@novell.com>
1072
1073         Fix cs0038-1.cs, cs1640-6.cs.
1074         * ecore.cs (Expression.Resolve): Remove special-case for
1075         SimpleName in error-handling.
1076         (Expression.almostMatchedMembers): Relax access permission to
1077         protected.
1078         (Expression.MemberLookupFailed): Handle duplicates in
1079         almostMatchedMembers list.
1080         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
1081         * expression.cs (New.DoResolve): Report CS1540 for more cases.
1082         * typemanager.cs (GetFullNameSignature): Use the MethodBase
1083         overload if the passed in MemberInfo is a MethodBase.
1084
1085 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
1086
1087         Fix #70749
1088         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
1089         for non-CAS & merge permission sets properly.
1090
1091 2005-01-11  Raja R Harinath  <rharinath@novell.com>
1092
1093         Improve standard-compliance of simple name and member access 
1094         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
1095         * ecore.cs (FullNamedExpression): New abstract base class 
1096         for Namespaces and TypeExpressions.
1097         (ResolveFlags.SimpleName): Remove.
1098         (SimpleName): Remove support for dotted names.
1099         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
1100         DeclSpace.FindType and DeclSpace.LookupType.
1101         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
1102         (Expression.ExprClassName): Make member function.
1103         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
1104         a namespace.  Remove creation of dotted "SimpleName"s.
1105         (MemberAccess.DoResolve): Likewise.
1106         * decl.cs (DeclSpace.Cache): Make private.
1107         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
1108         (DeclSpace.FindType): Update.
1109         (DeclSpace.LookupType): Move here from RootContext.  Return a 
1110         FullNamedExpression.
1111         * namespace.cs (Namespace): Derive from FullNamedExpression
1112         so that it can be part of expression resolution.
1113         (Namespace.Lookup): Return an FullNamedExpression.
1114         (NamespaceEntry.LookupAlias): Lookup aliases only in current
1115         namespace.
1116         * rootcontext.cs (NamespaceLookup): Remove.
1117         (LookupType): Move to DeclSpace.
1118         * attribute.cs (CheckAttributeType): Update.
1119         * doc.cs (FindDocumentedType): Remove allowAlias argument.
1120         (FindDocumentedTypeNonArray): Likewise.
1121
1122 2005-01-11  Raja R Harinath  <rharinath@novell.com>
1123
1124         Fix cs0509.cs, cs1632.cs.
1125         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
1126         is the same as IsInterface.
1127         (TypeContainer.GetClassBases): Likewise.
1128         * statement.cs (LabeledStatement.ig): New field.
1129         (LabeledStatement.LabelTarget): Save ILGenerator which created the
1130         label.
1131         (LabeledStatement.DoEmit): Check that the label was created with
1132         the same ILGenerator.
1133
1134 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1135
1136         Fix #71058
1137         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
1138         accessors to its properties.
1139
1140         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
1141         from accessors to property.
1142         
1143 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1144
1145         Fix #70722
1146         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
1147         only for overrides.
1148         
1149 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
1150
1151         * attribute.cs: Check for null and empty strings.  
1152
1153         I have lost another battle to Paolo.
1154
1155 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
1156
1157         Fix #70942
1158         * class.cs (PropertyMethod): Set Parent field in ctors.
1159         (SetMethod.InternalParameters): Add unsafe switch hack.
1160         Override MarkForDuplicationCheck where it is appropriate.
1161
1162         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
1163         It says whether container allows members with the same name.
1164         Base default is no.
1165         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
1166         Removed is_method parameter.
1167
1168 2005-01-06  Duncan Mak  <duncan@ximian.com>
1169
1170         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
1171         because the previous change led to incorrect reporting of CS1032
1172         ("Cannot define/undefine preprocessor symbols after first token in
1173         file"). Instead of using `tokens_seen' as the only flag that
1174         triggers CS1040, introduce `comments_seen'. This new flag is used
1175         to signify having seen comments on the current line, so it is
1176         unset after a newline.
1177
1178 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1179
1180         * doc.cs : When searching for a type, find nested type too.
1181           This fixes bug #71040.
1182
1183 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1184
1185         * doc.cs :
1186           - Warn missing member comment on those classes which also does not
1187             have doc comments. Fixed bug #71041.
1188           - Don't warn missing doc comment on default constructor.
1189             Fixed bug #71042.
1190
1191 2005-01-06  Duncan Mak  <duncan@ximian.com>
1192
1193         * cs-tokenizer.cs (xtoken): After handling traditional C-style
1194         comments, set `tokens_seen' to true. This allows us to detect
1195         misplaced preprocessor directives (i.e. not at the beginning of
1196         the a line, nor after whitespaces). In that case, report error
1197         CS1040. This fixes bug #56460.
1198
1199         * cs-parser.jay (interface_member_declaration): Add checks for
1200         IsExplicitImpl, and report CS0541 error if an interface member is
1201         defined as an explicit interface declaration.
1202
1203 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
1204
1205         Fix #70817
1206         * class.cs (PropertyMethod): Set Parent field in ctors.
1207         (SetMethod.InternalParameters): Add unsafe switch hack.
1208         
1209         * decl.cs (MemberCore.Parent): Cannot be readonly.
1210
1211 2005-01-06  Raja R Harinath  <rharinath@novell.com>
1212
1213         * decl.cs (DeclSpace.ResolveType): Remove.
1214         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
1215         Merge in code from ...
1216         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
1217         * class.cs, enum.cs: Update to changes.
1218
1219 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
1220
1221         * anonymous.cs: Ensure that we init the scope of our parent if it
1222         has not been initialized yet.
1223
1224 2004-12-30  Duncan Mak  <duncan@ximian.com>
1225
1226         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
1227         if field.FieldBuilder is null. Fixes #70758.
1228
1229         * convert.cs: Fixed some typos and updated some of the comments.
1230         (ImplicitStandardConversionExists):
1231         (TryImplicitIntConversion): If `target_type' is an interface and
1232         the type of `ic' implements this interface, return true or a new
1233         BoxedCast instead of null. This fixes #70468.
1234
1235 2004-12-29  Duncan Mak  <duncan@ximian.com>
1236
1237         * expression.cs (Argument.Emit): Check that Expr is
1238         IMemoryLocation before casting to it, and report CS1510 otherwise.
1239
1240         This fixes #70402.
1241
1242 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
1243
1244         * statement.cs (Block.ThisVariable): remove the recursion here, to
1245         make the --profile more sane.
1246
1247 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
1248
1249         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
1250         assembly, by JB Evain.
1251
1252 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1253
1254         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
1255           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
1256         "parent" refers to enclosing type/class.  "base" refers to superclass.
1257
1258 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1259
1260         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1261         Ensure that we only have GlobalAttributes.
1262         * attribute.cs (Attribute.Emit): Make non-virtual.
1263         (GlobalAttribute.Emit): Remove.
1264         (Attribute.Resolve): Make virtual.
1265         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
1266         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
1267         the argument. Don't create one.
1268         (Attribute.GetObsoleteAttribute): Likewise.
1269         (Attribute.GetClsCompliantAttributeValue): Likewise.
1270         * class.cs, decl.cs: Update to changes.
1271
1272 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
1273
1274         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
1275         
1276         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
1277         
1278         * statement.cs (Foreach.Resolve): Add error 186 report.
1279
1280 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * expression.cs (Conditional.DoResolve): Add warning 429.
1283         
1284         * statement.cs (If.Resolve): Add warning 665.
1285
1286 2004-12-16  Raja R Harinath  <rharinath@novell.com>
1287
1288         New invariant: RootContext.Tree.Types.NamespaceEntry == null
1289         except when in the parser, and in GlobalAttribute.
1290         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
1291         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
1292         RootContext.Tree.Types.NamespaceEntry once work is done.
1293         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
1294         and resets RootContext.Tree.Types.NamespaceEntry.
1295
1296 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
1297
1298         * cs-parser.jay: Don't create a block for every variable.
1299
1300 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
1301
1302         * location.cs: Provide extra information.
1303
1304         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
1305         variables from the captured environment, it is the ldarg_0.
1306
1307 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1308
1309         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
1310         find a conclusion.
1311         
1312         * class.cs: Changed warning level for 169 to avoid developer
1313         displeasure from warning flooding. It will be changed back when they
1314         fix most of current BCL warnings.
1315         
1316         * RootContext.cs: Pushed default WarningLevel to 3.
1317         
1318         * statement.cs: Removed unused variable.
1319
1320 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1321
1322         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
1323         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
1324         Add error 502 report.
1325         (StaticClass.DefineType): Add error 441 report.
1326         (Class.AllowedModifiersProp): New virtual property as temporary
1327         extension to AllowedModifiers.
1328         (Class.DefineType): Add error 418 report. Moved ModFlags check here
1329         to share implementation with StaticClass and don't call virtual
1330         methods from ctor.
1331         
1332         * driver.cs (MainDriver): Add error 1558 test.
1333
1334         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1335         report. Moved error 36 test here.
1336
1337         * statement.cs (Throw.Resolve): Add error 724 report.
1338
1339         * typemanager.cs: Add out_attribute_type core type.
1340         
1341 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
1342
1343         * class.cs (TypeContainer.VerifyClsCompliance): Add error
1344         3018 report.
1345         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1346
1347         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1348         3017 report.
1349         
1350         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1351
1352         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
1353         Add error 3023 report.
1354         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1355
1356         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1357         implementation.
1358
1359 2004-12-12  John Luke  <john.luke@gmail.com>
1360
1361         * driver.cs (AddArgs): take -- into account when
1362         adding arguments, fixes bug 65710 
1363
1364 2004-12-12  Martin Baulig  <martin@ximian.com>
1365
1366         * expression.cs (Unary.TryReduceNegative): Added support for
1367         SByteConstant and ByteConstant.
1368         (Unary.Reduce): Check error values from TryReduceNegative().
1369
1370 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1371
1372         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1373         and report exception as error 182.
1374
1375 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1376
1377         * driver.cs (Main): Fix message when there are warnings.
1378
1379 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1380
1381         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1382
1383 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1384
1385         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1386         Reduced number of warnings.
1387         
1388         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1389
1390 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1391
1392         * driver.cs: Removed message.
1393
1394         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1395
1396 2004-12-08    <vargaz@freemail.hu>
1397
1398         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1399
1400 2004-12-08  Martin Baulig  <martin@ximian.com>
1401
1402         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1403         instead of a CS3002 for properties and indexer.
1404
1405 2004-12-08  Martin Baulig  <martin@ximian.com>
1406
1407         * decl.cs (MemberName.ToString): Make this work again.
1408
1409 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1410
1411         * attribute.cs (Resolve): Add error 591 detection.
1412
1413         * class.cs (FieldMember.Define): Add error 1547 detection.
1414         (Indexer.Define): Add error 620 detection.
1415         (Operator.Define): Add error 590 detection.
1416
1417         * ecore.cs: Missing argument for error 79.
1418
1419         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1420         detection.
1421
1422 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1423
1424         Fix #70106
1425         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1426         only.
1427
1428 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1429
1430         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1431           Some operator comments were suppressed.
1432         * doc.cs : Implicit/explicit operator name in doc comments are like
1433           "op_Explicit(type)~returnType", so added suffix handling.
1434
1435 2004-12-07  Martin Baulig  <martin@ximian.com>
1436
1437         * decl.cs
1438         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1439         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1440         (DeclSpace.ec): New protected field; store the EmitContext here.
1441         (DeclSpace.EmitContext): New public property; moved here from
1442         `TypeContainer'.
1443         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1444         EmitContext.
1445
1446         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1447         (Enum.Emit): Don't create a new EmitContext.
1448
1449         * delegate.cs (Delegate.DefineType): Always create the
1450         EmitContext.
1451
1452         * iterators.cs (Iterators.DefineIterator): Create a new
1453         EmitContext and store it in `ec'.
1454
1455 2004-08-24  Martin Baulig  <martin@ximian.com>
1456
1457         * typemanager.cs
1458         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
1459         this for accessibility checks.
1460         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
1461         IsNestedFamilyAccessible.
1462         (TypeManager.IsSubclassOf): New method, do what the name actually
1463         says.   
1464
1465 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1466
1467         Fix crash on cs0657-17.cs.
1468         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1469         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1470         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1471         the case where the NamespaceEntry gets overwritten.
1472
1473 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1474
1475         Fixed #69195, #56821
1476         * ecore.cs (ResolveBoolean): Tiny refactoring.
1477
1478         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1479         of right expression resolving when left is false constant and
1480         operator is LogicalAnd OR true constant and operator is LogicalOr.
1481
1482         * statement.cs (ResolveUnreachable): Always reports warning.
1483
1484 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1485
1486         * class.cs: Distinguish between 1721 and 1722 (just a little help
1487         for the programmer).
1488
1489 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1490
1491         * delegate.cs: Only allow this on new versions of the language. 
1492
1493 2004-12-02  Duncan Mak  <duncan@ximian.com>
1494
1495         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1496         Expression class.
1497         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1498         here as a static method. Take an additional bool out parameter
1499         `must_do_cs1540_check' for signaling to InstanceResolve.
1500         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1501         member field from PropertyExpr class and made it an argument of
1502         the method instead.
1503         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1504         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1505         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1506         and `remove_accessor' as well as InstanceResolve: report CS0122
1507         where applicable.
1508
1509         Fixes #70129.
1510
1511 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1512
1513         Fix test-327.cs, test-328.cs, and put in early infrastructure
1514         for eventually fixing #52697.
1515         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1516         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1517         from other methods.
1518         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1519         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1520         (VerifyUsing, error246): Update.
1521         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1522         'NamespaceEntry.LookupNamespaceOrType'.
1523
1524 2004-12-03  Martin Baulig  <martin@ximian.com>
1525
1526         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1527         method as our child, call AnonymousMethod.Compatible() on it.
1528
1529 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1530
1531         Disable XML documentation support in 'basic' profile.
1532         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
1533         Redirect XmlElement to System.Object.
1534         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
1535         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
1536         * mcs.exe.sources: Add doc-bootstrap.cs.
1537         * doc-bootstrap.cs: New file.  Contains empty stub implementation
1538         of doc.cs.
1539
1540 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1541
1542         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1543           comments are allowed.
1544
1545 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1546
1547         * delegate.cs: Add checks for subtypes in paramaters and return values
1548         in VerifyMethod () to add support for Covariance/Contravariance
1549         in delegates.
1550         
1551 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1552
1553         * report.cs: Remove extra closing parenthesis.
1554
1555         * convert.cs (Error_CannotImplicitConversion): If the name of the
1556         types are the same, provide some extra information.
1557
1558         * class.cs (FieldBase): Use an unused bit field from the field to
1559         encode the `has_offset' property from the FieldMember.  This saves
1560         a couple of Ks on bootstrap compilation.
1561
1562         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1563         method as our child, return the AnonymousMethod resolved
1564         expression.
1565
1566         * expression.cs (New.DoResolve): Allow return values from
1567         NewDelegate to also include AnonymousMethods.
1568
1569         Fixes #70150.
1570
1571 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1572
1573         Fix bug #70102
1574         * attribute.cs (Resolve): Improved implementation of params
1575         attribute arguments.
1576
1577         * support.cs (ParameterData): Add HasParams to be faster.
1578
1579 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1580
1581         all things are for /doc support:
1582
1583         * doc.cs: new file that supports XML documentation generation.
1584         * mcs.exe.sources: added doc.cs.
1585         * driver.cs:
1586           Handle /doc command line option.
1587           Report error 2006 instead of 5 for missing file name for /doc.
1588           Generate XML documentation when required, after type resolution.
1589         * cs-tokenizer.cs:
1590           Added support for picking up documentation (/// and /** ... */),
1591           including a new XmlCommentState enumeration.
1592         * cs-parser.jay:
1593           Added lines to fill Documentation element for field, constant,
1594           property, indexer, method, constructor, destructor, operator, event
1595           and class, struct, interface, delegate, enum.
1596           Added lines to warn incorrect comment.
1597         * rootcontext.cs :
1598           Added Documentation field (passed only when /doc was specified).
1599         * decl.cs:
1600           Added DocComment, DocCommentHeader, GenerateDocComment() and
1601           OnGenerateDocComment() and some supporting private members for
1602           /doc feature to MemberCore.
1603         * class.cs:
1604           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1605         * delegate.cs:
1606           Added overriden DocCommentHeader.
1607         * enum.cs:
1608           Added overriden DocCommentHeader and GenerateDocComment().
1609
1610 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1611
1612         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1613         unwrapping the enumeration values, chain to
1614         DoConstantNumericPromotions again, so we can promote things to the
1615         fundamental types (takes care of enums that are bytes, sbytes).
1616
1617         Fixes bug #62054.
1618
1619 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1620
1621         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1622         Fix long-standing bug in type-lookup.  Use FindType instead of
1623         LookupType when ec.ResolvingTypeTree.
1624         (Attribute.ResolveType, Attribute.Resolve)
1625         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1626         Update to changes.
1627         (Attributes.Search): Remove internal version.  Update.
1628         (Attributes.SearchMulti): Update.
1629         (Attributes.GetClsCompliantAttribute): Remove.
1630         (Attributes.GetIndexerNameAttribute): Remove.
1631         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1632         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1633         * class.cs (Indexer.Define): Likewise.
1634
1635 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1636
1637         Fix bug #68790
1638         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1639         MarshallByReference members access.
1640
1641         * expression.cs: Use CheckMarshallByRefAccess;
1642         Better error CS0197 message.
1643
1644         * report.cs: Print whole related error message.
1645
1646 2004-11-30  Raja R Harinath  <rharinath@novell.com>
1647
1648         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
1649         the current directory to help debugging.
1650
1651 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1652
1653         * class (GetClassBases): Better error 60 report.
1654         (EventProperty): Disabled warning 67 detection.
1655
1656 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1657
1658         Fix bug #60324
1659         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1660
1661         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1662         precise values.
1663
1664 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1665
1666         Fix bug #49488
1667         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1668
1669         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1670
1671 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1672
1673         * attribute.cs (Attribute.Resolve): Refine error reporting and
1674         report a cs0117 if the identifier does not exist, to distinguish
1675         from 0617 which is a miss-use of the actual identifier.
1676
1677         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1678         between cs0070 and cs0079.
1679
1680         * class.cs (MemberBase.DoDefine): When reporting a wrong
1681         accessibility level, we use MethodCore to compare instead of
1682         Method (this was a regression in some refactoring effort).
1683
1684         So now we correctly report cs0056 again.
1685
1686         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1687         testing the target_type (which was known to be object_type) and
1688         not the source type (which is anonymous_method).
1689
1690         Fixed reporting of error cs1660.
1691
1692         * expression.cs (UserCast.Source): Expose the underlying cast.
1693
1694         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1695         allowed types to find a match to int32 first (most common).
1696
1697         In addition, it ignores any ImplicitUserConversions that did an
1698         internal implicit conversion (as the switch statement allows only
1699         one integral conversion to exist).
1700
1701         * class.cs (PartialContainer.Create): rename `name' to
1702         `member_name' for clarity.  Then replace the string calls with a
1703         call to MemberName.GetPartialName, as now using
1704         MemberName.ToString is an error (this is due to the side effects
1705         it had, that were fixed in the past).
1706
1707         This will restore the error reporting on a number of partial class
1708         errors that were missusing this (and getting an exception as a
1709         results, which is now just a plain textual warning, because
1710         yyparse debug output would crash otherwise).
1711
1712 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1713
1714         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1715
1716 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1717
1718         * rootcontext.cs (LookupType): Make sure to cache lookups that
1719         don't give us a negative result. This saves about 5% of corlib
1720         compilation time.
1721
1722 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1723
1724         * report.cs (AbstractMessage.Print): messages are sent to stderr
1725
1726         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1727         non-interface in the list of interfaces (at this point, either
1728         parent was properly set, or a base class is being listed in the
1729         interfaces section).
1730
1731         This flags error 1722, and resolves the crash from bug 69259.
1732
1733 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1734
1735         * statement.cs (Using.EmitExpressionFinally): make this work right
1736         for valuetypes. Fixes 69926.
1737
1738 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1739
1740         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1741         converted to an enum" here, before we try to change the underlying
1742         type.  This code exists, but it is a different code path than the
1743         one used while encoding constants.
1744
1745         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1746         old bug: when converting from the null literal to a pointer,
1747         return an EmptyCast, not the NullLiteral.
1748
1749         This fixes #69921, the recent null_type changes probably made this
1750         bug more prominent.
1751
1752         (ImplicitReferenceConversionExists): In addition, resynchronized
1753         the code here, so it matches the same code in
1754         ImplicitReferenceConversionExists for the `from any class-type S
1755         to any interface-type T'.
1756         
1757
1758 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1759
1760         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1761
1762 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1763
1764         * cs-parser.jay: Use verbosity accordingly. 
1765
1766 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1767
1768         * expression.cs (Unary.ResolveOperator): Do not report warning;
1769         AddressOf reads from variable.
1770         
1771         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1772
1773 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1774
1775         Fix bug #69462
1776
1777         * attribute.cs (Attributable): Removed CheckTargets.
1778         (Attributes.Emit): Explicit attribute targets are tested here.
1779
1780         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1781         not enabled for interfaces.
1782
1783         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1784         (GetAssemblyName): Ouch next bug there.
1785
1786 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1787
1788         * expression.cs: Error 275 added.
1789         
1790 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1791
1792         Fix bug #69177 (Implemented decimal constant support)
1793
1794         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1795         (BinaryFold): Add DecimalConstant.
1796
1797         * const.cs (Define): Decimal constant 
1798         (is not constant.
1799         (ChangeType): Add decimal type handling.
1800         (LookupConstantValue): Don't set value for decimal type but
1801         emit DecimalConstantAttribute. Needed for constant optimization.
1802
1803         * constant.cs (ToDecimal): New method.
1804         (ConvertToDecimal): New method.
1805         (IntConstant): Implemented ConvertToDecimal.
1806         (DecimalConstant.Emit): Emit optimized version for decimals in
1807         int range.
1808
1809         * expression.cs (ResolveOperator): Changed order of constant
1810         reduction to work correctly with native types which have
1811         overloaded operators.
1812         (ResolveMemberAccess): Extract constant value from attribute
1813         for decimal type.
1814
1815         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1816
1817         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1818         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1819         (ChangeType): Decimal is special.
1820         (TypeToCoreType): Add decimal type.
1821
1822 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1823
1824         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1825         decimal types.
1826
1827 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1828
1829         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1830         test cs1667-5.cs.
1831
1832 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1833
1834         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1835
1836         * pending.cs (PendingImplementation): Grab only interfaces.
1837
1838 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1839
1840         * statement.cs (ForeachHelperMethods): Add location member and
1841         error 202 detection.
1842
1843 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1844
1845         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
1846         automatically handled by executable.make.
1847         (PROGRAM): Make profile-specific.
1848
1849 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1850
1851         * expression.cs (DoResolveBase): Fixed wrong warning for out
1852         variables.
1853
1854 2004-11-18  Martin Baulig  <martin@ximian.com>
1855
1856         Merged latest changes into gmcs.  Please keep this comment in
1857         here, it makes it easier for me to see what changed in MCS since
1858         the last time I merged.
1859
1860 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1861
1862         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1863         (TypeHandle.GetMemberCache): New.
1864         (TypeHandle.TypeHandle): Update.
1865         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1866         (TypeManager.LookupParentInterfacesCache):
1867         Rename from LookupInterfaceCache.  Optimize slightly.
1868         (TypeManager.MemberLookup_FindMembers): Update.
1869         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1870         multi-type variant.
1871         (AddCacheContents): Rename from AddHashtable.
1872         * class.cs (TypeContainer.parent_container): Remove.
1873         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1874         (TypeContainer.DoDefineMembers): Don't initialize it.
1875         Update to name changes.
1876         
1877 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1878
1879         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1880         that factors the code to check access modifiers on override.  
1881
1882         (PropertyBase): Use the code here.
1883
1884         Patch from Lluis S'anchez, fixes bug #69361.
1885
1886 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1887
1888         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1889         routine that is used to report the use of a captured variable
1890         whose address has been taken.
1891
1892         There are two checks: one when variables are being captured and
1893         the other check is when the address of a variable is taken. 
1894         
1895         (because an anonymous methods might be resolved before *or* after
1896         the address has been taken) and 
1897
1898         * expression.cs (Conditional.DoResolve): Remove the special
1899         casing that Martin added to trueExpr and falseExpr being both
1900         NullLiteral.  We get the right behavior now just by introducing
1901         the null_type into the compiler. 
1902
1903         * convert.cs (ExplicitConversion): Change the code to use
1904         null_type instead of testing `expr is NullLiteral'.
1905         (ImplicitConversionStandard): use null_type too.
1906         (ImplicitReferenceConversionExists): use null_type too.
1907         (ImplicitReferenceConversion): use null_type too.
1908
1909         * literal.cs: The type of `NullLiteral' is now null_type instead
1910         of object_type. 
1911         (Resolve): Set the type here.
1912
1913         * typemanager.cs: Introduce null_type.
1914
1915 2004-11-17  Martin Baulig  <martin@ximian.com>
1916
1917         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1918         direction, like FindMembers() does.  Fixes #69546, testcase is in
1919         test-315.cs.    
1920
1921 2004-11-16  Martin Baulig  <martin@ximian.com>
1922
1923         This is based on a patch from Marek Safar, see bug #69082.
1924         Fixes bugs #63705 and #67130.
1925
1926         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1927         method; create a MemberCache for an interface type and cache the
1928         result.
1929
1930         * decl.cs (IMemberContainer.ParentContainer): Removed.
1931         (IMemberContainer.ParentCache): New property.
1932         (MemberCache.SetupCacheForInterface): Removed.
1933         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1934         to create a cache for an interface's "parent".
1935
1936         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1937         interfaces too.
1938
1939 2004-11-16  Martin Baulig  <martin@ximian.com>
1940
1941         Merged back from gmcs; these changes already went into gmcs a
1942         couple of weeks ago.
1943
1944         * typemanager.cs
1945         (TypeManager.AddUserType): Removed the `ifaces' argument.
1946         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
1947         `TypeExpr []'.
1948         (TypeManager.AddUserInterface): Removed.
1949         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
1950         `TypeExpr []'.
1951         (TypeManager.GetInterfaces): Likewise.
1952         (TypeManager.GetExplicitInterfaces): Likewise.
1953
1954         * ecore.cs (TypeExpr.GetInterfaces): Removed.
1955
1956         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
1957         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
1958
1959 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1960
1961         * statement.cs: Avoid adding bools to a hashtable.
1962
1963 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1964
1965         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1966         calling an unsafe method from a safe location.
1967
1968 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1969
1970         Fix #69167
1971         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1972
1973 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1974
1975         * namespace.cs (VerifyUsing): use GetPartialName instead of
1976         ToString. 
1977
1978 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1979
1980         * statement.cs (Return.Resolve): Fix regression in typo: if
1981         `in_exc', we have to request a NeedReturnLabel, this was a typo
1982         introduced in the anonymous method check-in.  Fixes #69131.
1983
1984         * Indexers were using the ShortName when defining themselves,
1985         causing a regression in the compiler bootstrap when applying the
1986         patch from 2004-11-02 (first part), now they use their full name
1987         and the bug is gone.
1988
1989 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1990
1991         * driver.cs: Strip the path from the names of embedded resources. Fixes
1992         #68519.
1993
1994 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1995
1996         Fix error message regression: cs0104-2.cs.
1997         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1998         (AliasEntry.Resolve): Update.
1999         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
2000         'silent' flag.
2001         (RootContext.LookupType): Update.
2002
2003 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
2004
2005         * cs-parser.jay: Add support for handling accessor modifiers
2006         * class: Add support port accessor modifiers and error checking,
2007         define PropertyMethod.Define as virtual (not abstract anymore)
2008         * ecore.cs: Add checking for proeprties access with access modifiers
2009         * iterators.cs: Modify Accessor constructor call based in the modified
2010         constructor
2011 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
2012
2013         * expression.cs (StringConcat): Handle being called twice,
2014         as when we have a concat in a field init with more than two
2015         ctors in the class
2016
2017 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
2018
2019         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
2020         special case explicit implementations, we should always produce
2021         the .property or .event declaration.
2022         
2023         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
2024         since it will not return correct data if people use this
2025         unresolved in the presence of using statements (see test-313).
2026
2027         * class.cs (MethodData.Define): If we are an explicit interface
2028         implementation, set the method name to the full name of the
2029         interface plus the name of the method.  
2030
2031         Notice that using the method.MethodName.GetFullName() does not
2032         work, as it will only contain the name as declared on the source
2033         file (it can be a shorthand in the presence of using statements)
2034         and not the fully qualifed type name, for example:
2035
2036         using System;
2037
2038         class D : ICloneable {
2039                 object ICloneable.Clone ()  {
2040                 }
2041         }
2042
2043         Would produce a method called `ICloneable.Clone' instead of
2044         `System.ICloneable.Clone'.
2045
2046         * namespace.cs (Alias.Resolve): Use GetPartialName.
2047         
2048 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2049
2050         * cs-parser.jay: Add error 1055 report.
2051
2052 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
2053
2054         * assign.cs (Assign.DoResolve): Only do the transform of
2055         assignment into a New if the types are compatible, if not, fall
2056         through and let the implicit code deal with the errors and with
2057         the necessary conversions. 
2058
2059 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2060
2061         * cs-parser.jay: Add error 1031 report.
2062
2063         * cs-tokenizer.cs: Add location for error 1038.
2064
2065 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2066
2067         * cs-parser.jay: Add error 1016 report.
2068
2069 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2070
2071         * cs-parser.jay: Add errors 1575,1611 report.
2072
2073 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2074
2075         * cs-parser.jay: Add error 1001 report.
2076
2077 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2078
2079         Fix #68850
2080         * attribute.cs (GetMarshal): Add method argument for
2081         caller identification.
2082
2083         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
2084         agument for GetMarshal and RuntimeMissingSupport.
2085
2086 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2087
2088         * attribute.cs (ExtractSecurityPermissionSet): Removed
2089         TypeManager.code_access_permission_type.
2090
2091         * typemanager.cs: Removed TypeManager.code_access_permission_type.
2092
2093 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
2094
2095         * expression.cs (LocalVariableReference.DoResolveLValue): Check
2096         for obsolete use of a variable here.   Fixes regression on errors
2097         cs0619-25 and cs0619-26.
2098
2099 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
2100
2101         Fix #62358, implemented security attribute encoding.
2102
2103         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
2104         Tests permitted SecurityAction for assembly or other types.
2105         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
2106         data from SecurityPermissionAttribute to PermisionSet class.
2107
2108         * class.cs (ApplyAttributeBuilder): Added special handling
2109         for System.Security.Permissions.SecurityAttribute based types.
2110
2111         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
2112         special handling for System.Security.Permissions.SecurityAttribute
2113         based types.
2114
2115         * enum.cs (ApplyAttributeBuilder): Added special handling
2116         for System.Security.Permissions.SecurityAttribute based types.
2117
2118         * parameter.cs (ApplyAttributeBuilder): Added special handling
2119         for System.Security.Permissions.SecurityAttribute based types.
2120
2121         * rootcontext.cs: Next 2 core types.
2122
2123         * typemanager.cs (TypeManager.security_permission_attr_type):
2124         Built in type for the SecurityPermission Attribute.
2125         (code_access_permission_type): Build in type.
2126
2127 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
2128
2129         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
2130         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
2131         all of this information into
2132         EmitContext.EmitCapturedVariableInstance.
2133         
2134         * codegen.cs (EmitCapturedVariableInstance): move here the
2135         funcionality of emitting an ldarg.0 in the presence of a
2136         remapping.   This centralizes the instance emit code.
2137
2138         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
2139         then emit a load of this: it means that we have reached the
2140         topmost ScopeInfo: the one that contains the pointer to the
2141         instance of the class hosting the anonymous method.
2142
2143         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
2144         captures to the topmost CaptureContext.
2145
2146 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
2147
2148         * expression.cs (LocalVariableReference): Move the knowledge about
2149         the iterators into codegen's EmitCapturedVariableInstance.
2150
2151 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
2152
2153         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
2154         all code paths return a value from an anonymous method (it is the
2155         same as the 161 error, but for anonymous methods).
2156
2157 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
2158
2159         The introduction of anonymous methods in the compiler changed
2160         various ways of doing things in the compiler.  The most
2161         significant one is the hard split between the resolution phase
2162         and the emission phases of the compiler.
2163
2164         For instance, routines that referenced local variables no
2165         longer can safely create temporary variables during the
2166         resolution phase: they must do so from the emission phase,
2167         since the variable might have been "captured", hence access to
2168         it can not be done with the local-variable operations from the runtime.
2169         
2170         * statement.cs 
2171
2172         (Block.Flags): New flag `IsTopLevel' to indicate that this block
2173         is a toplevel block.
2174
2175         (ToplevelBlock): A new kind of Block, these are the blocks that
2176         are created by the parser for all toplevel method bodies.  These
2177         include methods, accessors and anonymous methods.
2178
2179         These contain some extra information not found in regular blocks:
2180         A pointer to an optional CaptureContext (for tracking captured
2181         local variables and parameters).  A pointer to the parent
2182         ToplevelBlock.
2183         
2184         (Return.Resolve): Catch missmatches when returning a value from an
2185         anonymous method (error 1662).
2186         Invoke NeedReturnLabel from the Resolve phase instead of the emit
2187         phase.
2188
2189         (Break.Resolve): ditto.
2190
2191         (SwitchLabel): instead of defining the labels during the
2192         resolution phase, we now turned the public ILLabel and ILLabelCode
2193         labels into methods called GetILLabelCode() and GetILLabel() that
2194         only define the label during the Emit phase.
2195
2196         (GotoCase): Track the SwitchLabel instead of the computed label
2197         (its contained therein).  Emit the code by using
2198         SwitchLabel.GetILLabelCode ().
2199
2200         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2201         whether the Local has been captured or not.
2202
2203         (LocalInfo.IsCaptured): New property, used to tell whether the
2204         local has been captured.
2205         
2206         * anonymous.cs: Vastly updated to contain the anonymous method
2207         support.
2208
2209         The main classes here are: CaptureContext which tracks any
2210         captured information for a toplevel block and ScopeInfo used to
2211         track the activation frames for various local variables.   
2212
2213         Each toplevel block has an optional capture context associated
2214         with it.  When a method contains an anonymous method both the
2215         toplevel method and the anonymous method will create a capture
2216         context.   When variables or parameters are captured, they are
2217         recorded on the CaptureContext that owns them, for example:
2218
2219         void Demo () {
2220              int a;
2221              MyDelegate d = delegate {
2222                  a = 1;
2223              }
2224         }
2225
2226         Here `a' will be recorded as captured on the toplevel
2227         CapturedContext, the inner captured context will not have anything
2228         (it will only have data if local variables or parameters from it
2229         are captured in a nested anonymous method.
2230
2231         The ScopeInfo is used to track the activation frames for local
2232         variables, for example:
2233
2234         for (int i = 0; i < 10; i++)
2235                 for (int j = 0; j < 10; j++){
2236                    MyDelegate d = delegate {
2237                         call (i, j);
2238                    }
2239                 }
2240
2241         At runtime this captures a single captured variable `i', but it
2242         captures 10 different versions of the variable `j'.  The variable
2243         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2244         recorded on a child.  
2245
2246         The toplevel ScopeInfo will also track information like the `this'
2247         pointer if instance variables were referenced (this is necessary
2248         as the anonymous method lives inside a nested class in the host
2249         type of the method). 
2250
2251         (AnonymousMethod): Expanded to track the Toplevel, implement
2252         `AnonymousMethod.Compatible' to tell whether an anonymous method
2253         can be converted to a target delegate type. 
2254
2255         The routine now also produces the anonymous method content
2256
2257         (AnonymousDelegate): A helper class that derives from
2258         DelegateCreation, this is used to generate the code necessary to
2259         produce the delegate for the anonymous method that was created. 
2260
2261         * assign.cs: API adjustments for new changes in
2262         Convert.ImplicitStandardConversionExists.
2263
2264         * class.cs: Adjustments to cope with the fact that now toplevel
2265         blocks are of type `ToplevelBlock'. 
2266
2267         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2268         insteda of standard blocks.
2269
2270         Flag errors if params arguments are passed to anonymous methods.
2271
2272         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2273         `CurrentAnonymousMethod' which points to the current Anonymous
2274         Method.  The variable points to the AnonymousMethod class that
2275         holds the code being compiled.  It is set in the new EmitContext
2276         created for the anonymous method.
2277
2278         (EmitContext.Phase): Introduce a variable and an enumeration to
2279         assist in enforcing some rules about when and where we are allowed
2280         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2281         only one that enfonces this right now).
2282
2283         (EmitContext.HaveCaptureInfo): new helper method that returns
2284         whether we have a CapturedContext initialized.
2285
2286         (EmitContext.CaptureVariable): New method used to register that a
2287         LocalInfo must be flagged for capturing. 
2288
2289         (EmitContext.CapturedParameter): New method used to register that a
2290         parameters must be flagged for capturing. 
2291         
2292         (EmitContext.CapturedField): New method used to register that a
2293         field must be flagged for capturing. 
2294
2295         (EmitContext.HaveCapturedVariables,
2296         EmitContext.HaveCapturedFields): Return whether there are captured
2297         variables or fields. 
2298
2299         (EmitContext.EmitMethodHostInstance): This is used to emit the
2300         instance for the anonymous method.  The instance might be null
2301         (static methods), this (for anonymous methods that capture nothing
2302         and happen to live side-by-side with the current method body) or a
2303         more complicated expression if the method has a CaptureContext.
2304
2305         (EmitContext.EmitTopBlock): Routine that drives the emission of
2306         code: it will first resolve the top block, then emit any metadata
2307         and then emit the code.  The split is done so that we can extract
2308         any anonymous methods and flag any captured variables/parameters.
2309         
2310         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2311         during this phase, the ILGenerator should not be used as labels
2312         and local variables declared here might not be accessible to any
2313         code that is part of an anonymous method.  
2314
2315         Exceptions to this include the temporary variables that are
2316         created by some statements internally for holding temporary
2317         variables. 
2318         
2319         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2320         metadata for a cb
2321
2322         (EmitContext.TemporaryReturn): This method is typically called
2323         from the Emit phase, and its the only place where we allow the
2324         ReturnLabel to be defined other than the EmitMeta.  The reason is
2325         that otherwise we would have to duplicate a lot of logic in the
2326         Resolve phases of various methods that today is on the Emit
2327         phase. 
2328
2329         (EmitContext.NeedReturnLabel): This no longer creates the label,
2330         as the ILGenerator is not valid during the resolve phase.
2331
2332         (EmitContext.EmitThis): Extended the knowledge in this class to
2333         work in anonymous methods in addition to iterators. 
2334
2335         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2336         code is necessary on the stack to access the instance to a local
2337         variable (the variable will be accessed as a field).
2338
2339         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2340         EmitContext.EmitAddressOfParameter): Routines to support
2341         parameters (not completed at this point). 
2342         
2343         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2344         will also remove the parameters.
2345
2346         * convert.cs (Convert): Define a `ConstantEC' which points to a
2347         null.  This is just to prefity some code that uses
2348         ImplicitStandardConversion code and do not have an EmitContext
2349         handy.
2350
2351         The idea is to flag explicitly that at that point in time, it is
2352         known that the conversion will not trigger the delegate checking
2353         code in implicit conversions (which requires a valid
2354         EmitContext). 
2355
2356         Everywhere: pass new EmitContext parameter since
2357         ImplicitStandardConversionExists now requires it to check for
2358         anonymous method conversions. 
2359
2360         (Convert.ImplicitStandardConversionExists): If the type of an
2361         expression is the anonymous_method_type, and the type is a
2362         delegate, we invoke the AnonymousMethod.Compatible method to check
2363         whether an implicit conversion is possible. 
2364
2365         (Convert.ImplicitConversionStandard): Only do implicit method
2366         group conversions if the language level is not ISO_1.
2367
2368         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2369         MethodInfo for the Invoke method.  used by Delegate and
2370         AnonymousDelegate.
2371
2372         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2373         method conversions if the target type is a delegate.
2374
2375         Removed extra debugging nops.
2376
2377         (LocalVariableReference): Turn the `local_info' into a public
2378         field. 
2379
2380         Add `prepared' field, the same hack used for FieldExprs to cope
2381         with composed assignments, as Local variables do not necessarily
2382         operate purely on the stack as they used to: they can be captured
2383         fields. 
2384
2385         Add `temp' for a temporary result, like fields.
2386
2387         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2388
2389         It now copes with Local variables that are captured and emits the
2390         proper instance variable to load it from a field in the captured
2391         case. 
2392
2393         (ParameterReference.DoResolveBase): During the resolve phase,
2394         capture parameters if we are in an anonymous method.
2395
2396         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2397         anonymous method, use the EmitContext helper routines to emit the
2398         parameter reference.
2399
2400         * iterators.cs: Set RemapToProxy to true/false during the
2401         EmitDispose class.
2402
2403         * parameters.cs (GetParameterByName): New helper method. 
2404
2405         * typemanager.cs (anonymous_method_type) a new type that
2406         represents an anonyous method.  This is always an internal type,
2407         used as a fencepost to test against the anonymous-methodness of an
2408         expression. 
2409         
2410 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2411
2412         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2413         561 report.
2414         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2415
2416 2004-10-18  Martin Baulig  <martin@ximian.com>
2417
2418         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2419         `Type' directly, but call ResolveType() on it.
2420         (Catch.Resolve): Likewise.
2421         (Foreach.Resolve): Likewise.
2422
2423 2004-10-18  Martin Baulig  <martin@ximian.com>
2424
2425         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2426         `Type' directly, but call ResolveType() on it.
2427         (Probe.DoResolve): Likewise.
2428         (ArrayCreation.LookupType): Likewise.
2429         (TypeOf.DoResolve): Likewise.
2430         (SizeOf.DoResolve): Likewise.
2431
2432 2004-10-18  Martin Baulig  <martin@ximian.com>
2433
2434         * expression.cs (Invocation.BetterFunction): Put back
2435         TypeManager.TypeToCoreType().
2436
2437 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2438
2439         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2440         the ResolveType.
2441
2442 2004-10-18  Martin Baulig  <martin@ximian.com>
2443
2444         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
2445         `Type' directly, but call ResolveType() on it.
2446
2447 2004-10-18  Martin Baulig  <martin@ximian.com>
2448
2449         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2450         `Type' directly, but call ResolveType() on it.
2451         (MemberBase.DoDefine): Likewise.
2452
2453         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2454         `Type' directly, but call ResolveType() on it.
2455         (ComposedCast.DoResolveAsTypeStep): Likewise.
2456
2457         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2458         `Type' directly, but call ResolveType() on it.
2459
2460 2004-10-17  John Luke  <john.luke@gmail.com>
2461
2462         * class.cs (Operator.GetSignatureForError): use CSharpName
2463
2464         * parameter.cs (Parameter.GetSignatureForError): Returns
2465         correct name even if was not defined.
2466
2467 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2468
2469         Fix #65816.
2470         * class.cs (TypeContainer.EmitContext): New property.
2471         (DefineNestedTypes): Create an emitcontext for each part.
2472         (MethodCore.DoDefineParameters): Use container's emitcontext.
2473         Pass type array to InternalParameters.
2474         (MemberBase.DoDefine): Use container's emitcontext.
2475         (FieldMember.Define): Likewise.
2476         (Event.Define): Likewise.
2477         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2478         Pass type array to InternalParameters.
2479         (SetIndexerMethod.GetParameterInfo): Likewise.
2480         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2481         * delegate.cs (Define): Pass emitcontext to
2482         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2483         array to InternalParameters.
2484         * expression.cs (ParameterReference.DoResolveBase): Pass
2485         emitcontext to GetParameterInfo.
2486         (ComposedCast.DoResolveAsTypeStep): Remove check on
2487         ec.ResolvingTypeTree.
2488         * parameter.cs (Parameter.Resolve): Change argument to
2489         EmitContext.  Use ResolveAsTypeTerminal.
2490         (Parameter.GetSignature): Change argument to EmitContext.
2491         (Parameters.ComputeSignature): Likewise.
2492         (Parameters.ComputeParameterTypes): Likewise.
2493         (Parameters.GetParameterInfo): Likewise.
2494         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2495         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2496         * support.cs (InternalParameters..ctor): Remove variant that takes
2497         a DeclSpace.
2498         * typemanager.cs (system_intptr_expr): New.
2499         (InitExpressionTypes): Initialize it.
2500
2501 2004-10-12  Chris Toshok  <toshok@ximian.com>
2502
2503         * cs-parser.jay: fix location for try_statement and catch_clause.
2504
2505 2004-10-11  Martin Baulig  <martin@ximian.com>
2506
2507         * report.cs: Don't make --fatal abort on warnings, we have
2508         -warnaserror for that.
2509
2510 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2511
2512         More DeclSpace.ResolveType avoidance.
2513         * decl.cs (MemberCore.InUnsafe): New property.
2514         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2515         with newly created EmitContext.
2516         (FieldMember.Define): Likewise.
2517         * delegate.cs (Delegate.Define): Likewise.
2518         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2519         only if normal name-lookup fails.
2520         (TypeExpr.DoResolve): Enable error-checking.
2521         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2522         (SizeOf.DoResolve): Likewise.
2523         (ComposedCast.DoResolveAsTypeStep): Likewise.
2524         (StackAlloc.DoResolve): Likewise.
2525         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2526         (Block.Unsafe): New property.
2527         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2528         (Unsafe): Set 'unsafe' flag of contained block.
2529         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2530         (Fixed.Resolve): Likewise.
2531         (Catch.Resolve): Likewise.
2532         (Using.ResolveLocalVariableDecls): Likewise.
2533         (Foreach.Resolve): Likewise.
2534
2535 2004-10-05  John Luke <john.luke@gmail.com>
2536
2537         * cs-parser.jay: add location to error CS0175
2538
2539 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2540
2541         * ecore.cs (Expression.Constantity): Add support for turning null
2542         into a constant.
2543
2544         * const.cs (Const.Define): Allow constants to be reference types
2545         as long as the value is Null.
2546
2547 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2548
2549         * namespace.cs (NamespaceEntry.Using): No matter which warning
2550         level is set, check if this namespace name has already been added.
2551
2552 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2553
2554         * expression.cs: reftype [!=]= null should always use br[true,false].
2555         # 67410
2556
2557 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2558
2559         Fix #67108
2560         * attribute.cs: Enum conversion moved to 
2561         GetAttributeArgumentExpression to be applied to the all
2562         expressions.
2563
2564 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2565
2566         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2567         * class.c (TypeContainer.DefineType): Flag error if
2568         base types aren't accessible due to access permissions.
2569         * decl.cs (DeclSpace.ResolveType): Move logic to
2570         Expression.ResolveAsTypeTerminal.
2571         (DeclSpace.ResolveTypeExpr): Thin layer over
2572         Expression.ResolveAsTypeTerminal.
2573         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2574         Refactor code into NestedAccess.  Use it.
2575         (DeclSpace.NestedAccess): New.
2576         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2577         argument to silence errors.  Check access permissions.
2578         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2579         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2580         (Cast.DoResolve): Likewise.
2581         (New.DoResolve): Likewise.
2582         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2583         (TypeOf.DoResolve): Likewise.
2584
2585         * expression.cs (Invocation.BetterConversion): Return the Type of
2586         the better conversion.  Implement section 14.4.2.3 more faithfully.
2587         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2588         section 14.4.2.2 explicit.
2589         (Invocation.OverloadResolve): Update.
2590         (Invocation): Remove is_base field.
2591         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2592         (Invocation.Emit): Likewise.
2593
2594 2004-09-27  Raja R Harinath  <rharinath@novell.com>
2595
2596         * README: Update to changes.
2597
2598 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2599
2600         * cs-parser.jay: Reverted 642 warning fix.
2601
2602 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2603
2604         Fix bug #66615
2605         * decl.cs (FindMemberWithSameName): Indexer can have more than
2606         1 argument.
2607
2608 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2609
2610         * expression.cs (LocalVariableReference.DoResolveLValue):
2611         Do not report warning 219 for out values.
2612         (EmptyExpression.Null): New member to avoid extra allocations.
2613
2614 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2615
2616         * cs-parser.jay: Fix wrong warning 642 report.
2617
2618         * cs-tokenizer.cs (CheckNextToken): New helper;
2619         Inspect next character if is same as expected.
2620
2621 2004-09-23  Martin Baulig  <martin@ximian.com>
2622
2623         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2624         (Convert.ImplicitReferenceConversionExists): Likewise.
2625
2626 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2627
2628         * class.cs (Operator.Define): Add error 448 and 559 report.
2629
2630 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2631
2632         * class.cs (MemberBase.IsTypePermitted): New protected
2633         method for checking error CS0610.
2634
2635 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2636
2637         * class.cs (TypeContainer.HasExplicitLayout): New property
2638         Returns whether container has StructLayout attribute set Explicit.
2639         (FieldMember): New abstract class for consts and fields.
2640         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2641         (Field): Reuse FieldMember.
2642
2643         * const.cs (Const): Reuse FieldMember.
2644
2645         * rootcontext.cs: EmitConstants call moved to class.
2646
2647 2004-09-22  Martin Baulig  <martin@ximian.com>
2648
2649         Thanks to Peter Sestoft for this bug report.
2650
2651         * expression.cs (Conditional): If both the `trueExpr' and the
2652         `falseExpr' is a NullLiteral, return a NullLiteral.
2653
2654 2004-09-22  Martin Baulig  <martin@ximian.com>
2655
2656         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2657         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2658         for the "get_Current" call.
2659
2660 2004-09-22  Martin Baulig  <martin@ximian.com>
2661
2662         Marek and me just fixed one of our oldest bugs: #28562 :-)
2663
2664         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2665
2666         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2667         we're an EnumConstant, just return that.
2668         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2669         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2670         to get the value which'll actually be written into the attribute.
2671         However, we have to use GetValue() to access the attribute's value
2672         in the compiler.        
2673
2674 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2675
2676         * constant.cs (Constant.IsNegative): New abstract property
2677         IsNegative.
2678
2679         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2680         (StackAlloc.DoResolve): Reused IsNegative.
2681
2682 2004-09-21  Martin Baulig  <martin@ximian.com>
2683
2684         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
2685         if we're used in an iterator, we may be called from different
2686         methods.
2687
2688         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
2689         we actually have an exception block.
2690
2691 2004-09-20  John Luke <jluke@cfl.rr.com>
2692
2693         * class.cs, cs-parser.jay: Improve the error report for 1520:
2694         report the actual line where the error happens, not where the
2695         class was declared.
2696
2697         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
2698         Pass location information that was available elsewhere.
2699
2700 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
2701
2702         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
2703         runtime to delay sign assemblies.
2704
2705 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
2706
2707         * cs-parser.jay: Do not report the stack trace, this is barely
2708         used nowadays.
2709
2710 2004-08-22  John Luke  <john.luke@gmail.com>
2711  
2712         * driver.cs : check that a resource id is not already used
2713         before adding it, report CS1508 if it is, bug #63637
2714
2715 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
2716
2717         * ecore.cs: Removed dead code.
2718
2719 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
2720
2721         * class.cs: Do not report warning CS0067 on the interfaces.
2722
2723 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
2724
2725         * cs-parser.jay: Add error 504 report.
2726
2727 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
2728
2729         * rootcontext.cs: WarningLevel is 4 by default now.
2730
2731         * statement.cs (Fixed.Resolve): Do not null
2732         VariableInfo.
2733
2734 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
2735
2736         Fixed bug #55780
2737         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
2738         deep search when property is not virtual.
2739         (PropertyExpr.ResolveAccessors): Make one call for both
2740         accessors.
2741
2742 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2743
2744         Fixed bug #65766
2745         * statement.cs: Error 152 report constains also location.
2746
2747 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2748
2749         Fixed bug #65766
2750         * const.cs: Explicitly set constant as static.
2751
2752 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2753
2754         Fixed bug #64226
2755         * cs-parser.jay: Add error 1017 report.
2756
2757 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2758
2759         Fixed bug #59980, #64224
2760         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
2761
2762         * typemanager.cs (IsSpecialMethod): Simplified
2763
2764 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2765
2766         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
2767         condition with better params.
2768
2769 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2770
2771         Fixed bug #65238
2772         * attribute.cs (Resolve): Property has to have both
2773         accessors.
2774
2775 2004-09-14  Martin Baulig  <martin@ximian.com>
2776
2777         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2778
2779 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2780
2781         Fixed bug #61902
2782         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2783         called and is obsolete then this member suppress message
2784         when call is inside next [Obsolete] method or type.
2785
2786         * expression.cs: Use TestObsoleteMethodUsage member.
2787
2788 2004-09-14  Martin Baulig  <martin@ximian.com>
2789
2790         * cs-parser.jay: Sync a bit with the GMCS version.
2791
2792 2004-09-14  Martin Baulig  <martin@ximian.com>
2793
2794         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
2795         (CSharpParser.yacc_verbose_flag): New public field.
2796
2797         * genericparser.cs: Removed.
2798
2799 2004-09-14  Raja R Harinath  <rharinath@novell.com>
2800
2801         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
2802
2803 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2804
2805         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2806
2807 2004-09-10  Martin Baulig  <martin@ximian.com>
2808
2809         Backported my MemberName changes from GMCS into MCS.
2810
2811         - we are now using a special `MemberName' class instead of using
2812         strings; in GMCS, the `MemberName' also contains the type
2813         arguments.
2814
2815         - changed the grammar rules a bit:
2816           * the old `member_name' is now a `namespace_or_type_name':
2817             The rule is that we use `namespace_or_type_name' everywhere
2818             where we expect either a "member name" (GetEnumerator) or a
2819             "member name" with an explicit interface name
2820             (IEnumerable.GetEnumerator).
2821             In GMCS, the explicit interface name may include type arguments
2822             (IEnumerable<T>.GetEnumerator).
2823           * we use `member_name' instead of just `IDENTIFIER' for
2824             "member names":
2825             The rule is that we use `member_name' wherever a member may
2826             have type parameters in GMCS.       
2827
2828         * decl.cs (MemberName): New public class.
2829         (MemberCore.MemberName): New public readonly field.
2830         (MemberCore.ctor): Take a `MemberName' argument, not a string.
2831         (DeclSpace): Likewise.
2832
2833         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
2834         * enum.cs (Enum.ctor): Likewise.
2835
2836         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
2837         MemberName.     
2838         (AliasEntry.ctor): Take a MemberName, not an Expression.
2839         (AliasEntry.UsingAlias): Likewise.
2840
2841         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
2842         (IMethodData.MemberName): Changed type from string to MemberName.
2843         (MemberBase.ExplicitInterfaceName): Likewise.
2844         (AbstractPropertyEventMethod.SetupName): Make this private.
2845         (AbstractPropertyEventMethod.ctor): Added `string prefix'
2846         argument; compute the member name here.
2847         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
2848         on the `member.MemberName' and the `prefix'.
2849
2850         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
2851         not `type_name'.
2852         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
2853         thus, we get a `MemberName' instead of a `string'.  These
2854         declarations may have type parameters in GMCS.
2855         (interface_method_declaration, delegate_declaration): Likewise.
2856         (class_declaration, interface_declaration): Likewise.
2857         (method_header): Use `namespace_or_type_name' instead of
2858         `member_name'.  We may be an explicit interface implementation.
2859         (property_declaration, event_declaration): Likewise.
2860         (member_name): This is now just an `IDENTIFIER', not a
2861         `namespace_or_type_name'.
2862         (type_name, interface_type): Removed.
2863         (namespace_or_type_name): Return a MemberName, not an Expression.
2864         (primary_expression): Use `member_name' instead of `IDENTIFIER';
2865         call GetTypeExpression() on the MemberName to get an expression.
2866         (IndexerDeclaration.interface_type): Changed type from string to
2867         MemberName.
2868         (MakeName): Operate on MemberName's instead of string's.
2869
2870 2004-09-13  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix bug #55770.
2873         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
2874         (NamespaceEntry.Lookup): Add new argument to flag if we want the
2875         lookup to avoid symbols introduced by 'using'.
2876         * rootcontext.cs (NamespaceLookup): Update.
2877
2878 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2879
2880         * class.cs (TypeContainer.DoDefineMembers): Do not call
2881         DefineDefaultConstructor for static classes.
2882
2883 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2884
2885         * attribute.cs (Attribute.Resolve): Add error 653 report.
2886
2887         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2888         report.
2889         (Method.ApplyAttributeBuilder): Add error 685 report.
2890         (Operator.Define): Add error 564 report.
2891
2892         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2893
2894         * expression.cs (Invocation.DoResolve): Add error
2895         245 and 250 report.
2896
2897         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2898         error 674 report.
2899
2900 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2901
2902         * class.cs (ConstructorInitializer.Resolve):
2903         Wrong error number (515->516).
2904
2905 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2906
2907         * class.cs (Indexer.Define): Add error 631 report.
2908
2909 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2910
2911         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2912
2913 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2914
2915         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2916
2917 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2918
2919         * cs-parser.jay: Added error CS0241 report.
2920
2921 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2922
2923         * cs-parser.jay (fixed_statement): Introduce a scope for the
2924         declaration in the 'fixed' statement.
2925
2926 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2927
2928         * cs-parser.jay: Added CS0230 error report.
2929
2930 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2931
2932         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2933
2934 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2935
2936         * expression.cs (Argument.Resolve): Added error CS0192 and
2937         CS0199 report.
2938
2939 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2940
2941         C# 2.0 #pragma warning feature
2942
2943         * cs-tokenizer.cs (PreProcessPragma): New method; 
2944         Handles #pragma directive.
2945
2946         * report.cs (WarningRegions): New class; Support
2947         class for #pragma warning directive. It tests whether
2948         warning is enabled for a given line.
2949
2950 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2951
2952         * const.cs: Add more descriptive error report, tahnks to
2953         Sebastien. 
2954
2955 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2956
2957         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2958
2959 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2960
2961         * expression.cs: Apply patch from Ben: Remove dead code from
2962         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2963         as that code just threw an exception anwyays.
2964
2965         * const.cs: Remove the call to the turnintoconstant, for details
2966         see bug: #63144
2967         
2968         * literal.cs: The type of the null-literal is the null type;  So
2969         we use a placeholder type (literal.cs:System.Null, defined here)
2970         for it.
2971
2972         * expression.cs (Conditional.DoResolve): Remove some old code that
2973         is no longer needed, conversions have been fixed.
2974
2975         (ArrayCreationExpression.DoResolve): Return false if we fail to
2976         resolve the inner expression.
2977
2978 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2979
2980         Fix test-290.cs.
2981         * cs-parser.jay (delegate_declaration): Record a delegate
2982         declaration as a type declaration.
2983         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2984
2985 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2986
2987         * parameter.cs: Do not crash if the type can not be resolved. 
2988
2989         * expression.cs: Report errors with unsafe pointers, fixes #64896
2990
2991 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2992
2993         * expression.cs: Pointer arith always needs to do a conv.i
2994         if the operand is a long. fix 65320
2995
2996 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2997
2998         Fixed cs0619-37.cs, cs0619-38.cs
2999
3000         * enum.cs (GetObsoleteAttribute): Removed.
3001
3002         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
3003         on Enum member is double staged. The first is tested member
3004         and then enum.
3005
3006 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3007
3008         Fixed #56986, #63631, #65231
3009
3010         * class.cs: (TypeContainer.AddToMemberContainer): New method,
3011         adds member to name container.
3012         (TypeContainer.AddToTypeContainer): New method, adds type to
3013         name container.
3014         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
3015         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
3016         AddOperator): Simplified by reusing AddToMemberContainer.
3017         (TypeContainer.UserDefinedStaticConstructor): Changed to property
3018         instead of field.
3019         (Method.CheckForDuplications): Fixed implementation to test all
3020         possibilities.
3021         (MemberBase): Detection whether member is explicit interface
3022         implementation is now in constructor.
3023         (MemberBase.UpdateMemberName): Handles IndexerName.
3024         (Accessor): Changed to keep also location information.
3025         (AbstractPropertyEventMethod): Is derived from MemberCore.
3026         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
3027         will be emited or not.
3028         (PropertyBase.AreAccessorsDuplicateImplementation):
3029         Tests whether accessors are not in collision with some method.
3030         (Operator): Is derived from MethodCore to simplify common
3031         operations.
3032
3033         * decl.cs (Flags.TestMethodDuplication): Test for duplication
3034         must be performed.
3035         (DeclSpace.AddToContainer): Adds the member to defined_names
3036         table. It tests for duplications and enclosing name conflicts.
3037
3038         * enum.cs (EnumMember): Clean up to reuse the base structures
3039
3040 2004-09-03  Martin Baulig  <martin@ximian.com>
3041
3042         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3043         into TypeContainer, to make partial classes work again.
3044
3045 2004-09-03  Martin Baulig  <martin@ximian.com>
3046
3047         * rootcontext.cs (RootContext.V2): Removed.
3048
3049 2004-03-23  Martin Baulig  <martin@ximian.com>
3050
3051         * expression.cs (Invocation.OverloadResolve): Added `bool
3052         may_fail' argument and use it instead of the Location.IsNull() hack.
3053
3054 2004-09-03  Martin Baulig  <martin@ximian.com>
3055
3056         Merged latest changes into gmcs.  Please keep this comment in
3057         here, it makes it easier for me to see what changed in MCS since
3058         the last time I merged.
3059
3060 2004-09-03  Raja R Harinath  <rharinath@novell.com>
3061
3062         Fix #61128.
3063         * expression.cs (BetterConversion): Don't allow either conversion 
3064         to be null.  Remove redundant implicit conversion test when 'q ==
3065         null' -- when this function is invoked, we already know that the
3066         implicit conversion exists.
3067         (BetterFunction): Assume that 'best' is non-null.  Remove
3068         redundant reimplementation of IsApplicable when 'best' is null.
3069         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
3070         number of arguments.
3071         (IsAncestralType): Extract from OverloadResolve.
3072         (OverloadResolve): Make robust to the MethodGroupExpr being
3073         unsorted.  Implement all the logic of Section 14.5.5.1, and
3074         support overloading of methods from multiple applicable types.
3075         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
3076
3077         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3078         (RealError, Warning): Append type of report to related symbol.
3079
3080 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
3081
3082         * enum.cs: Fixed CLS-Compliance checks for enum members.
3083         Error tests cs3008-8.cs, cs3014-8.cs
3084
3085 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3086
3087         Fixed bug #62342, #63102
3088         * class.cs: ImplementIndexer uses member.IsExplicitImpl
3089         like ImplementMethod.
3090
3091 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3092
3093         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3094         Fixed bug #65170.
3095
3096 2004-09-02  Martin Baulig  <martin@ximian.com>
3097
3098         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3099         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3100         on the MethodBase.
3101
3102 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3103
3104         C# 2.0 Static classes implemented
3105
3106         * class.cs (TypeContainer): instance_constructors,
3107         initialized_fields, initialized_static_fields,
3108         default_constructor, base_inteface_types are protected to be
3109         accessible from StaticClass.
3110         (TypeContainer.DefineDefaultConstructor): New virtual method
3111         for custom default constructor generating
3112         (StaticClass): New class to handle "Static classes" feature.
3113
3114         * cs-parser.jay: Handle static keyword on class like instance
3115         of StaticClass.
3116
3117         * driver.cs: Added "/langversion" command line switch with two
3118         options (iso-1, default).
3119
3120 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3121
3122         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3123
3124 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3125
3126         * delegate.cs: Style.
3127
3128 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3129
3130         * delegate.cs: Add seperate instance expr field for miguel.
3131
3132 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3133
3134         * PointerArithmetic (Resolve): make sure we are not doing
3135         pointer arith on void*. Also, make sure we are resolved
3136         by not setting eclass until resolve.
3137
3138         All callers: Make sure that PointerArithmetic gets resolved.
3139
3140 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3141
3142         * ArrayCreation (LookupType): If the type does not resolve 
3143         to an array, give an error.
3144
3145 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3146
3147         * statement.cs (Try.Resolve): Fixed bug #64222
3148
3149 2004-08-27  Martin Baulig  <martin@ximian.com>
3150
3151         * class.cs
3152         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3153         crash here.     
3154
3155 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3156
3157         * ecore.cs (Constantify): Get underlying type via
3158         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3159         Windows in special cases.
3160
3161 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3162
3163         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3164         for obtaining also private methods.
3165         (GetRemoveMethod): Used GetRemoveMethod (true)
3166         for obtaining also private methods.
3167
3168 2004-08-24  Martin Baulig  <martin@ximian.com>
3169
3170         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3171         MethodAttributes.HideBySig for operators.
3172
3173 2004-08-23  Martin Baulig  <martin@ximian.com>
3174
3175         Back to the old error reporting system :-)
3176
3177         * report.cs (Message): Removed.
3178         (Report.MessageData, ErrorData, WarningData): Removed.
3179         (Report.Error, Warning): Back to the old system.
3180
3181 2004-08-23  Martin Baulig  <martin@ximian.com>
3182
3183         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3184
3185         * class.cs (TypeContainer.ParentContainer): New public virtual
3186         method; replaces the explicit interface implementation.
3187         (ClassPart.ParentContainer): Override.
3188
3189 2004-08-23  Martin Baulig  <martin@ximian.com>
3190
3191         * statement.cs (Switch): Added support for constant switches; see
3192         #59428 or test-285.cs.
3193
3194 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3195
3196         Fixed bug #62740.
3197         * statement.cs (GetEnumeratorFilter): Removed useless
3198         logic because C# specs is strict. GetEnumerator must be
3199         public.
3200
3201 2004-08-22  Martin Baulig  <martin@ximian.com>
3202
3203         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3204         a switch and may break, reset the barrier.  Fixes #59867.
3205
3206 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3207
3208         CLS-Compliance speed up (~5% for corlib)
3209
3210         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3211         New method. Tests container for CLS-Compliant names
3212
3213         * class.cs (TypeContainer.VerifyClsName): New method.
3214         Checks whether container name is CLS Compliant.
3215         (Constructor): Implements IMethodData.
3216
3217         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3218         low-case table for CLS Compliance test.
3219         (MemberCache.VerifyClsParameterConflict): New method.
3220         Checks method parameters for CS3006 error.
3221
3222         * enum.cs (EnumMember): Is derived from MemberCore.
3223         (Enum.VerifyClsName): Optimized for better performance.
3224
3225 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3226
3227         * report.cs: Renamed Error_T to Error and changed all
3228         references.
3229
3230 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3231
3232         * class.cs (TypeContainer.IndexerArrayList): New inner class
3233         container for indexers.
3234         (TypeContainer.DefaultIndexerName): New constant for default
3235         indexer name. Replaced all "Item" with this constant.
3236         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3237
3238         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3239         DefaultMemberAttribute constructor.
3240
3241 2004-08-05  Martin Baulig  <martin@ximian.com>
3242
3243         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3244         Fix bug #59429.
3245
3246 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3249         multi platforms problem.
3250
3251         * compiler.csproj: Included shared files.
3252
3253 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3254
3255         Fix bug 60333, 55971 in the more general way
3256         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3257         Added arg_type argument for constant conversion.
3258         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3259
3260 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3261
3262         Fix bug #59760
3263         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3264         OperatorArrayList, MethodCoreArrayList for typecontainer
3265         containers. Changed class member types to these new types.
3266         (MethodArrayList.DefineMembers): Added test for CS0659.
3267
3268 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3269
3270         * cfold.cs: Synchronize the folding with the code in expression.cs
3271         Binary.DoNumericPromotions for uint operands.
3272
3273         * attribute.cs: Revert patch from Raja, it introduced a regression
3274         while building Blam-1.2.1 (hard to isolate a test case).
3275
3276 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3277
3278         Fix for #55382
3279         * class.cs:
3280         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3281         name collision.
3282         (MethodCore.parent_method): New member. The method we're overriding
3283         if this is an override method.
3284         (MethodCore.CheckBase): Moved from Method class and made common.
3285         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3286         private.
3287         (MethodCore.CheckForDuplications): New abstract method. For custom
3288         member duplication search in a container
3289         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3290         method and its return type.
3291         (Event.conflict_symbol): New member. Symbol with same name in the
3292         parent class.
3293
3294         * decl.cs:
3295         (MemberCache.FindMemberWithSameName): New method. The method
3296         is looking for conflict with inherited symbols.
3297
3298 2004-08-04  Martin Baulig  <martin@ximian.com>
3299
3300         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3301
3302         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3303
3304 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3305
3306         * report.cs (Message): New enum for better error, warning reference in
3307         the code.
3308         (MessageData): New inner abstract class. It generally handles printing of
3309         error and warning messages.
3310         Removed unused Error, Warning, Message methods.
3311
3312 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3313
3314         Fix for cs0592-8.cs test
3315         * attribute.cs
3316         (Attributable.ValidAttributeTargets): Made public.
3317         (Attribute.ExplicitTarget): New member for explicit target value.
3318         (Attribute.CheckTargets): Now we translate explicit attribute
3319         target to Target here.
3320
3321 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3322
3323         * ecore.cs (MethodGroupExpr): new IsBase property.
3324
3325         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3326
3327         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3328         rather than an instance expr.
3329
3330         (DelegateCreation.Emit): Use the method group rather than
3331         the instance expression. Also, if you have base.Foo as the
3332         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3333
3334         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3335
3336         (NewDelegate.DoResolve): Only check for the existance of Invoke
3337         if the method is going to be needed. Use MethodGroupExpr.
3338
3339         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3340
3341         * expression.cs: For pointer arith., make sure to use
3342         the size of the type, not the size of the pointer to
3343         the type.
3344
3345 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3346
3347         Fix for #60722
3348         * class.cs (Class): Added error CS0502 test.
3349
3350 2004-08-03  John Luke  <jluke@cfl.rr.com>
3351             Raja R Harinath  <rharinath@novell.com>
3352
3353         Fix for #60997.
3354         * attribute.cs (Attribute.complained_before): New flag.
3355         (Attribute.ResolveType, Attribute.Resolve),
3356         (Attribute.DefinePInvokeMethod): Set it.
3357         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3358         
3359 2004-08-03  Martin Baulig  <martin@ximian.com>
3360
3361         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3362         use a user-defined operator; we still need to do numeric
3363         promotions in case one argument is a builtin type and the other
3364         one has an implicit conversion to that type.  Fixes #62322.
3365
3366 2004-08-02  Martin Baulig  <martin@ximian.com>
3367
3368         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3369         (LocalInfo.IsThis): New public property.
3370         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3371
3372 2004-08-01  Martin Baulig  <martin@ximian.com>
3373
3374         * class.cs (TypeContainer.GetClassBases): Don't set the default
3375         here since we may get called from GetPartialBases().
3376         (TypeContainer.DefineType): If GetClassBases() didn't return a
3377         parent, use the default one.
3378
3379 2004-07-30  Duncan Mak  <duncan@ximian.com>
3380
3381         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
3382
3383 2004-07-30  Martin Baulig  <martin@ximian.com>
3384
3385         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3386
3387         * class.cs (SourceMethod): New public class, derive from the
3388         symbol writer's ISourceMethod.
3389         (Method): Use the new symbol writer API.
3390
3391         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3392         as argument and use the new symbol writer.
3393
3394         * location.cs
3395         (SourceFile): Implement the symbol writer's ISourceFile.
3396         (Location.SymbolDocument): Removed.
3397         (Location.SourceFile): New public property.
3398
3399         * symbolwriter.cs: Use the new symbol writer API.
3400
3401 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3402
3403         * Makefile (install-local): Remove.  Functionality moved to
3404         executable.make.
3405
3406 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3407
3408         * Makefile: Install mcs.exe.config file together with mcs.exe.
3409         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3410         correct runtime version.
3411         
3412 2004-07-25  Martin Baulig  <martin@ximian.com>
3413
3414         * class.cs
3415         (TypeContainer.RegisterOrder): Removed, this was unused.
3416         (TypeContainer, interface_order): Removed.
3417         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3418         TypeContainer as argument since we can also be called with a
3419         `PartialContainer' for a partial class/struct/interface.
3420         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3421         of checking whether we're an `Interface' - we could be a
3422         `PartialContainer'.
3423         (PartialContainer.Register): Override; call
3424         AddClass()/AddStruct()/AddInterface() on our parent.
3425
3426         * cs-parser.jay (interface_member_declaration): Add things to the
3427         `current_container', not the `current_class'.
3428
3429         * rootcontext.cs (RegisterOrder): The overloaded version which
3430         takes an `Interface' was unused, removed.
3431
3432         * typemanager.cs (TypeManager.LookupInterface): Return a
3433         `TypeContainer', not an `Interface'.
3434         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3435         contain a `PartialContainer' for an interface, so check it's
3436         `Kind' to figure out what it is.
3437
3438 2004-07-25  Martin Baulig  <martin@ximian.com>
3439
3440         * class.cs (Class.DefaultTypeAttributes): New public constant.
3441         (Struct.DefaultTypeAttributes): Likewise.
3442         (Interface.DefaultTypeAttributes): Likewise.
3443         (PartialContainer.TypeAttr): Override this and add the
3444         DefaultTypeAttributes.
3445
3446 2004-07-25  Martin Baulig  <martin@ximian.com>
3447
3448         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3449         we can just use the `Parent' field instead.
3450
3451 2004-07-25  Martin Baulig  <martin@ximian.com>
3452
3453         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3454
3455 2004-07-25  Martin Baulig  <martin@ximian.com>
3456
3457         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3458         our parts before defining any methods.
3459         (TypeContainer.VerifyImplements): Make this virtual.
3460         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3461         on our PartialContainer.
3462
3463 2004-07-25  Martin Baulig  <martin@ximian.com>
3464
3465         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3466
3467         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3468         argument, we can just use the `Parent' field instead.
3469
3470         * class.cs
3471         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3472         (MemberBase.DoDefine): Likewise.
3473
3474 2004-07-24  Martin Baulig  <martin@ximian.com>
3475
3476         * decl.cs (MemberCore.Parent): New public field.
3477         (DeclSpace.Parent): Moved to MemberCore.
3478
3479         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3480         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3481         parent's .ctor.
3482         (FieldBase, Field, Operator): Likewise.
3483         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3484         (EventField, Event): Likewise.
3485
3486 2004-07-23  Martin Baulig  <martin@ximian.com>
3487
3488         * class.cs (PartialContainer): New public class.
3489         (ClassPart): New public class.
3490         (TypeContainer): Added support for partial classes.
3491         (TypeContainer.GetClassBases): Splitted some of the functionality
3492         out into GetNormalBases() and GetPartialBases().
3493
3494         * cs-tokenizer.cs (Token.PARTIAL): New token.
3495         (Tokenizer.consume_identifier): Added some hacks to recognize
3496         `partial', but only if it's immediately followed by `class',
3497         `struct' or `interface'.
3498
3499         * cs-parser.jay: Added support for partial clases.
3500
3501 2004-07-23  Martin Baulig  <martin@ximian.com>
3502
3503         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3504         a `DeclSpace' and also made it readonly.
3505         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3506         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3507         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3508
3509         * cs-parser.jay: Pass the `current_class', not the
3510         `current_container' (at the moment, this is still the same thing)
3511         to a new Method, Property, Event, Indexer or Constructor.
3512
3513 2004-07-23  Martin Baulig  <martin@ximian.com>
3514
3515         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3516         and removed the `current_interface' one.
3517         (struct_declaration, class_declaration, interface_declaration):
3518         Set `current_class' to the newly created class/struct/interface;
3519         set their `Bases' and call Register() before parsing their body.
3520
3521 2004-07-23  Martin Baulig  <martin@ximian.com>
3522
3523         * class.cs (Kind): New public enum.
3524         (TypeContainer): Made this class abstract.
3525         (TypeContainer.Kind): New public readonly field.
3526         (TypeContainer.CheckDef): New public method; moved here from
3527         cs-parser.jay.
3528         (TypeContainer.Register): New public abstract method.
3529         (TypeContainer.GetPendingImplementations): New public abstract
3530         method.
3531         (TypeContainer.GetClassBases): Removed the `is_class' and
3532         `is_iface' parameters.
3533         (TypeContainer.DefineNestedTypes): Formerly known as
3534         DoDefineType().
3535         (ClassOrStruct): Made this class abstract.
3536
3537         * tree.cs (RootTypes): New public type. 
3538
3539 2004-07-20  Martin Baulig  <martin@ximian.com>
3540
3541         * tree.cs (Tree.RecordNamespace): Removed.
3542         (Tree.Namespaces): Removed.
3543
3544         * rootcontext.cs (RootContext.IsNamespace): Removed.
3545
3546         * cs-parser.jay (namespace_declaration): Just create a new
3547         NamespaceEntry here.
3548
3549 2004-07-20  Martin Baulig  <martin@ximian.com>
3550
3551         * statement.cs (ExceptionStatement): New abstract class.  This is
3552         now used as a base class for everyone who's using `finally'.
3553         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
3554         our local variables before using them.
3555
3556         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
3557         virtual method.  This is used by Yield.Resolve() to "steal" an
3558         outer block's `finally' clauses.
3559         (FlowBranchingException): The .ctor now takes an ExceptionStatement
3560         argument.
3561
3562         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
3563         version which takes an ExceptionStatement.  This version must be
3564         used to create exception branchings.
3565
3566         * iterator.cs
3567         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
3568         (Iterator.EmitMoveNext): Added exception support; protect the
3569         block with a `fault' clause, properly handle 'finally' clauses.
3570         (Iterator.EmitDispose): Run all the `finally' clauses here.
3571
3572 2004-07-20  Martin Baulig  <martin@ximian.com>
3573
3574         * iterator.cs: This is the first of a set of changes in the
3575         iterator code.  Match the spec more closely: if we're an
3576         IEnumerable, then GetEnumerator() must be called.  The first time
3577         GetEnumerator() is called, it returns the current instance; all
3578         subsequent invocations (if any) must create a copy.
3579
3580 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
3581
3582         * expression.cs: Resolve the constant expression before returning
3583         it. 
3584
3585 2004-07-19  Martin Baulig  <martin@ximian.com>
3586
3587         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
3588         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
3589         the return type of the new EmitContext.
3590
3591 2004-07-18  Martin Baulig  <martin@ximian.com>
3592
3593         * class.cs (Property.Define): Fix iterators.
3594
3595         * iterators.cs (Iterator.Define): Moved the
3596         `container.AddInterator (this)' call here from the .ctor; only do
3597         it if we resolved successfully.
3598
3599 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
3600
3601         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
3602         `true' for preprocessing directives that we parse.  The return
3603         value indicates whether we should return to regular tokenizing or
3604         not, not whether it was parsed successfully.
3605
3606         In the past if we were in: #if false ... #line #endif, we would
3607         resume parsing after `#line'.  See bug 61604.
3608
3609         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
3610         building: IsEnumType should return true only for enums, not for
3611         enums or System.Enum itself.  This fixes #61593.
3612
3613         Likely what happened is that corlib was wrong: mcs depended on
3614         this bug in some places.  The bug got fixed, we had to add the
3615         hack, which caused bug 61593.
3616
3617         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
3618         that was a workaround for the older conditions.
3619
3620 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
3621
3622         * assign.cs: IAssignMethod has a new interface, as documented
3623         inline. All assignment code now uses this new api.
3624
3625         * ecore.cs, expression.cs: All classes which implement
3626         IAssignMethod now use the new interface.
3627
3628         * expression.cs (Invocation): add a hack to EmitCall so that
3629         IndexerAccess can be the target of a compound assignment without
3630         evaluating its arguments twice.
3631
3632         * statement.cs: Handle changes in Invocation api.
3633
3634 2004-07-16  Martin Baulig  <martin@ximian.com>
3635
3636         * iterators.cs: Rewrote this.  We're now using one single Proxy
3637         class for both the IEnumerable and the IEnumerator interface and
3638         `Iterator' derives from Class so we can use the high-level API.
3639
3640         * class.cs (TypeContainer.AddIterator): New method.
3641         (TypeContainer.DoDefineType): New protected virtual method, which
3642         is called from DefineType().
3643         (TypeContainer.DoDefineMembers): Call DefineType() and
3644         DefineMembers() on all our iterators.
3645         (TypeContainer.Emit): Call Emit() on all our iterators.
3646         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3647
3648         * codegen.cs (EmitContext.CurrentIterator): New public field.
3649
3650 2004-07-15  Martin Baulig  <martin@ximian.com>
3651
3652         * typemanager.cs
3653         (TypeManager.not_supported_exception_type): New type.   
3654
3655 2004-07-14  Martin Baulig  <martin@ximian.com>
3656
3657         * iterators.cs: Use real error numbers.
3658
3659 2004-07-14  Martin Baulig  <martin@ximian.com>
3660
3661         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3662         requires this to be a System.Collection.IEnumerable and not a
3663         class implementing that interface.
3664         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3665
3666 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3667
3668         * class.cs: Fixed previous fix, it broke some error tests.
3669
3670 2004-07-12  Martin Baulig  <martin@ximian.com>
3671
3672         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3673         Fixes #61293.
3674
3675 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3676
3677         * assign.cs (LocalTemporary): Add new argument: is_address,If
3678         `is_address' is true, then the value that we store is the address
3679         to the real value, and not the value itself.
3680         
3681         * ecore.cs (PropertyExpr): use the new local temporary
3682         stuff to allow us to handle X.Y += z (where X is a struct)
3683
3684 2004-07-08  Martin Baulig  <martin@ximian.com>
3685
3686         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3687         not always return, just like we're doing in Using.Resolve().
3688
3689 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3690
3691         * cs-parser.jay (fixed_statement): flag this as Pinned.
3692
3693 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3694
3695         * typemanager.cs (TypeManager): Removed MakePinned method, this
3696         mechanism is replaced with the .NET 2.x compatible mechanism of
3697         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3698
3699         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3700         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3701         `IsFixed' property which has a different meaning.
3702
3703 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3704
3705         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3706         visible from inside a nested class, not just the names of the
3707         immediately enclosing class.
3708         Fix for bug #60730.
3709
3710 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3711
3712         * expression.cs (BetterConversion): Remove buggy special-case
3713         handling of "implicit constant expression conversions".  At this
3714         point, we already know that the conversion is possible -- we're
3715         only checking to see which is better.
3716
3717 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3718
3719         * cs-parser.jay: Added error CS0210 test.
3720
3721 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3722
3723         * cs-parser.jay: Added error CS0134 test.
3724
3725 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3726
3727         Fix bug #52507
3728         * cs-parser.jay: Added error CS0145 test.
3729
3730 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3731
3732         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3733
3734 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3735         
3736         * expression.cs (StackAlloc.Resolve): The argument may not
3737         be a constant; deal with this case.
3738         
3739 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3740
3741         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3742         GetIndexerAttributeValue.
3743         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3744
3745         * class.cs (Indexer.Define): Added error tests for CS0415,
3746         CS0609.
3747
3748 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3749
3750         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3751         property code.
3752
3753 2004-06-23  Martin Baulig  <martin@ximian.com>
3754
3755         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3756         neither return nor throw, reset the barrier as well.  Fixes #60457.
3757
3758 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3759
3760         * class.cs : EventAttributes is now set to None by default.
3761           This fixes bug #60459.
3762
3763 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3764
3765         Fix bug #60219
3766         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3767         Don't throw exception but return null (it's sufficient now).
3768
3769 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3770
3771         * typemanager.cs (GetArgumentTypes): Faster implementation.
3772
3773 2004-06-18  Martin Baulig  <martin@ximian.com>
3774
3775         * attribute.cs (Attribute.Resolve): Check whether we're an
3776         EmptyCast which a Constant child.  Fixes #60333.
3777
3778 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3779
3780         * statement.cs (EmitCollectionForeach): Account for the fact that
3781         not all valuetypes are in areas which we can take the address of.
3782         For these variables, we store to a temporary variable. Also, make
3783         sure that we dont emit a `callvirt' on a valuetype method.
3784
3785 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3786
3787         * expression.cs (StackAlloc.DoReSolve): Added test for
3788         negative parameter (CS0247).
3789
3790 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3791
3792         Fix bug #59792
3793         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3794
3795 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3796
3797         Fix bug #59781
3798         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3799         ulong.
3800
3801 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3802
3803         Fix bug #58254 & cs1555.cs, cs1556.cs
3804         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3805
3806 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3807
3808         * cs-parser.jay: Added error CS1669 test for indexers.
3809
3810 2004-06-11  Martin Baulig  <martin@ximian.com>
3811
3812         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3813         call this twice: for params and varargs methods.
3814
3815 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3816
3817         * class.cs:
3818         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3819
3820 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3821
3822         * attribute.cs (Attribute.GetValidTargets): Made public.
3823
3824         * class.cs: 
3825         (AbstractPropertyEventMethod): New class for better code sharing.
3826         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3827         CS1667 report.
3828         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3829
3830 2004-06-11  Raja R Harinath  <rharinath@novell.com>
3831
3832         Fix bug #59477.
3833         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
3834         that the call to Resolve is part of a MemberAccess.
3835         (Expression.Resolve): Use it for SimpleName resolution.
3836         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
3837         Add 'intermediate' boolean argument.
3838         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
3839         error message when the SimpleName can be resolved ambiguously
3840         between an expression and a type.
3841         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
3842         public.
3843         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
3844         call on the left-side.
3845
3846 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3847
3848         * class.cs:
3849         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
3850
3851 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3852
3853         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
3854
3855 2004-06-11  Martin Baulig  <martin@ximian.com>
3856
3857         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
3858         varargs methods if applicable.
3859
3860 2004-06-11  Martin Baulig  <martin@ximian.com>
3861
3862         * expression.cs (Invocation.EmitCall): Don't use
3863         `method.CallingConvention == CallingConventions.VarArgs' since the
3864         method could also have `CallingConventions.HasThis'.
3865
3866 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3867
3868         * class.cs (Event.GetSignatureForError): Implemented.
3869         Fixed crash in error test cs3010.cs
3870
3871 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
3872
3873         * cs-tokenizer.cs: Change the way we track __arglist to be
3874         consistent with the other keywords.
3875
3876 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
3877
3878         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
3879         tomorrow.
3880
3881 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
3882
3883         * codegen.cs: Check that all referenced assemblies have a strongname
3884         before strongnaming the compiled assembly. If not report error CS1577.
3885         Fix bug #56563. Patch by Jackson Harper.
3886         * typemanager.cs: Added a method to return all referenced assemblies.
3887         Fix bug #56563. Patch by Jackson Harper.
3888
3889 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
3890
3891         * class.cs:
3892         (Method.ApplyAttributeBuilder): Moved and added conditional
3893         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
3894
3895         * delegate.cs:
3896         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
3897
3898 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
3899
3900         Fixed #59640
3901         * class.cs: (EventField.attribute_targets): Changed default target.
3902
3903 2004-06-08  Martin Baulig  <martin@ximian.com>
3904
3905         * expression.cs (Invocation.EmitCall): Enable varargs methods.
3906
3907 2004-06-08  Martin Baulig  <martin@ximian.com>
3908
3909         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
3910
3911 2004-06-07  Martin Baulig  <martin@ximian.com>
3912
3913         Added support for varargs methods.
3914
3915         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
3916         keyword.
3917
3918         * cs-parser.jay: Added support for `__arglist'.
3919
3920         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
3921
3922         * expression.cs (Argument.AType): Added `ArgList'.
3923         (Invocation): Added support for varargs methods.
3924         (ArglistAccess): New public class.
3925         (Arglist): New public class.
3926
3927         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
3928
3929         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
3930         a method's top-level block if the method has varargs.
3931
3932         * support.cs (ReflectionParameters, InternalParameters): Added
3933         support for varargs methods.    
3934
3935 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
3936
3937         * class.cs: Provide location in indexer error report.
3938
3939         * driver.cs: Use standard names.
3940
3941         * namespace.cs: Catch the use of using after a namespace has been
3942         declared also on using aliases.
3943
3944 2004-06-03  Raja R Harinath  <rharinath@novell.com>
3945
3946         Bug #50820.
3947         * typemanager.cs (closure_private_ok, closure_invocation_type)
3948         (closure_qualifier_type, closure_invocation_assembly)
3949         (FilterWithClosure): Move to ...
3950         (Closure): New internal nested class.
3951         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
3952         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
3953         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
3954         (MemberLookup, MemberLookupFailed): Use it.
3955         * expression.cs (New.DoResolve): Treat the lookup for the
3956         constructor as being qualified by the 'new'ed type.
3957         (Indexers.GetIndexersForTypeOrInterface): Update.
3958
3959 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
3960
3961         * attribute.cs
3962         (GetConditionalAttributeValue): New method. Returns
3963         condition of ConditionalAttribute.
3964         (SearchMulti): New method.  Returns all attributes of type 't'.
3965         Use it when attribute is AllowMultiple = true.
3966         (IsConditionalMethodExcluded): New method.
3967
3968         * class.cs
3969         (Method.IsExcluded): Implemented. Returns true if method has conditional
3970         attribute and the conditions is not defined (method is excluded).
3971         (IMethodData): Extended interface for ConditionalAttribute support.
3972         (PropertyMethod.IsExcluded): Implemented.
3973
3974         * decl.cs
3975         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
3976
3977         * expression.cs
3978         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
3979         on the method.
3980
3981 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3982
3983         * expression.cs (ArrayCreationExpression): Make this just an
3984         `expression'. It can't be a statement, so the code here was
3985         dead.
3986
3987 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
3988
3989         Fixed #59072
3990         * typemanager.cs (GetFullNameSignature): New method for
3991         MethodBase types.
3992
3993 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
3994
3995         Fixed #56452
3996         * class.cs (MemberBase.GetSignatureForError): New virtual method.
3997         Use this method when MethodBuilder is null.
3998         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
3999         Added test for error CS0626 (MONO reports error for this situation).
4000         (IMethodData.GetSignatureForError): Extended interface.
4001
4002 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4003
4004         * attribute.cs
4005         (AttributeTester.GetObsoleteAttribute): Returns instance of
4006         ObsoleteAttribute when type is obsolete.
4007
4008         * class.cs
4009         (TypeContainer.VerifyObsoleteAttribute): Override.
4010         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4011         (MethodCode.VerifyObsoleteAttribute): Override.
4012         (MemberBase.VerifyObsoleteAttribute): Override.
4013
4014         * decl.cs
4015         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4016         and report proper error.
4017
4018         *delegate.cs
4019         Delegate.VerifyObsoleteAttribute): Override.
4020
4021         * ecore.cs
4022         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4023         and report proper error.
4024         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4025
4026         * enum.cs
4027         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4028         and enum member.
4029
4030         * expression.cs
4031         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4032         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4033         Added test for ObsoleteAttribute.
4034
4035         * statement.cs
4036         (Catch): Derived from Statement.
4037
4038 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4039  
4040         Fixed bug #59071 & cs0160.cs
4041  
4042         * statement.cs (Try.Resolve): Check here whether order of catch
4043         clauses matches their dependencies.
4044
4045 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
4046
4047         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
4048         caused a regression: #59343.  Referencing nested classes from an
4049         assembly stopped working.
4050
4051 2004-05-31  Martin Baulig  <martin@ximian.com>
4052
4053         MCS is now frozen for beta 2.
4054
4055 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4056
4057         * convert.cs: add a trivial cache for overload operator resolution.
4058
4059 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4060
4061         * decl.cs: If possible, use lookuptypedirect here. We can only do
4062         this if there is no `.' after the namespace. Avoids using
4063         LookupType, which does lots of slow processing.
4064         (FindNestedType) New method, does what it says :-).
4065         * namespace.cs: use LookupTypeDirect.
4066         * rootcontext.cs: use membercache, if possible.
4067         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4068
4069 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4070
4071         * expression.cs:
4072         According to the spec, 
4073
4074         In a member access of the form E.I, if E is a single identifier,
4075         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4076         field, property, localvariable, or parameter with the same type as
4077         the meaning of E as a type-name (§3.8), then both possible
4078         meanings of E are permitted.
4079
4080         We did not check that E as a simple-name had the same type as E as
4081         a type name.
4082
4083         This trivial check gives us 5-7% on bootstrap time.
4084
4085 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4086
4087         * expression.cs (Invocation.OverloadResolve): Avoid the
4088         use of hashtables and boxing here by allocating on demand.
4089
4090 2004-05-30  Martin Baulig  <martin@ximian.com>
4091
4092         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4093         we're doing a silent lookup.  Don't try to lookup nested types in
4094         TypeManager.object_type (thanks to Ben Maurer).
4095
4096 2004-05-30  Martin Baulig  <martin@ximian.com>
4097
4098         Committing a patch from Ben Maurer.
4099
4100         * rootcontext.cs (RootContext.LookupType): Cache negative results.
4101
4102 2004-05-29  Martin Baulig  <martin@ximian.com>
4103
4104         * class.cs (IMethodData.ShouldIgnore): New method.
4105
4106         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4107         `Location' argument, we don't need it anywhere.  Use
4108         `IMethodData.ShouldIgnore ()' instead of
4109         `MethodData.GetMethodFlags ()'.
4110         (TypeManager.AddMethod): Removed.
4111         (TypeManager.AddMethod2): Renamed to AddMethod.
4112
4113 2004-05-29  Martin Baulig  <martin@ximian.com>
4114
4115         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4116
4117         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4118         converting from a class type S to an interface type and we already
4119         have an object on the stack, don't box it again.  Fixes #52578.
4120
4121 2004-05-29  Martin Baulig  <martin@ximian.com>
4122
4123         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4124         Added support for `params' parameters.  Fixes #59267.
4125
4126 2004-05-29  Martin Baulig  <martin@ximian.com>
4127
4128         * literal.cs (NullPointer): Provide a private .ctor which sets
4129         `type' to TypeManager.object_type.  Fixes #59048.
4130
4131 2004-05-29  Martin Baulig  <martin@ximian.com>
4132
4133         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4134         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4135
4136         * ecore.cs (EventExpr.instance_expr): Make the field private.
4137
4138 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4139
4140         Fixed bug #50080 & cs0214-2.cs
4141         * expression.cs (Cast.DoResolve): Check unsafe context here.
4142         
4143         * statement.cs (Resolve.DoResolve): Likewise.
4144
4145 2004-05-26  Martin Baulig  <martin@ximian.com>
4146
4147         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4148
4149         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4150         (RootContext.LookupType): Pass down the `silent' flag.
4151
4152 2004-05-25  Martin Baulig  <martin@ximian.com>
4153
4154         * expression.cs
4155         (MethodGroupExpr.IdenticalTypeName): New public property.
4156         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4157         expression actually refers to a type.
4158
4159 2004-05-25  Martin Baulig  <martin@ximian.com>
4160
4161         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4162         for #56176 and made it actually work.
4163
4164 2004-05-25  Martin Baulig  <martin@ximian.com>
4165
4166         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4167         (FieldExpr, PropertyExpr): Override and implement
4168         CacheTemporaries.  Fixes #52279.
4169
4170 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4171
4172         * location.cs: In the new compiler listing a file twice is a
4173         warning, not an error.
4174
4175 2004-05-24  Martin Baulig  <martin@ximian.com>
4176
4177         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4178         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4179
4180 2004-05-24  Martin Baulig  <martin@ximian.com>
4181
4182         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4183         walking the `using' list.  Fixes #53921.
4184
4185 2004-05-24  Martin Baulig  <martin@ximian.com>
4186
4187         * const.cs (Const.LookupConstantValue): Added support for
4188         EmptyCast's; fixes #55251.
4189
4190 2004-05-24  Martin Baulig  <martin@ximian.com>
4191
4192         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4193         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4194         which does the CS0135 check.  The reason is that we first need to
4195         check whether the variable actually exists.
4196
4197 2004-05-24  Martin Baulig  <martin@ximian.com>
4198
4199         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4200         than RootContext.LookupType() to find the explicit interface
4201         type.  Fixes #58584.
4202
4203 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4204
4205         * Makefile: Simplify.  Use executable.make.
4206         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4207
4208 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4209
4210         * decl.cs:
4211         * enum.cs:
4212         Use the invariant culture when doing String.Compare for CLS case
4213         sensitivity.
4214         
4215 2004-05-23  Martin Baulig  <martin@ximian.com>
4216
4217         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4218         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4219
4220         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4221         
4222 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4223
4224         * class.cs (MemberBase.Define): Reuse MemberType member for 
4225         resolved type. Other methods can use it too.
4226
4227 2004-05-23  Martin Baulig  <martin@ximian.com>
4228
4229         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4230         the variable also exists in the current block (otherwise, we need
4231         to report a CS0103).  Fixes #58670.
4232
4233 2004-05-23  Martin Baulig  <martin@ximian.com>
4234
4235         * flowanalysis.cs (Reachability.Reachable): Compute this
4236         on-the-fly rather than storing it as a field.
4237
4238 2004-05-23  Martin Baulig  <martin@ximian.com>
4239
4240         * flowanalysis.cs (Reachability.And): Manually compute the
4241         resulting `barrier' from the reachability.      
4242        
4243 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4244
4245         Fix bug #57835
4246         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4247         instance of ObsoleteAttribute when symbol is obsolete.
4248
4249         * class.cs
4250         (IMethodData): Extended interface for ObsoleteAttribute support.
4251
4252 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4253
4254         * attribute.cs: Fix bug #55970
4255
4256 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4257
4258         Fix bug #52705
4259         * attribute.cs
4260         (GetObsoleteAttribute): New method. Creates the instance of
4261         ObsoleteAttribute.
4262         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4263         ObsoleteAttribute when member is obsolete.
4264         (AttributeTester.Report_ObsoleteMessage): Common method for
4265         Obsolete error/warning reporting.
4266
4267         * class.cs
4268         (TypeContainer.base_classs_type): New member for storing parent type.
4269
4270         * decl.cs
4271         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4272         for this MemberCore.
4273
4274 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4275
4276         * attribute.cs, const.cs: Fix bug #58590
4277
4278 2004-05-21  Martin Baulig  <martin@ximian.com>
4279
4280         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4281         out parameters if the end of the method is unreachable.  Fixes
4282         #58098. 
4283
4284 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4285
4286         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4287         Hari was right, why extra method.
4288
4289 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4290
4291         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4292
4293 2004-05-20  Martin Baulig  <martin@ximian.com>
4294
4295         Merged this back from gmcs to keep the differences to a minumum.
4296
4297         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
4298         instead of a Declspace.
4299         (Attribute.ResolveType): Likewise.
4300         (Attributes.Search): Likewise.
4301         (Attributes.Contains): Likewise.
4302         (Attributes.GetClsCompliantAttribute): Likewise.
4303
4304         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
4305         argument.
4306         (MethodData.ApplyAttributes): Take an EmitContext instead of a
4307         DeclSpace.
4308
4309 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4310
4311         Fix bug #58688 (MCS does not report error when the same attribute
4312         is assigned twice)
4313
4314         * attribute.cs (Attribute.Emit): Distinction between null and default.
4315
4316 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4317
4318         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4319         of a top-level attribute without an attribute target.
4320         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4321         Make non-static.
4322         (Attribute.Conditional_GetConditionName), 
4323         (Attribute.Obsolete_GetObsoleteMessage): Update.
4324         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4325         part of ScanForIndexerName.
4326         (Attribute.CanIgnoreInvalidAttribute): New function.
4327         (Attribute.ScanForIndexerName): Move to ...
4328         (Attributes.ScanForIndexerName): ... here.
4329         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4330         (Attributes.Search): New internal variant that can choose not to
4331         complain if types aren't resolved.  The original signature now
4332         complains.
4333         (Attributes.GetClsCompliantAttribute): Use internal variant, with
4334         complaints suppressed.
4335         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4336         only if it not useful.
4337         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4338         top-level for attributes that are shared between the assembly
4339         and a top-level class.
4340         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4341         * class.cs: Update to reflect changes.
4342         (DefineIndexers): Fuse loops.
4343         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4344         a couple more variants of attribute names.
4345
4346 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4347
4348         Fix bug #52585 (Implemented explicit attribute declaration)
4349
4350         * attribute.cs:
4351         (Attributable.ValidAttributeTargets): New abstract method. It gets
4352         list of valid attribute targets for explicit target declaration.
4353         (Attribute.Target): It holds target itself.
4354         (AttributeSection): Removed.
4355         (Attribute.CheckTargets): New method. It checks whether attribute
4356         target is valid for the current element.
4357
4358         * class.cs:
4359         (EventProperty): New class. For events that are declared like
4360         property (with add and remove accessors).
4361         (EventField): New class. For events that are declared like field.
4362         class.cs
4363
4364         * cs-parser.jay: Implemented explicit attribute target declaration.
4365
4366         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4367         Override ValidAttributeTargets.
4368
4369         * parameter.cs:
4370         (ReturnParameter): Class for applying custom attributes on 
4371         the return type.
4372         (ParameterAtribute): New class. Class for applying custom
4373         attributes on the parameter type.
4374
4375 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4376
4377         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4378         definitions. 
4379
4380         (Method): Allow UNSAFE here.
4381
4382         * modifiers.cs: Support unsafe reporting.
4383
4384 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4385
4386         * decl.cs: Fix bug #58478.
4387
4388 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4389
4390         * statement.cs: When checking for unreachable code on an EmptyStatement,
4391         set the location. Fixes bug #58488.
4392
4393 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4394
4395         * driver.cs: Add -pkg handling.
4396
4397         From Gonzalo: UseShelLExecute=false
4398
4399 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4400
4401         * attribute.cs:
4402         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4403         for attribute.
4404         (Attribute.IsClsCompliaceRequired): Moved to base for better
4405         accesibility.
4406         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4407         when attribute is AttributeUsageAttribute.
4408         (Attribute.GetValidTargets): Simplified.
4409         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4410         attribute for this type.
4411         (Attribute.ApplyAttributes): Method renamed to Emit and make
4412         non-static.
4413         (GlobalAttributeSection): New class for special handling of global
4414         attributes (assembly, module).
4415         (AttributeSection.Emit): New method.
4416
4417         * class.cs: Implemented Attributable abstract methods.
4418         (MethodCore.LabelParameters): Moved to Parameter class.
4419         (Accessor): Is back simple class.
4420         (PropertyMethod): Implemented Attributable abstract class.
4421         (DelegateMethod): Implemented Attributable abstract class.
4422         (Event): New constructor for disctintion between normal Event
4423         and Event with accessors.
4424
4425         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4426
4427         * codegen.cs, const.cs, decl.cs, delegate.cs:
4428         (CommonAssemblyModulClass): Implemented Attributable abstract class
4429         and simplified.
4430
4431         * enum.cs: Implement IAttributeSupport interface.
4432         (EnumMember): New class for emum members. Implemented Attributable
4433         abstract class
4434
4435         * parameter.cs:
4436         (ParameterBase): Is abstract.
4437         (ReturnParameter): New class for easier [return:] attribute handling.
4438
4439         * typemanager.cs: Removed builder_to_attr.
4440
4441 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4442
4443         Fix bug #57151.
4444         * attribute.cs (Attribute.GetPositionalValue): New function.
4445         * class.cs (TypeContainer.VerifyMembers): New function.
4446         (TypeContainer.Emit): Use it.
4447         (ClassOrStruct): New base class for Class and Struct.
4448         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4449         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4450         class.
4451         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4452         then each non-static field should have a FieldOffset attribute.
4453         Otherwise, none of the fields should have a FieldOffset attribute.
4454         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4455         and FieldOffset attributes.
4456         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4457         (TypeManager.field_offset_attribute_type): New core types.
4458         (TypeManager.InitCoreTypes): Initialize them.
4459
4460 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4461
4462         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4463         Return correct type.
4464         From bug #58270.
4465
4466 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4467
4468         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4469         be implicitly converted to ulong.
4470         
4471         * expression.cs: The logic for allowing operator &, | and ^ worked
4472         was wrong, it worked before because we did not report an error in
4473         an else branch.  Fixes 57895.
4474
4475         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4476         allow volatile fields to be reference types.
4477
4478 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4479
4480         * driver.cs: Add support for /debug-
4481
4482 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4483
4484         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4485         Add a 'complain' parameter to silence errors.
4486         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4487         silently overlooked type-resolutions.
4488         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4489         to reflect changes.
4490         (Attributes.Search): New function.
4491         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4492         (Attributes.GetAttributeFullName): Remove hack.
4493         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4494         Update to reflect changes.
4495         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4496         Use Attributes.Search instead of nested loops.
4497
4498 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4499
4500         * decl.cs:
4501         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4502         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4503         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4504
4505         * report.cs: (Report.Warning): Renamed to Warning_T because of
4506         parameter collision.
4507
4508 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4509
4510         * expression.cs (MemberAccess.ResolveMemberAccess):
4511         Exit with non-zero status after Report.Error.
4512         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4513         Likewise.
4514         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4515
4516 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4517
4518         * support.cs: Don't hang when the file is empty.
4519
4520 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4521
4522         * support.cs: In SeekableStreamReader, compute the preamble size of the
4523           underlying stream. Position changes should take into account that initial
4524           count of bytes.
4525
4526 2004-05-03  Todd Berman  <tberman@sevenl.net>
4527
4528         * driver.cs: remove unused GetSysVersion function.
4529
4530 2004-05-03  Todd Berman  <tberman@sevenl.net>
4531
4532         * driver.cs: Remove the hack from saturday, as well as the hack
4533         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4534         link_paths to get that bit proper.
4535
4536 2004-05-01  Todd Berman  <tberman@sevenl.net>
4537
4538         * driver.cs: Try a LoadFrom before a Load, this checks the current
4539         path. This is currently a bug in mono that is be fixed, however, this
4540         provides a workaround for now. This will be removed when the bug
4541         is fixed.
4542
4543 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4544
4545         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4546         incomplete key pairs (#57941).
4547
4548 2004-05-01  Todd Berman  <tberman@sevenl.net>
4549
4550         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4551         from the GAC
4552
4553 2004-04-30  Jackson Harper  <jackson@ximian.com>
4554
4555         * codegen.cs: Open keys readonly.
4556         
4557 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4558
4559         * typemanager.cs: don't report cyclic struct layout when a struct
4560         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4561         which has 2 Pango.Rectangle fields.
4562
4563 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4564
4565         * expression.cs: Handle IntPtr comparisons with IL code
4566         rather than a method call.
4567
4568 2004-04-29  Martin Baulig  <martin@ximian.com>
4569
4570         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4571         the list of PropertyInfo's in class hierarchy and find the
4572         accessor.  Fixes #56013.
4573
4574 2004-04-29  Martin Baulig  <martin@ximian.com>
4575
4576         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4577
4578 2004-04-29  Martin Baulig  <martin@ximian.com>
4579
4580         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4581
4582         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4583
4584 2004-04-29  Martin Baulig  <martin@ximian.com>
4585
4586         * class.cs (ConstructorInitializer.Resolve): Check whether the
4587         parent .ctor is accessible.  Fixes #52146.
4588
4589 2004-04-29  Martin Baulig  <martin@ximian.com>
4590
4591         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4592
4593         * statement.cs (Using.EmitLocalVariableDecls): Use
4594         TypeManager.idisposable_type, not typeof (IDisposable).
4595         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4596
4597 2004-04-29  Martin Baulig  <martin@ximian.com>
4598
4599         * class.cs (Event.Define): Don't emit the field and don't set
4600         RTSpecialName and SpecialName for events on interfaces.  Fixes
4601         #57703. 
4602
4603 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4604
4605         Refactor Attribute.ApplyAttributes.
4606         * attribute.cs (Attributable): New base class for objects that can
4607         have Attributes applied on them.
4608         (Attribute): Make AttributeUsage fields public.
4609         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4610         (Attribute.IsInternalCall): New property.
4611         (Attribute.UsageAttr): Convert to a public read-only property.
4612         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4613         (Attribute.ResolveType, Attribute.Resolve)
4614         (Attribute.ScanForIndexerName): Update to reflect changes.
4615         (Attribute.CheckAttributeTarget): Re-format.
4616         (Attribute.ApplyAttributes): Refactor, to various
4617         Attributable.ApplyAttributeBuilder methods.
4618         * decl.cs (MemberCore): Make Attributable.
4619         * class.cs (Accessor): Make Attributable.
4620         (MethodData.ApplyAttributes): Use proper attribute types, not
4621         attribute names.
4622         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4623         (TypeContainer.ApplyAttributeBuilder)
4624         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4625         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4626         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4627         (Operator.ApplyAttributeBuilder): New factored-out methods.
4628         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4629         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4630         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4631         * parameter.cs (ParameterBase): New Attributable base class
4632         that can also represent Return types.
4633         (Parameter): Update to the changes.
4634
4635 2004-04-29  Jackson Harper  <jackson@ximian.com>
4636
4637         * driver.cs: Prefer the corlib system version when looking for
4638         assemblies in the GAC. This is still a hack, but its a better hack
4639         now.
4640         
4641 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4642
4643         * decl.cs, enum.cs: Improved error 3005 reporting.
4644   
4645         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4646         (related_symbols): New private member for list of symbols
4647         related to reported error/warning.
4648         
4649         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4650
4651 2004-04-29  Martin Baulig  <martin@ximian.com>
4652
4653         * ecore.cs (Expression.Constantify): If we're an enum and
4654         TypeManager.TypeToCoreType() doesn't give us another type, use
4655         t.UnderlyingSystemType.  Fixes #56178.  
4656
4657 2004-04-29  Martin Baulig  <martin@ximian.com>
4658
4659         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4660         interfaces and for each interface, only add members directly
4661         declared in that interface.  Fixes #53255.
4662
4663 2004-04-28  Martin Baulig  <martin@ximian.com>
4664
4665         * expression.cs (ConditionalLogicalOperator): Use a temporary
4666         variable for `left' to avoid that we evaluate it more than once;
4667         bug #52588.
4668
4669 2004-04-28  Martin Baulig  <martin@ximian.com>
4670
4671         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4672         `void[]' (CS1547).
4673
4674 2004-04-28  Martin Baulig  <martin@ximian.com>
4675
4676         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4677         void (CS1547).
4678
4679         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4680         whether the type is not void (CS1547).
4681
4682 2004-04-28  Martin Baulig  <martin@ximian.com>
4683
4684         * expression.cs (Unary.DoResolveLValue): Override this and report
4685         CS0131 for anything but Operator.Indirection.
4686
4687 2004-04-28  Martin Baulig  <martin@ximian.com>
4688
4689         Committing a patch from Ben Maurer; see bug #50820.
4690
4691         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4692         check for classes.
4693
4694         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4695         classes.        
4696
4697 2004-04-28  Martin Baulig  <martin@ximian.com>
4698
4699         Committing a patch from Ben Maurer; see bug #50820.
4700
4701         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4702         check for classes.
4703
4704         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4705         classes.        
4706
4707 2004-04-28  Martin Baulig  <martin@ximian.com>
4708
4709         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4710         (Block.AddLabel): Call DoLookupLabel() to only search in the
4711         current block.
4712
4713 2004-04-28  Martin Baulig  <martin@ximian.com>
4714
4715         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4716         comparing StringConstants and NullLiterals in Equality and Inequality.
4717
4718 2004-04-28  Jackson Harper  <jackson@ximian.com>
4719
4720         * driver.cs: Attempt to load referenced assemblies from the
4721         GAC. This is the quick and dirty version of this method that
4722         doesnt take into account versions and just takes the first
4723         canidate found. Will be good enough for now as we will not have more
4724         then one version installed into the GAC until I update this method.
4725
4726 2004-04-28  Martin Baulig  <martin@ximian.com>
4727
4728         * typemanager.cs (TypeManager.CheckStructCycles): New public
4729         static method to check for cycles in the struct layout.
4730
4731         * rootcontext.cs (RootContext.PopulateTypes): Call
4732         TypeManager.CheckStructCycles() for each TypeContainer.
4733         [Note: We only need to visit each type once.]
4734
4735 2004-04-28  Martin Baulig  <martin@ximian.com>
4736
4737         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4738
4739         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4740         success and added `out object value'.  Use a `bool resolved' field
4741         to check whether we've already been called rather than
4742         `ConstantValue != null' since this breaks for NullLiterals.
4743
4744 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4745
4746         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4747         setting of this flag, since the 'set' method may be non-public.
4748
4749 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4750
4751         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4752         check on current_vector.Block.
4753
4754 2004-04-27  Martin Baulig  <martin@ximian.com>
4755
4756         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4757         a field initializer.  Fixes #56459.
4758
4759 2004-04-27  Martin Baulig  <martin@ximian.com>
4760
4761         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4762         we're not attempting to use an indexer.  Fixes #52154.
4763
4764 2004-04-27  Martin Baulig  <martin@ximian.com>
4765
4766         * statement.cs (Return): Don't create a return label if we don't
4767         need it; reverts my change from January 20th.  Thanks to Ben
4768         Maurer for this.
4769
4770 2004-04-27  Martin Baulig  <martin@ximian.com>
4771
4772         According to the spec, `goto' can only leave a nested scope, but
4773         never enter it.
4774
4775         * statement.cs (Block.LookupLabel): Only lookup in the current
4776         block, don't recurse into parent or child blocks.
4777         (Block.AddLabel): Check in parent and child blocks, report
4778         CS0140/CS0158 if we find a duplicate.
4779         (Block): Removed this indexer for label lookups.
4780         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4781         this already does the error reporting for us.
4782
4783         * flowanalysis.cs
4784         (FlowBranching.UsageVector.Block): New public variable; may be null.
4785         (FlowBranching.CreateSibling): Added `Block' argument.
4786         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4787         label for the target of a `goto' and check whether we're not
4788         leaving a `finally'.
4789
4790 2004-04-27  Martin Baulig  <martin@ximian.com>
4791
4792         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4793         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4794         just for returns).
4795
4796 2004-04-27  Martin Baulig  <martin@ximian.com>
4797
4798         * statement.cs (Block.AddLabel): Also check for implicit blocks
4799         and added a CS0158 check.
4800
4801 2004-04-27  Martin Baulig  <martin@ximian.com>
4802
4803         * flowanalysis.cs (FlowBranchingLoop): New class.
4804         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4805         UsageVector's instead of an ArrayList.
4806         (FlowBranching.Label): Likewise.
4807         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4808         (FlowBranching.AddBreakVector): New method.
4809
4810 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4811
4812         * attribute.cs: Small regression fix: only convert the type if we
4813         the type is different, fixes System.Drawing build.
4814
4815 2004-04-27  Martin Baulig  <martin@ximian.com>
4816
4817         * attribute.cs (Attribute.Resolve): If we have a constant value
4818         for a named field or property, implicity convert it to the correct
4819         type.
4820
4821 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4822
4823         * statement.cs (Block.Block): Implicit blocks share
4824         'child_variable_names' fields with parent blocks.
4825         (Block.AddChildVariableNames): Remove.
4826         (Block.AddVariable): Mark variable as "used by a child block" in
4827         every surrounding block.
4828         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4829         been used in a child block, complain about violation of "Invariant
4830         meaning in blocks" rule.
4831         * cs-parser.jay (declare_local_variables): Don't use
4832         AddChildVariableNames.
4833         (foreach_statement): Don't create an implicit block: 'foreach'
4834         introduces a scope.
4835
4836 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4837
4838         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4839         converting from 0L to ulong.  Fixes 57522.
4840
4841 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4842
4843         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4844         derived class hides via 'new' keyword field from base class (test-242.cs).
4845         TODO: Handle this in the more general way.
4846         
4847         * class.cs (CheckBase): Ditto.
4848
4849 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4850
4851         * decl.cs (caching_flags): New member for storing cached values
4852         as bit flags.
4853         (MemberCore.Flags): New enum where bit flags for caching_flags
4854         are defined.
4855         (MemberCore.cls_compliance): Moved to caching_flags.
4856         (DeclSpace.Created): Moved to caching_flags.
4857
4858         * class.cs: Use caching_flags instead of DeclSpace.Created
4859         
4860 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4861
4862         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4863         if we are only a derived class, not a nested class.
4864
4865         * typemanager.cs: Same as above, but do this at the MemberLookup
4866         level (used by field and methods, properties are handled in
4867         PropertyExpr).   Allow for the qualified access if we are a nested
4868         method. 
4869
4870 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4871
4872         * class.cs: Refactoring.
4873         (IMethodData): New inteface; Holds links to parent members
4874         to avoid member duplication (reduced memory allocation).
4875         (Method): Implemented IMethodData interface.
4876         (PropertyBase): New inner classes for get/set methods.
4877         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4878         (Event): New inner classes for add/remove methods.
4879         (Event.DelegateMethod): Implemented IMethodData interface.
4880
4881         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4882         EmitContext (related to class.cs refactoring).
4883
4884 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4885
4886         * delegate.cs (Delegate.VerifyApplicability): If the number of
4887         arguments are the same as the number of parameters, first try to
4888         verify applicability ignoring  any 'params' modifier on the last
4889         parameter.
4890         Fixes #56442.
4891
4892 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4893
4894         * class.cs (TypeContainer.AddIndexer): Use
4895         'ExplicitInterfaceName' to determine if interface name was
4896         explicitly specified.  'InterfaceType' is not initialized at this time.
4897         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4898         Indexers array is already in the required order.  Initialize
4899         'IndexerName' only if there are normal indexers.
4900         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4901         (TypeContainer.Emit): Emit DefaultMember attribute only if
4902         IndexerName is initialized.
4903         Fixes #56300.
4904
4905 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4906
4907         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4908         Fixes #57007
4909
4910 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4911
4912         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4913         attributes.
4914         Fix for #56456.
4915
4916         * attribute.cs (Attribute.Resolve): Check for duplicate named
4917         attributes.
4918         Fix for #56463.
4919
4920 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4921
4922         * iterators.cs (MarkYield): track whether we are in an exception,
4923         and generate code accordingly.  Use a temporary value to store the
4924         result for our state.
4925
4926         I had ignored a bit the interaction of try/catch with iterators
4927         since their behavior was not entirely obvious, but now it is
4928         possible to verify that our behavior is the same as MS .NET 2.0
4929
4930         Fixes 54814
4931
4932 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4933
4934         * iterators.cs: Avoid creating temporaries if there is no work to
4935         do. 
4936
4937         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4938         Enumerations, use TypeManager.EnumToUnderlying and call
4939         recursively. 
4940
4941         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4942         bug #57013
4943
4944         (This.Emit): Use EmitContext.EmitThis to emit our
4945         instance variable.
4946
4947         (This.EmitAssign): Ditto.
4948
4949         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4950         codepaths, we will move all the functionality into
4951         Mono.CSharp.This 
4952
4953         (FieldExpr.EmitAssign): Ditto.
4954
4955         This fixes several hidden bugs that I uncovered while doing a code
4956         review of this today.
4957
4958         * codegen.cs (EmitThis): reworked so the semantics are more clear
4959         and also support value types "this" instances.
4960
4961         * iterators.cs: Changed so that for iterators in value types, we
4962         do not pass the value type as a parameter.  
4963
4964         Initialization of the enumerator helpers is now done in the caller
4965         instead of passing the parameters to the constructors and having
4966         the constructor set the fields.
4967
4968         The fields have now `assembly' visibility instead of private.
4969
4970 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4971
4972         * expression.cs (Argument.Resolve): Check if fields passed as ref
4973         or out are contained in a MarshalByRefObject.
4974
4975         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4976         another compiler type.
4977
4978 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4979
4980         * class.cs (Indexer.Define): use the new name checking method.
4981         Also, return false on an error.
4982         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4983         (is_identifier_[start/part]_character): make static.
4984
4985 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4986
4987         * expression.cs (Binary.ResolveOperator): Do no append strings
4988         twice: since we can be invoked more than once (array evaluation)
4989         on the same concatenation, take care of this here.  Based on a fix
4990         from Ben (bug #56454)
4991
4992 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4993
4994         * codegen.cs: Fix another case where CS1548 must be reported (when 
4995         delay-sign isn't specified and no private is available #56564). Fix
4996         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4997         error when MCS is used on the MS runtime and we need to delay-sign 
4998         (which seems unsupported by AssemblyBuilder - see #56621).
4999
5000 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
5001
5002         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
5003         (TypeManager.ComputeNamespaces): Faster implementation for
5004         Microsoft runtime.
5005
5006         * compiler.csproj: Updated AssemblyName to mcs.
5007
5008 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5009
5010         * rootcontext.cs: Add new types to the boot resolution.
5011
5012         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5013         MulticastDelegate is not allowed.
5014
5015         * typemanager.cs: Add new types to lookup: System.TypedReference
5016         and ArgIterator.
5017
5018         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5019         check for TypedReference or ArgIterator, they are not allowed. 
5020
5021         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5022         makes us properly catch 1510 in some conditions (see bug 56016 for
5023         details). 
5024
5025 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5026
5027         * CryptoConvert.cs: update from corlib version
5028         with endian fixes.
5029
5030 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5031
5032         * class.cs (Indexer.Define): Check indexername declaration
5033
5034 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5035
5036         * attribute.cs (IsClsCompliant): Fixed problem with handling
5037         all three states (compliant, not-compliant, undetected).
5038
5039 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5040
5041         * attribute.cs (Attribute): Location is now public.
5042         (Resolve): Store resolved arguments (pos_values) in attribute class.
5043         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5044         (GetClsCompliantAttributeValue): New method that gets
5045         CLSCompliantAttribute value.
5046         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5047         if exists else null.
5048         (AttributeTester): New class for CLS-Compliant verification routines.
5049
5050         * class.cs (Emit): Add CLS-Compliant verification.
5051         (Method.GetSignatureForError): Implemented.
5052         (Constructor.GetSignatureForError): Implemented
5053         (Constructor.HasCompliantArgs): Returns if constructor has
5054         CLS-Compliant arguments.
5055         (Constructor.Emit): Override.
5056         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5057         is needed to test only parameters.
5058         (FieldBase.GetSignatureForError): Implemented.
5059         (TypeContainer): New member for storing base interfaces.
5060         (TypeContainer.FindMembers): Search in base interfaces too.
5061
5062         * codegen.cs (GetClsComplianceAttribute): New method that gets
5063         assembly or module CLSCompliantAttribute value.
5064         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5065         for assembly.
5066         (ModuleClass.Emit): Add error 3012 test.
5067
5068         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5069
5070         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5071         state for all decl types.
5072         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5073         if CLS-Compliant tests are required.
5074         (IsClsCompliaceRequired): New method. Analyze whether code
5075         must be CLS-Compliant.
5076         (IsExposedFromAssembly): New method. Returns true when MemberCore
5077         is exposed from assembly.
5078         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5079         value or gets cached value.
5080         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5081         is explicitly marked with CLSCompliantAttribute.
5082         (IsIdentifierClsCompliant): New abstract method. This method is
5083         used to testing error 3005.
5084         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5085         for identifier and parameters CLS-Compliant testing.
5086         (VerifyClsCompliance): New method. The main virtual method for
5087         CLS-Compliant verifications.
5088         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5089         null. I don't know why is null (too many public members !).
5090         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5091         and get value of first CLSCompliantAttribute that found.
5092
5093         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5094         (VerifyClsCompliance): Override and add extra tests.
5095
5096         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5097         clscheck- disable CLS-Compliant verification event if assembly is has
5098         CLSCompliantAttribute(true).
5099
5100         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5101         ApllyAttribute is now called in emit section as in the other cases.
5102         Possible future Emit integration.
5103         (IsIdentifierClsCompliant): New override.
5104         (VerifyClsCompliance): New override.
5105         (GetEnumeratorName): Returns full enum name.
5106
5107         * parameter.cs (GetSignatureForError): Implemented.
5108
5109         * report.cs (WarningData): New struct for Warning message information.
5110         (LocationOfPreviousError): New method.
5111         (Warning): New method. Reports warning based on the warning table.
5112         (Error_T): New method. Reports error based on the error table.
5113
5114         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5115         verifications are done here.
5116
5117         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5118
5119         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5120         CLSCompliantAttribute.
5121         (all_imported_types): New member holds all imported types from other
5122         assemblies.
5123         (LoadAllImportedTypes): New method fills static table with exported types
5124         from all referenced assemblies.
5125         (Modules): New property returns all assembly modules.
5126
5127 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5128
5129         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5130         throwing a parser error.
5131
5132         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5133         which removes the hardcoded get_/set_ prefixes for properties, as
5134         IL allows for the properties to be named something else.  
5135
5136         Bug #56013
5137
5138         * expression.cs: Do not override operand before we know if it is
5139         non-null.  Fix 56207
5140
5141 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5142
5143         * typemanager.cs: support for pinned variables.
5144
5145 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5146
5147         * decl.cs, typemanager.cs: Avoid using an arraylist
5148         as a buffer if there is only one result set.
5149
5150 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5151
5152         * expression.cs: Make sure you cant call a static method
5153         with an instance expression, bug #56174.
5154
5155 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5156
5157         * class.cs (IsDuplicateImplementation): Improve error reporting to
5158         flag 663 (method only differs in parameter modifier).
5159
5160         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5161         in preprocessor directives.
5162
5163         * location.cs (LookupFile): Allow for the empty path.
5164
5165         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5166         better approach for some of that patch, but its failing with the
5167         CharSet enumeration.  For now try/catch will do.
5168
5169         * typemanager.cs: Do not crash if a struct does not have fields.
5170         Fixes 56150.
5171
5172 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5173
5174         * expression.cs: cs0213, cant fix a fixed expression.
5175         fixes 50231.
5176
5177 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5178
5179         * cs-parser.jay: detect invalid embeded statements gracefully.
5180         bug #51113.
5181
5182 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5183
5184         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5185         As a regex:
5186         s/
5187         the invocation type may not be a subclass of the tye of the item/
5188         The type of the item must be a subclass of the invocation item.
5189         /g
5190
5191         Fixes bug #50820.
5192
5193 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5194
5195         * attribute.cs: Added methods to get a string and a bool from an
5196         attribute. Required to information from AssemblyKeyFileAttribute,
5197         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5198         * codegen.cs: Modified AssemblyName creation to include support for
5199         strongnames. Catch additional exceptions to report them as CS1548.
5200         * compiler.csproj: Updated include CryptoConvert.cs.
5201         * compiler.csproj.user: Removed file - user specific configuration.
5202         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5203         Mono.Security assembly. The original class is maintained and tested in
5204         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5205         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5206         like CSC 8.0 (C# v2) supports.
5207         * Makefile: Added CryptoConvert.cs to mcs sources.
5208         * rootcontext.cs: Added new options for strongnames.
5209
5210 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5211
5212         * driver.cs: For --expect-error, report error code `2'
5213         if the program compiled with no errors, error code `1' if
5214         it compiled with an error other than the one expected.
5215
5216 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5217
5218         * compiler.csproj: Updated for Visual Studio .NET 2003.
5219         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5220         * compiler.sln: Updated for Visual Studio .NET 2003.
5221
5222 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5223
5224         * expression.cs: Fix bug #47234. We basically need to apply the
5225         rule that we prefer the conversion of null to a reference type
5226         when faced with a conversion to 'object' (csc behaviour).
5227
5228 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5229
5230         * statement.cs: Shorter form for foreach, eliminates
5231         a local variable. r=Martin.
5232
5233 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5234
5235         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5236         checks if we can use brtrue/brfalse to test for 0.
5237         * expression.cs: use the above in the test for using brtrue/brfalse.
5238         cleanup code a bit.
5239
5240 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5241
5242         * expression.cs: Rewrite string concat stuff. Benefits:
5243
5244         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5245         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5246         rather than a concat chain.
5247
5248         * typemanager.cs: Add lookups for more concat overloads.
5249
5250 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5251
5252         * expression.cs: Emit shorter il code for array init.
5253
5254         newarr
5255         dup
5256         // set 1
5257
5258         // set 2
5259
5260         newarr
5261         stloc.x
5262
5263         ldloc.x
5264         // set 1
5265
5266         ldloc.x
5267         // set 2
5268
5269 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5270
5271         * statement.cs: Before, two switch blocks would be merged if the
5272         total size of the blocks (end_item - begin_item + 1) was less than
5273         two times the combined sizes of the blocks.
5274
5275         Now, it will only merge if after the merge at least half of the
5276         slots are filled.
5277
5278         fixes 55885.
5279
5280 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5281
5282         * class.cs : csc build fix for GetMethods(). See bug #52503.
5283
5284 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5285
5286         * expression.cs: Make sure fp comparisons work with NaN.
5287         This fixes bug #54303. Mig approved this patch a long
5288         time ago, but we were not able to test b/c the runtime
5289         had a related bug.
5290
5291 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5292
5293         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5294
5295 2004-03-19  Martin Baulig  <martin@ximian.com>
5296
5297         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5298         error here and not in our caller.
5299
5300 2004-03-19  Martin Baulig  <martin@ximian.com>
5301
5302         * interface.cs: Completely killed this file.
5303         (Interface): We're now a TypeContainer and live in class.cs.
5304
5305         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5306         argument; we're now also called for interfaces.
5307         (TypeContainer.DefineMembers): Allow this method being called
5308         multiple times.
5309         (TypeContainer.GetMethods): New public method; formerly known as
5310         Interface.GetMethod().  This is used by PendingImplementation.
5311         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5312         it's now private and non-static.
5313         (Interface): Moved this here; it's now implemented similar to
5314         Class and Struct.
5315         (Method, Property, Event, Indexer): Added `bool is_interface'
5316         argument to their .ctor's.
5317         (MemberBase.IsInterface): New public field.
5318
5319         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5320         instances instead of InterfaceMethod, InterfaceProperty, etc.
5321         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5322         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5323
5324 2004-03-19  Martin Baulig  <martin@ximian.com>
5325
5326         * class.cs (MethodCore.IsDuplicateImplementation): New private
5327         method which does the CS0111 checking.
5328         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5329         Use IsDuplicateImplementation().
5330
5331 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5332
5333         * decl.cs (FindMemberToOverride): New method to find the correct
5334         method or property to override in the base class.
5335         * class.cs
5336             - Make Method/Property use the above method to find the
5337               version in the base class.
5338             - Remove the InheritableMemberSignatureCompare as it is now
5339               dead code.
5340
5341         This patch makes large code bases much faster to compile, as it is
5342         O(n) rather than O(n^2) to do this validation.
5343
5344         Also, it fixes bug 52458 which is that nested classes are not
5345         taken into account when finding the base class member.
5346
5347         Reviewed/Approved by Martin.
5348
5349 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5350
5351         * interface.cs: In all interface classes removed redundant
5352         member initialization.
5353
5354 2004-03-16  Martin Baulig  <martin@ximian.com>
5355
5356         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5357
5358 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5359
5360         * decl.cs (DefineTypeAndParents): New helper method to define a
5361         type's containers before the type itself is defined;  This is a
5362         bug exposed by the recent changes to Windows.Forms when an
5363         implemented interface was defined inside a class that had not been
5364         built yet.   
5365
5366         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5367
5368         (Check): Loop correctly to report errors modifiers
5369         (UNSAFE was not in the loop, since it was the same as TOP).
5370
5371         * interface.cs: Every interface member now takes a ModFlags,
5372         instead of a "is_new" bool, which we set on the base MemberCore. 
5373
5374         Every place where we called "UnsafeOk" in the interface, now we
5375         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5376         the unsafe settings from the member declaration instead of the
5377         container interface. 
5378
5379         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5380
5381         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5382         `set_indexer_name' to the pending bits (one per type).
5383
5384         We fixed a bug today that was picking the wrong method to
5385         override, since for properties the existing InterfaceMethod code
5386         basically ignored the method name.  Now we make sure that the
5387         method name is one of the valid indexer names.
5388
5389 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5390  
5391         * support.cs (SeekableStreamReader): Keep track of stream byte
5392         positions and don't mix them with character offsets to the buffer.
5393
5394         Patch from Gustavo Giráldez
5395
5396 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5397
5398         * interface.cs (InterfaceSetGetBase): Removed double member
5399         initialization, base class does it as well.
5400
5401 2004-03-13  Martin Baulig  <martin@ximian.com>
5402
5403         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5404         when compiling corlib.
5405
5406 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5407
5408         * convert.cs (ExplicitConversion): We were reporting an error on
5409         certain conversions (object_type source to a value type, when the
5410         expression was `null') before we had a chance to pass it through
5411         the user defined conversions.
5412
5413         * driver.cs: Replace / and \ in resource specifications to dots.
5414         Fixes 50752
5415
5416         * class.cs: Add check for duplicate operators.  Fixes 52477
5417
5418 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5419
5420         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5421         that are in the middle of the statements, not only at the end.
5422         Fixes #54987
5423
5424         * class.cs (TypeContainer.AddField): No longer set the
5425         `HaveStaticConstructor' flag, now we call it
5426         `UserDefineStaticConstructor' to diferentiate the slightly
5427         semantic difference.
5428
5429         The situation is that we were not adding BeforeFieldInit (from
5430         Modifiers.TypeAttr) to classes that could have it.
5431         BeforeFieldInit should be set to classes that have no static
5432         constructor. 
5433
5434         See:
5435
5436         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5437
5438         And most importantly Zoltan's comment:
5439
5440         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5441
5442         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5443          before its static fields are used', i.e. initialization does not need
5444          to be triggered by the first access to the type. Setting this flag
5445          helps the JIT to compile better code, since it can run the static
5446          constructor at JIT time, and does not need to generate code to call it
5447          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5448          this flag for lots of classes like String. 
5449          
5450          csc sets this flag if the type does not have an explicit static 
5451          constructor. The reasoning seems to be that if there are only static
5452          initalizers for a type, and no static constructor, then the programmer
5453          does not care when this initialization happens, so beforefieldinit
5454          can be used.
5455          
5456          This bug prevents the AOT compiler from being usable, since it 
5457          generates so many calls to mono_runtime_class_init that the AOT code
5458          is much slower than the JITted code. The JITted code is faster, 
5459          because it does not generate these calls if the vtable is type is
5460          already initialized, which is true in the majority of cases. But the
5461          AOT compiler can't do this."
5462
5463 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5464
5465         * class.cs (MethodData.Emit): Refactor the code so symbolic
5466         information is generated for destructors;  For some reasons we
5467         were taking a code path that did not generate symbolic information
5468         before. 
5469
5470 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5471
5472         * class.cs: Create a Constructor.CheckBase method that
5473         takes care of all validation type code. The method
5474         contains some code that was moved from Define.
5475
5476         It also includes new code that checks for duplicate ctors.
5477         This fixes bug #55148.
5478
5479 2004-03-09  Joshua Tauberer <tauberer@for.net>
5480
5481         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5482         a { ... }-style array creation invokes EmitStaticInitializers
5483         which is not good for reference-type arrays.  String, decimal
5484         and now null constants (NullCast) are not counted toward
5485         static initializers.
5486
5487 2004-03-05  Martin Baulig  <martin@ximian.com>
5488
5489         * location.cs (SourceFile.HasLineDirective): New public field;
5490         specifies whether the file contains or is referenced by a "#line"
5491         directive.
5492         (Location.DefineSymbolDocuments): Ignore source files which
5493         either contain or are referenced by a "#line" directive.        
5494
5495 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5496
5497         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5498         direct access to our parent, so check the method inline there.
5499
5500 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5501
5502         * expression.cs (Invocation.EmitCall): Miguel's last commit
5503         caused a regression. If you had:
5504
5505             T t = null;
5506             t.Foo ();
5507
5508         In Foo the implict this would be null.
5509
5510 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5511
5512         * expression.cs (Invocation.EmitCall): If the method is not
5513         virtual, do not emit a CallVirt to it, use Call.
5514
5515         * typemanager.cs (GetFullNameSignature): Improve the method to
5516         cope with ".ctor" and replace it with the type name.
5517
5518         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5519         as an argument the ConstructorBuilder where it is being defined,
5520         to catch the recursive constructor invocations.
5521
5522 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5523
5524         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5525         routines to check if a type is an enumerable/enumerator allow
5526         classes that implement the IEnumerable or IEnumerator interfaces.
5527
5528         * class.cs (Property, Operator): Implement IIteratorContainer, and
5529         implement SetYields.
5530
5531         (Property.Define): Do the block swapping for get_methods in the
5532         context of iterators.   We need to check if Properties also
5533         include indexers or not.
5534
5535         (Operator): Assign the Block before invoking the
5536         OperatorMethod.Define, so we can trigger the Iterator code
5537         replacement. 
5538
5539         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5540         Property and Operator classes are not created when we parse the
5541         declarator but until we have the block completed, so we use a
5542         singleton SimpleIteratorContainer.Simple to flag whether the
5543         SetYields has been invoked.
5544
5545         We propagate this setting then to the Property or the Operator to
5546         allow the `yield' to function.
5547
5548 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5549
5550         * codegen.cs: Implemented attribute support for modules.
5551         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5552         Assembly/Module functionality.
5553
5554         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5555         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5556         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5557
5558 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5559
5560         * interface.cs (FindMembers): The operation is performed on all base
5561         interfaces and not only on the first. It is required for future CLS Compliance patch.
5562
5563 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5564
5565         * statement.cs, codegen.cs:
5566         This patch deals with patterns such as:
5567
5568         public class List : IEnumerable {
5569
5570                 public MyEnumerator GetEnumerator () {
5571                         return new MyEnumerator(this);
5572                 }
5573
5574                 IEnumerator IEnumerable.GetEnumerator () {
5575                         ...
5576                 }
5577                 
5578                 public struct MyEnumerator : IEnumerator {
5579                         ...
5580                 }
5581         }
5582
5583         Before, there were a few things we did wrong:
5584         1) we would emit callvirt on a struct, which is illegal
5585         2) we emited ldarg when we needed to emit ldarga
5586         3) we would mistakenly call the interface methods on an enumerator
5587         type that derived from IEnumerator and was in another assembly. For example:
5588
5589         public class MyEnumerator : IEnumerator
5590
5591         Would have the interface methods called, even if there were public impls of the
5592         method. In a struct, this lead to invalid IL code.
5593
5594 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5595
5596         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5597           renamed to Emit.
5598
5599         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5600
5601 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5602
5603         * cs-parser.jay: Fix small regression: we were not testing V2
5604         compiler features correctly.
5605
5606         * interface.cs: If the emit context is null, then create one
5607
5608 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5609
5610         * decl.cs (GetSignatureForError): New virtual method to get full name
5611           for error messages.
5612
5613         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5614           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5615
5616         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5617           Duplicated members and code in these classes has been removed.
5618           Better encapsulation in these classes.
5619
5620 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5621
5622         * assign.cs (Assign.DoResolve): When dealing with compound
5623         assignments, there is a new rule in ECMA C# 2.4 (might have been
5624         there before, but it is documented here) that states that in:
5625
5626         a op= b;
5627
5628         If b is of type int, and the `op' is a shift-operator, then the
5629         above is evaluated as:
5630
5631         a = (int) a op b 
5632
5633         * expression.cs (Binary.ResolveOperator): Instead of testing for
5634         int/uint/long/ulong, try to implicitly convert to any of those
5635         types and use that in pointer arithmetic.
5636
5637         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5638         method to print information for from the type, not from the
5639         null-method we were given.
5640
5641 2004-02-01  Duncan Mak  <duncan@ximian.com>
5642
5643         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
5644         parsing for cmd, fixes bug #53694.
5645
5646 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
5647
5648         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
5649         in the member name duplication tests. Property and operator name duplication
5650         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
5651
5652 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
5653
5654         * interface.cs (PopulateMethod): Fixed crash when interface method
5655         returns not existing type (error test cs0246-3.cs).
5656
5657 2004-02-02  Ravi Pratap M <ravi@ximian.com>
5658
5659         * cs-parser.jay (interface_accessors): Re-write actions to also
5660         store attributes attached to get and set methods. Fix spelling
5661         while at it.
5662
5663         (inteface_property_declaration): Modify accordingly.
5664
5665         (InterfaceAccessorInfo): New helper class to store information to pass
5666         around between rules that use interface_accessors.
5667
5668         * interface.cs (Emit): Apply attributes on the get and set
5669         accessors of properties and indexers too.
5670
5671         * attribute.cs (ApplyAttributes): Modify accordingly to use the
5672         right MethodBuilder when applying attributes to the get and set accessors.
5673
5674 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
5675
5676         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
5677
5678 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
5679
5680         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
5681
5682 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
5683
5684         * cs-parser.jay: Remove YIELD token, instead use the new grammar
5685         changes that treat `yield' specially when present before `break'
5686         or `return' tokens.
5687
5688         * cs-tokenizer.cs: yield is no longer a keyword.
5689
5690 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
5691
5692         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
5693         setting for default constructors.
5694         For default constructors are almost every time set wrong Modifier. The
5695         generated IL code has been alright. But inside mcs this values was
5696         wrong and this was reason why several of my CLS Compliance tests
5697         failed.
5698
5699 2004-01-22  Martin Baulig  <martin@ximian.com>
5700
5701         * cs-parser.jay (namespace_or_type_name): Return an Expression,
5702         not a QualifiedIdentifier.  This is what `type_name_expression'
5703         was previously doing.
5704         (type_name_expression): Removed; the code is now in
5705         `namespace_or_type_name'.
5706         (qualified_identifier): Removed, use `namespace_or_type_name'
5707         instead.
5708         (QualifiedIdentifier): Removed this class.      
5709
5710 2004-01-22  Martin Baulig  <martin@ximian.com>
5711
5712         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
5713         not a string as alias name.
5714
5715 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
5716
5717         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
5718         #52730 bug, and instead compute correctly the need to use a
5719         temporary variable when requesting an address based on the
5720         static/instace modified of the field and the constructor.
5721  
5722 2004-01-21  Martin Baulig  <martin@ximian.com>
5723
5724         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
5725         class and namespace before looking up aliases.  Fixes #52517.
5726
5727 2004-01-21  Martin Baulig  <martin@ximian.com>
5728
5729         * flowanalysis.cs (UsageVector.Merge): Allow variables being
5730         assinged in a 'try'; fixes exception4.cs.
5731
5732 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5733         * class.cs : Implemented parameter-less constructor for TypeContainer
5734
5735         * decl.cs: Attributes are now stored here. New property OptAttributes
5736
5737         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
5738
5739         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
5740
5741 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5742
5743         * typemanager.cs (CSharpSignature): Now reports also inner class name.
5744           (CSharpSignature): New method for indexer and property signature.
5745
5746 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5747
5748         * pending.cs (IsVirtualFilter): Faster implementation.
5749
5750 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5751
5752         * typemanager.cs: Avoid inclusion of same assembly more than once.
5753
5754 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5755
5756         * cs-parser.jay: Fixed problem where the last assembly attribute
5757           has been applied also to following declaration (class, struct, etc.)
5758           
5759 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5760
5761         * class.cs: Added error CS0538, CS0539 reporting.
5762         Fixed crash on Microsoft runtime when field type is void.
5763
5764         * cs-parser.jay: Added error CS0537 reporting.
5765
5766         * pending.cs: Added error CS0535 reporting.
5767         Improved error report for errors CS0536, CS0534.
5768
5769 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
5770
5771         Merge a few bits from the Anonymous Method MCS tree.
5772
5773         * statement.cs (ToplevelBlock): New class for toplevel methods,
5774         will hold anonymous methods, lifted variables.
5775
5776         * cs-parser.jay: Create toplevel blocks for delegates and for
5777         regular blocks of code. 
5778
5779 2004-01-20  Martin Baulig  <martin@ximian.com>
5780
5781         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
5782         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
5783         and `NeedExplicitReturn'; added `IsLastStatement'.
5784         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
5785         have a `ReturnLabel' or we're not unreachable.
5786
5787         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
5788         child's reachability; don't just override ours with it.  Fixes
5789         #58058 (lluis's example).
5790         (FlowBranching): Added public InTryOrCatch(), InCatch(),
5791         InFinally(), InLoop(), InSwitch() and
5792         BreakCrossesTryCatchBoundary() methods.
5793
5794         * statement.cs (Return): Do all error checking in Resolve().
5795         Unless we are the last statement in a top-level block, always
5796         create a return label and jump to it.
5797         (Break, Continue): Do all error checking in Resolve(); also make
5798         sure we aren't leaving a `finally'.
5799         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
5800         statement in a top-level block.
5801         (Block.Flags): Added `IsDestructor'.
5802         (Block.IsDestructor): New public property.
5803
5804 2004-01-20  Martin Baulig  <martin@ximian.com>
5805
5806         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
5807
5808 2004-01-20  Martin Baulig  <martin@ximian.com>
5809
5810         * statement.cs (Statement.ResolveUnreachable): New public method.
5811         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
5812         (Block.Resolve): Resolve unreachable statements.
5813
5814 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5815
5816         * expression.cs: We need to fix the case where we do
5817         not have a temp variable here.
5818
5819         * assign.cs: Only expression compound assignments need
5820         temporary variables.
5821
5822 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5823
5824         * flowanalysis.cs: Reduce memory allocation in a few ways:
5825           - A block with no variables should not allocate a bit
5826             vector for itself.
5827           - A method with no out parameters does not need any tracking
5828             for assignment of the parameters, so we need not allocate
5829             any data for it.
5830           - The arrays:
5831                 public readonly Type[] VariableTypes;
5832                 public readonly string[] VariableNames;
5833             Are redundant. The data is already stored in the variable
5834             map, so we need not allocate another array for it.
5835           - We need to add alot of checks for if (params | locals) == null
5836             due to the first two changes.
5837
5838 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
5839
5840         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
5841         implement IMemoryLocation, we store a copy on a local variable and
5842         take the address of it.  Patch from Benjamin Jemlich
5843
5844         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
5845         to use a special "type_name_expression" rule which reduces the
5846         number of "QualifiedIdentifier" classes created, and instead
5847         directly creates MemberAccess expressions.
5848
5849 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
5850
5851         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
5852         that fixes #52853.  Null literal assignment to ValueType
5853
5854         * class.cs (MethodData.Emit): Instead of checking the name of the
5855         method to determine if its a destructor, create a new derived
5856         class from Method called Destructor, and test for that.  
5857
5858         * cs-parser.jay: Create a Destructor object instead of a Method.  
5859
5860         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
5861
5862         Fixes: 52933
5863
5864 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
5865
5866         * expression.cs (Binary.ResolveOperator): Perform an implicit
5867         conversion from MethodGroups to their delegate types on the
5868         Addition operation.
5869
5870         * delegate.cs: Introduce a new class DelegateCreation that is the
5871         base class for `NewDelegate' and `ImplicitDelegateCreation',
5872         factor some code in here.
5873
5874         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
5875         conversion from MethodGroups to compatible delegate types. 
5876
5877         * ecore.cs (Expression.Resolve): Do not flag error 654
5878         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
5879         we allow conversions from MethodGroups to delegate types now.
5880
5881         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
5882         assignments in v2 either.
5883
5884 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
5885
5886         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
5887         static read-only fields in ctors.
5888
5889         Applied patch from Benjamin Jemlich 
5890
5891         * expression.cs (UnaryMutator): Avoid leaking local variables. 
5892
5893 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
5894
5895         * cs-tokenizer.cs (IsCastToken): Allow the various native types
5896         here to return true, as they can be used like this:
5897
5898                 (XXX) int.MEMBER ()
5899
5900         Fixed 49836 and all the other dups
5901
5902 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
5903
5904         * driver.cs: Implement /win32res and /win32icon.
5905
5906 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
5907
5908         * cs-parser.jay: Add a rule to improve error handling for the
5909         common mistake of placing modifiers after the type.
5910
5911 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
5912
5913         * cs-parser.jay (interface_event_declaration): Catch
5914         initialization of events on interfaces, and report cs0068
5915
5916         * cs-parser.jay (interface_event_declaration): Catch
5917         initialization of events. 
5918
5919         * ecore.cs: Better report missing constructors.
5920
5921         * expression.cs (Binary.ResolveOperator): My previous bug fix had
5922         the error reporting done in the wrong place.  Fix.
5923
5924         * expression.cs (Binary.ResolveOperator): Catch the 
5925         operator + (E x, E y) error earlier, and later allow for implicit
5926         conversions in operator +/- (E e, U x) from U to the underlying
5927         type of E.
5928
5929         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
5930         52596, if the container class is abstract, the default constructor
5931         is protected otherwise its public (before, we were always public).
5932
5933         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
5934         fixed statement.
5935
5936         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
5937         Jemlich that fixes bug #52597, MCS was generating invalid code for
5938         idisposable structs.   Thanks to Ben for following up with this
5939         bug as well.
5940
5941 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
5942
5943         * driver.cs: Allow assemblies without code to be generated, fixes
5944         52230.
5945
5946 2004-01-07  Nick Drochak <ndrochak@gol.com>
5947
5948         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
5949
5950 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
5951
5952         * cs-parser.jay: Add rules to improve error reporting if fields or
5953         methods are declared at the namespace level (error 116)
5954
5955         * Add rules to catch event add/remove
5956
5957 2004-01-04  David Sheldon <dave-mono@earth.li>
5958
5959   * expression.cs: Added matching ")" to error message for 
5960   CS0077
5961
5962 2004-01-03 Todd Berman <tberman@gentoo.org>
5963
5964         * ecore.cs, attribute.cs:
5965         Applying fix from #52429.
5966
5967 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5968
5969         * ecore.cs, expression.cs, statement.cs:
5970         Total rewrite of how we handle branching. We
5971         now handle complex boolean expressions with fewer
5972         jumps. As well if (x == 0) no longer emits a ceq.
5973
5974         if (x is Foo) is much faster now, because we generate
5975         better code.
5976
5977         Overall, we get a pretty big improvement on our benchmark
5978         tests. The code we generate is smaller and more readable.
5979
5980         I did a full two-stage bootstrap. The patch was reviewed
5981         by Martin and Miguel.
5982
5983 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5984
5985         * cs-parser.jay: Make primary_expression not take a QI.
5986         we dont need this because the member_access rule covers
5987         us here. So we replace the rule with just IDENTIFIER.
5988
5989         This has two good effects. First, we remove a s/r conflict.
5990         Second, we allocate many fewer QualifiedIdentifier objects.
5991
5992 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5993
5994         * attribute.cs: Handle MarshalAs attributes as pseudo, and
5995         set the correct information via SRE. This prevents
5996         hanging on the MS runtime. Fixes #29374.
5997
5998 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5999
6000         * convert.cs: correctly handle conversions to value types
6001         from Enum and ValueType as unboxing conversions.
6002
6003         Fixes bug #52569. Patch by Benjamin Jemlich.
6004
6005 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6006
6007         * expression.cs (BetterConversion): Prefer int -> uint
6008         over int -> ulong (csc's behaviour). This fixed bug #52046.
6009
6010 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6011
6012         * decl.cs (MemberCache.FindMembers): now returns a
6013         MemberInfo [].
6014
6015         * typemanager.cs: In general, go with with ^^.
6016         (CopyNewMethods): take an IList.
6017         (RealMemberLookup): Only allocate an arraylist
6018         if we copy from two sets of methods.
6019
6020         This change basically does two things:
6021         1) Fewer array lists allocated due to CopyNewMethods.
6022         2) the explicit cast in MemberList costed ALOT.
6023
6024 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6025
6026         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6027         a hashtable to avoid needless string allocations when an identifier is
6028         used more than once (the common case).
6029
6030 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6031
6032         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6033         is broken, it will not return anything. So, we
6034         have to use the information we have in mcs to
6035         do the task.
6036
6037         * typemanager.cs: Add a cache for GetInterfaces,
6038         since this will now be used more often (due to ^^)
6039
6040         (GetExplicitInterfaces) New method that gets the
6041         declared, not effective, interfaces on a type
6042         builder (eg, if you have interface IFoo, interface
6043         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6044         { IBar }.
6045
6046         This patch makes MCS able to bootstrap itself on
6047         Windows again.
6048
6049 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6050
6051         * expression.cs: Remove the Nop's that Miguel put
6052         in by mistake.
6053
6054 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6055
6056         * report.cs, codegen.cs: Give the real stack trace to
6057         the error when an exception is thrown.
6058
6059 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6060
6061         * decl.cs: only allocate hashtables for ifaces if 
6062         it is an iface!
6063
6064 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6065
6066         * expression.cs: fix the error from cs0121-2.cs
6067         (a parent interface has two child interfaces that
6068         have a function with the same name and 0 params
6069         and the function is called through the parent).
6070
6071 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6072
6073         * class.cs, rootcontext.cs, typmanager.cs: do not
6074         leak pointers.
6075
6076 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6077
6078         * codegen.cs: remove stack for the ec flow branching.
6079         It is already a linked list, so no need.
6080
6081 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6082
6083         * Makefile: Allow custom profiler here.
6084
6085 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6086
6087         * typemanager.cs (LookupType):
6088           - Use a static char [], because split takes
6089             a param array for args, so it was allocating
6090             every time.
6091           - Do not store true in a hashtable, it boxes.
6092
6093 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6094
6095         * flowanalysis.cs: bytify common enums.
6096
6097 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6098
6099         * modifiers.cs: Add a new set of flags for the
6100         flags allowed on explicit interface impls.
6101         * cs-parser.jay: catch the use of modifiers in
6102         interfaces correctly.
6103         * class.cs: catch private void IFoo.Blah ().
6104
6105         All related to bug #50572.
6106
6107 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6108
6109         * decl.cs: Rewrite the consistant accessability checking.
6110         Accessability is not linear, it must be implemented in
6111         a tableish way. Fixes #49704.
6112
6113 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6114
6115         * expression.cs: Handle negation in a checked context.
6116         We must use subtraction from zero. Fixes #38674.
6117
6118 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6119
6120         * class.cs: Ignore static void main in DLLs.
6121         * rootcontext.cs: Handle the target type here,
6122         since we are have to access it from class.cs
6123         * driver.cs: account for the above.
6124
6125 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6126
6127         * report.cs: Give line numbers and files if available.
6128
6129 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6130
6131         * driver.cs: Implement /addmodule.
6132
6133         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6134         ModuleBuilders.
6135
6136 2003-12-20  Martin Baulig  <martin@ximian.com>
6137
6138         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6139         (FieldBase.IsAssigned): Removed this field.
6140         (FieldBase.SetAssigned): New public method.
6141         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6142
6143 2003-12-20  Martin Baulig  <martin@ximian.com>
6144
6145         * expression.cs (LocalVariableReference.DoResolve): Don't set
6146         `vi.Used' if we're called from DoResolveLValue().
6147
6148         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6149         returns the usage vector it just merged into the current one -
6150         pass this one to UsageWarning().
6151         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6152         of the `EmitContext', don't call this recursively on our children.
6153
6154 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6155
6156         * driver.cs: Implement /target:module.
6157
6158 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6159
6160         * support.cs (CharArrayHashtable): New helper class.
6161
6162         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6163         char arrays, not strings, so we can avoid creating a string in
6164         consume_identifier if the identifier is a keyword.
6165
6166 2003-12-16  Martin Baulig  <martin@ximian.com>
6167
6168         * statement.cs (LocalInfo.Assigned): Removed this property.
6169         (LocalInfo.Flags): Removed `Assigned'.
6170         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6171         and uses flow analysis.
6172         (Block.UsageWarning): Made this method private.
6173         (Block.Resolve): Call UsageWarning() if appropriate.
6174
6175         * expression.cs (LocalVariableReference.DoResolve): Always set
6176         LocalInfo.Used here.
6177
6178 2003-12-13  Martin Baulig  <martin@ximian.com>
6179
6180         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6181         any value here; we're now using flow analysis to figure out
6182         whether a statement/block returns a value.
6183
6184 2003-12-13  Martin Baulig  <martin@ximian.com>
6185
6186         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6187         working again.
6188         (FlowBranching.MergeFinally): Don't call
6189         `branching.CheckOutParameters()' here, this is called in
6190         MergeTopBlock().
6191         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6192         when adding the `finally' vector.       
6193
6194 2003-12-13  Martin Baulig  <martin@ximian.com>
6195
6196         * flowanalysis.cs
6197         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6198         actually work and also fix #48962.
6199
6200 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6201
6202         * decl.cs: Do not check System.Object for nested types,
6203         since we know it does not have any. Big bang for buck:
6204
6205         BEFORE:
6206            Run 1:   8.35 seconds
6207            Run 2:   8.32 seconds
6208            corlib:  17.99 seconds
6209         AFTER:
6210            Run 1:   8.17 seconds
6211            Run 2:   8.17 seconds
6212            corlib:  17.39 seconds
6213
6214 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6215
6216         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6217         time we are returning 0 members, so we save alot here.
6218
6219 2003-12-11  Martin Baulig  <martin@ximian.com>
6220
6221         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6222         `MergeChild()', also just take the `FlowBranching' as argument;
6223         call Merge() on it and return the result.
6224         (FlowBranching.Merge): We don't need to do anything if we just
6225         have one sibling.
6226
6227 2003-12-11  Martin Baulig  <martin@ximian.com>
6228
6229         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6230         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6231         Maurer for this idea.
6232
6233 2003-12-11  Martin Baulig  <martin@ximian.com>
6234
6235         * flowanalysis.cs (MergeResult): This class is now gone; we now
6236         use the `UsageVector' for this.  The reason for this is that if a
6237         branching just has one sibling, we don't need to "merge" them at
6238         all - that's the next step to do.
6239         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6240         `MergeResult'.
6241
6242 2003-12-11  Martin Baulig  <martin@ximian.com>
6243
6244         Reworked flow analyis and made it more precise and bug-free.  The
6245         most important change is that we're now using a special `Reachability'
6246         class instead of having "magic" meanings of `FlowReturns'.  I'll
6247         do some more cleanups and optimizations and also add some more
6248         documentation this week.
6249
6250         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6251         largely reworked this class.
6252         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6253         the new `Reachability' class instead of having "magic" values here.
6254         (FlowBranching): We're now using an instance of `Reachability'
6255         instead of having separate `Returns', `Breaks' etc. fields.
6256
6257         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6258         based on flow analysis; ignore the return value of block.Emit ().
6259
6260 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6261
6262         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6263         if they are private.
6264
6265 2003-12-09  Martin Baulig  <martin@ximian.com>
6266
6267         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6268         call them directly on the UsageVector.
6269
6270 2003-12-09  Martin Baulig  <martin@ximian.com>
6271
6272         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6273         Changed return type from `FlowReturns' to `Reachability'.
6274
6275 2003-12-09  Martin Baulig  <martin@ximian.com>
6276
6277         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6278         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6279         `Reachable' fields with a single `Reachability' one.
6280
6281 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6282
6283         * class.cs (FindMembers): Remove foreach's.
6284
6285         Bootstrap times:
6286
6287         BEFORE
6288                 Run 1:   8.74 seconds
6289                 Run 2:   8.71 seconds
6290
6291         AFTER
6292                 Run 1:   8.64 seconds
6293                 Run 2:   8.58 seconds
6294
6295
6296 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6297
6298         * cs-parser.jay:
6299         * gen-treedump.cs:
6300         * statement.cs:
6301         This patch does a few things:
6302                 1. EmptyStatement is now a singleton, so it is never reallocated.
6303                 2. All blah is EmptyStatement constructs have been changed to
6304                    blah == EmptyStatement.Value, which is much faster and valid
6305                    now that EmptyStatement is a singleton.
6306                 3. When resolving a block, rather than allocating a new array for
6307                    the non-empty statements, empty statements are replaced with
6308                    EmptyStatement.Value
6309                 4. Some recursive functions have been made non-recursive.
6310         Mainly the performance impact is from (3), however (1) and (2) are needed for
6311         this to work. (4) does not make a big difference in normal situations, however
6312         it makes the profile look saner.
6313
6314         Bootstrap times:
6315
6316         BEFORE
6317         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6318         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6319         Total memory allocated: 56397 KB
6320
6321         AFTER
6322         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6323         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6324         Total memory allocated: 55666 KB
6325
6326 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6327
6328         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6329         than the hashtable in a hashtable version
6330
6331         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6332         we always end up concating a string. This results in a huge perf
6333         loss, because many strings have to be tracked by the GC. In this
6334         patch, we first use a hashtable that works with two keys, so that
6335         the strings do not need to be concat'ed.
6336
6337         Bootstrap times:
6338         BEFORE
6339                 Run 1:   8.74 seconds
6340                 Run 2:   8.71 seconds
6341
6342         AFTER
6343                 Run 1:   8.65 seconds
6344                 Run 2:   8.56 seconds
6345
6346 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6347
6348         * Makefile: Add a new target `do-time' that does a quick and simple
6349         profile, leaving easy to parse output.
6350
6351 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6352
6353         * codegen.cs (Init): Create the dynamic assembly with 
6354         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6355
6356 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6357
6358         * support.cs: Make the PtrHashtable use only one
6359         instance of its comparer.
6360
6361 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6362
6363         * typemanager.cs: Fix lookup of GetNamespaces.
6364
6365 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6366
6367         * expression.cs: Removed redundant line.
6368
6369         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6370         ArrayLists, use for loops with bounds.  
6371
6372         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6373         arraylist.
6374
6375         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6376         arraylists, use for loop with bounds.
6377
6378         The above three changes give us a 0.071 second performance
6379         improvement out of 3.294 seconds down to 3.223.  On my machine
6380         the above changes reduced the memory usage by 1,387 KB during
6381         compiler bootstrap.
6382
6383         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6384         QualifiedIdentifiers.  Before we created a new string through
6385         concatenation, and mostly later on, the result would be
6386         manipulated by DecomposeQI through string manipulation.
6387
6388         This reduced the compiler memory usage for bootstrapping from
6389         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6390         compile times in 0.05 seconds.
6391
6392 2003-11-28  Dick Porter  <dick@ximian.com>
6393
6394         * support.cs: Do string compares with the Invariant culture.
6395
6396         * rootcontext.cs: 
6397         * gen-treedump.cs: 
6398         * expression.cs: 
6399         * driver.cs: 
6400         * decl.cs: 
6401         * codegen.cs: 
6402         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6403         the comparison is done with the Invariant culture.
6404
6405 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6406
6407         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6408         GetEnumerator method.
6409
6410         (ProbeCollectionType): Iterate starting at the most specific type
6411         upwards looking for a GetEnumerator
6412
6413         * expression.cs: Shift count can be up to 31 for int/uint and 63
6414         for long/ulong.
6415
6416 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6417
6418         * statement.cs (Block.LookupLabel): Also look for the label on the
6419         children blocks.  Use a hash table to keep track of visited
6420         nodes. 
6421
6422         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6423         we actually did transform the other operand, otherwise fall back
6424         to the common codepath that casts to long.
6425
6426         * cs-tokenizer.cs: Use the same code pattern as the int case.
6427         Maybe I should do the parsing myself, and avoid depending on the
6428         Parse routines to get this done.
6429
6430 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6431
6432         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6433         which fixes bug 51347.  This time test it.
6434
6435         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6436         attributes for example can not tell the difference between these.
6437         The difference was only a syntax feature of the language. 
6438
6439         * attribute.cs: Apply attributes to delegates.
6440
6441         * delegate.cs: Call the apply attributes method.
6442
6443 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6444
6445         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6446         comparing 0 vs Byte.MinValue, not the value
6447
6448         (ImplicitConversionRequired): When reporting a conversion error,
6449         use error 31 to print out the constant error instead of the
6450         simpler 29.
6451
6452         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6453         which fixes bug 51347.
6454
6455 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6456
6457         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6458         which fixes the -warnaserror command line option.
6459
6460 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6461
6462         * cfold.cs (DoNumericPromotions): During constant folding of
6463         additions on UIntConstant, special case intconstants with
6464         IntConstants like we do on the expression binary operator. 
6465
6466 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6467
6468         * convert.cs (ImplicitReferenceConversion): We were missing a case
6469         (System.Enum are not value types or class types, so we need to
6470         classify them separatedly).
6471
6472         * driver.cs: We do not support error 2007.
6473
6474 2003-11-12 Jackson Harper <jackson@ximian.com>
6475
6476         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6477         system directory. Also use the full file name so users can
6478         libraries names mscorlib-o-tron.dll in a non system dir.
6479
6480 2003-11-10  Martin Baulig  <martin@ximian.com>
6481
6482         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6483         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6484         calling `ResolveType()' on them, directly assign their `Type'.
6485
6486 2003-11-08  Martin Baulig  <martin@ximian.com>
6487
6488         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6489         return value and the `out parent' parameter.
6490         (TypeContainer.DefineType): Moved the CS0644 check into
6491         GetClassBases().  Don't pass the interface types to the
6492         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6493         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6494
6495         * ecore.cs (TypeExpr.IsAttribute): New property.
6496         (TypeExpr.GetInterfaces): New method.
6497
6498         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6499         TypeExpr instead of a Type.
6500         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6501         (Interface.DefineType): Don't pass the interface types to the
6502         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6503         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6504
6505         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6506         instead of a `Type[]'.
6507         (TypeManager.RegisterBuilder): Likewise.
6508         (TypeManager.AddUserInterface): Likewise.
6509         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6510         `Type[]' and also return a `TypeExpr[]'.
6511         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6512
6513 2003-11-08  Martin Baulig  <martin@ximian.com>
6514
6515         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6516         Expression.     
6517
6518 2003-11-08  Martin Baulig  <martin@ximian.com>
6519
6520         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6521         TypeManager.ResolveExpressionTypes().
6522
6523         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6524         instead of an Expression.
6525         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6526         (TypeExpression): New public class; formerly known as `TypeExpr'.
6527
6528         * expression.cs (ComposedCast): Derive from TypeExpr.
6529
6530         * typemanager.cs (TypeManager.system_*_expr): These are now
6531         TypExpr's instead of Expression's.
6532         (TypeManager.ResolveExpressionTypes): New public static function;
6533         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6534         of them.        
6535
6536 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6537
6538         * expression.cs (New.DoResolve): Do not dereference value that
6539         might be a null return.
6540
6541         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6542         sure that the constant value has the right type.  Fixes an
6543         unreported bug, similar to 50425.
6544
6545         * const.cs (Const.LookupConstantValue): Call
6546         ImplicitStandardConversionExists before doing a conversion to
6547         avoid havng the TypeManager.ChangeType do conversions.
6548
6549         Reduced the number of casts used
6550
6551         (Const.ChangeType): New routine to enable reuse of the constant
6552         type changing code from statement.
6553
6554         * typemanager.cs (ChangeType): Move common initialization to
6555         static global variables.
6556
6557         Fixes #50425.
6558
6559         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6560         every value type to go through, even if it was void.  Fix that. 
6561
6562         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6563         character of the define, and the is_identifier_part_character for
6564         the rest of the string.
6565
6566 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6567
6568         * expression.cs (UnaryMutator.EmitCode): When I updated
6569         LocalVariableReference.DoResolve, I overdid it, and dropped an
6570         optimization done on local variable references.
6571
6572 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6573
6574         * ecore.cs: Convert the return from Ldlen into an int.
6575
6576 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6579         the accessibility, this is a special case for toplevel non-public
6580         classes (internal for instance).
6581
6582 2003-10-20  Nick Drochak <ndrochak@gol.com>
6583
6584         * ecore.cs: Fix typo and build.  Needed another right paren.
6585
6586 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6587
6588         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6589         `internal' case regular and protected, but not allowing protected
6590         to be evaluated later.  Bug 49840
6591
6592 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6593
6594         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6595         to kb.Nlast, and not the kb.nFirst to isolate the switch
6596         statement.
6597
6598         Extract the underlying type, so enumerations of long/ulong are
6599         treated like long/ulong.
6600
6601 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6602
6603         * expression.cs (New): Overload the meaning of RequestedType to
6604         track the possible creation of the NewDelegate type, since
6605         DoResolve is invoked more than once for new constructors on field
6606         initialization.
6607
6608         See bugs: #48800 and #37014
6609
6610         * cs-parser.jay (declare_local_constants): Take an arraylist
6611         instead of a single constant.
6612
6613         (local_constant_declaration): It should take a
6614         constant_declarators, not a constant_declarator.  Fixes 49487
6615
6616         * convert.cs: Fix error report.
6617
6618 2003-10-13 Jackson Harper <jackson@ximian.com>
6619
6620         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6621         bug #49611
6622
6623 2003-10-09  Martin Baulig  <martin@ximian.com>
6624
6625         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6626         to the .ctor.
6627         (MethodCore.DoDefineParameters): Removed the TypeContainer
6628         argument; use the DeclSpace which was passed to the .ctor instead.
6629         (MethodCore.CheckParameter): Take a DeclSpace instead of a
6630         TypeContainer; we only need a DeclSpace here.
6631
6632 2003-10-09  Martin Baulig  <martin@ximian.com>
6633
6634         * class.cs (MethodData): Added additional `DeclSpace ds' argument
6635         to the .ctor.
6636         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6637         EmitContext's .ctor.    
6638
6639 2003-10-09  Martin Baulig  <martin@ximian.com>
6640
6641         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
6642         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
6643         AsAccessible(), moved them as well.
6644
6645         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
6646
6647 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
6648
6649         * cs-parser.jay : Renamed yyName to yyNames related to jay.
6650
6651 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
6652
6653         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
6654         generation for >=, as spotted by Paolo, bug 48679.  
6655         Patch from David Waite.
6656
6657         * cs-tokenizer.cs: Add handling for #pragma.
6658
6659         * cs-parser.jay: Allow for both yield and yield return in the
6660         syntax.  The anti-cobolization of C# fight will go on!
6661
6662         * class.cs (TypeBuilder.DefineType): Catch error condition here
6663         (Parent.DefineType erroring out and returning null).
6664
6665         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
6666         coping with enumerations variables, we were mistakenly processing
6667         them as a regular value type instead of built-in types.  Fixes the
6668         bug #48063
6669
6670         * typemanager.cs (IsBuiltinOrEnum): New method.
6671
6672 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
6673
6674         * cs-parser.jay: Upgrade: yield now needs the return clause.
6675
6676 2003-09-19  Martin Baulig  <martin@ximian.com>
6677
6678         * decl.cs (MemberCache.SetupCacheForInterface): Take a
6679         `MemberCache parent' argument.  Normally, an interface doesn't
6680         have a parent type except System.Object, but we use this in gmcs
6681         for generic type parameters.
6682
6683 2003-09-18  Martin Baulig  <martin@ximian.com>
6684
6685         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
6686         on `type.IsInterface'; don't check whether the type has a parent
6687         to determine whether it's an interface.
6688
6689 2003-09-15  Martin Baulig  <martin@ximian.com>
6690
6691         * class.cs (TypeContainer.DefineType): Added an error flag to
6692         avoid reporting duplicate CS0146's ("class definition is
6693         circular.").
6694
6695         * driver.cs (Driver.MainDriver): Abort if
6696         RootContext.ResolveTree() reported any errors.
6697
6698 2003-09-07  Martin Baulig  <martin@ximian.com>
6699
6700         * report.cs (Error, Warning): Added overloaded versions which take
6701         a `params object[] args' and call String.Format().
6702
6703 2003-09-07  Martin Baulig  <martin@ximian.com>
6704
6705         * decl.cs (DeclSpace..ctor): Don't call
6706         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
6707         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
6708         (DeclSpace.RecordDecl): New method.
6709
6710         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
6711
6712 2003-09-02  Ravi Pratap  <ravi@ximian.com>
6713
6714         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
6715         value attributes to be applied to ParameterBuilders.
6716
6717         * class.cs (MethodCore.LabelParameters): Make static and more
6718         generic so that it can be used from other places - like interface
6719         methods, for instance.
6720
6721         * interface.cs (Interface.Emit): Call LabelParameters before
6722         emitting attributes on the InterfaceMethod.
6723
6724 2003-08-26  Martin Baulig  <martin@ximian.com>
6725
6726         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
6727         resolving aliases; fixes #47927.
6728
6729 2003-08-26  Martin Baulig  <martin@ximian.com>
6730
6731         * statement.cs (Using.DoResolve): This is internally emitting a
6732         try/finally clause, so we need to set ec.NeedExplicitReturn if we
6733         do not always return.  Fixes #47681.
6734
6735 2003-08-26  Martin Baulig  <martin@ximian.com>
6736
6737         * decl.cs (MemberCore): Moved WarningNotHiding(),
6738         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
6739         into MemberBase.
6740         (AdditionResult): Make this nested in DeclSpace.
6741         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
6742         argument; call NamespaceEntry.Define() unless we're nested in a
6743         class or struct.
6744
6745         * namespace.cs (Namespace.DefineName): New public function.  This
6746         is called from DeclSpace's .ctor to add 
6747         (Namespace.Lookup): Include DeclSpaces in the lookup.
6748
6749         * class.cs (Operator): Derive from MemberBase, not MemberCore.
6750
6751         * const.cs (Const): Derive from MemberBase, not MemberCore.     
6752
6753 2003-08-25  Martin Baulig  <martin@ximian.com>
6754
6755         * convert.cs (Convert.ExplicitReferenceConversion): When
6756         converting from an interface type to a class, unbox if the target
6757         type is a struct type.  Fixes #47822.
6758
6759 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6760
6761         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
6762         #47854.
6763
6764 2003-08-22  Martin Baulig  <martin@ximian.com>
6765
6766         * class.cs (TypeManager.DefineType): When defining a nested type,
6767         call DefineType() on our parent; fixes #47801.
6768
6769 2003-08-22  Martin Baulig  <martin@ximian.com>
6770
6771         * class.cs (MethodData.Define): While checking if a method is an
6772         interface implementation, improve the test a bit more to fix #47654.
6773
6774 2003-08-22  Martin Baulig  <martin@ximian.com>
6775
6776         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
6777         correctly; fixes #47722.
6778
6779 2003-08-22  Martin Baulig  <martin@ximian.com>
6780
6781         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
6782         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
6783
6784         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
6785
6786 2003-08-22  Martin Baulig  <martin@ximian.com>
6787
6788         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
6789         can only be assigned in static constructors.  Fixes #47161.
6790
6791 2003-08-22  Martin Baulig  <martin@ximian.com>
6792
6793         Rewrote and improved the flow analysis code.
6794
6795         * flowbranching.cs (FlowBranching): Make this class abstract.
6796         (FlowBranching.CreateBranching): New static function to create a
6797         new flow branching.
6798         (FlowBranchingBlock, FlowBranchingException): New classes.
6799         (FlowBranching.UsageVector.Type): New public readonly field.
6800         (FlowBranching.UsageVector.Breaks): Removed the setter.
6801         (FlowBranching.UsageVector.Returns): Removed the setter.
6802         (FlowBranching.UsageVector): Added Break(), Return(),
6803         NeverReachable() and Throw() methods to modify the reachability.
6804         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
6805         done by FlowBranching.Merge().
6806         (FlowBranching.UsageVector.MergeChild): New method; merges the
6807         merge result into the current vector.
6808         (FlowBranching.Merge): New abstract method to merge a branching.
6809
6810 2003-08-12  Martin Baulig  <martin@ximian.com>
6811
6812         * expression.cs (Indirection.CacheTemporaries): Create the
6813         LocalTemporary with the pointer type, not its element type.
6814
6815 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
6816
6817         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
6818         token was a keyword or not.
6819
6820         Add `error' options where an IDENTIFIER was expected;  Provide
6821         CheckToken and CheckIdentifierToken convenience error reporting
6822         functions. 
6823
6824         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
6825
6826         * decl.cs: Rename `NamespaceEntry Namespace' public field into
6827         NameSpaceEntry NameSpaceEntry.
6828
6829         (LookupInterfaceOrClass): Avoid creating a full qualified name
6830         from namespace and name: avoid doing lookups when we know the
6831         namespace is non-existant.   Use new Tree.LookupByNamespace which
6832         looks up DeclSpaces based on their namespace, name pair.
6833
6834         * driver.cs: Provide a new `parser verbose' to display the
6835         exception thrown during parsing.  This is turned off by default
6836         now, so the output of a failure from mcs is more graceful.
6837
6838         * namespace.cs: Track all the namespaces defined in a hashtable
6839         for quick lookup.
6840
6841         (IsNamespace): New method
6842
6843 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
6844
6845         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
6846         we know that we need to concatenate (full typename can never be
6847         null). 
6848
6849         * class.cs: ditto.
6850
6851         * statement.cs: Use a bitfield;  Do not initialize to null things
6852         which are done by the constructor by default.
6853
6854         * cs-parser.jay: bug fix, parameter was 4, not 3.
6855
6856         * expression.cs: Just use the property;
6857
6858         * statement.cs: No need for GetVariableInfo method.
6859
6860 2003-08-08  Martin Baulig  <martin@ximian.com>
6861
6862         * flowanalysis.cs (FlowReturns): This is now nested in the
6863         `FlowBranching' class.
6864         (MyBitVector): Moved this here from statement.cs.
6865         (FlowBranching.SiblingType): New enum type.
6866         (FlowBranching.CreateSibling): Added `SiblingType' argument.
6867
6868 2003-08-07  Martin Baulig  <martin@ximian.com>
6869
6870         * flowanalysis.cs (FlowBranchingType): This is now nested in the
6871         `FlowBranching' class and called `BranchingType'.
6872
6873 2003-08-07  Martin Baulig  <martin@ximian.com>
6874
6875         * flowanalysis.cs: Moved all the control flow analysis code into
6876         its own file.
6877
6878 2003-08-07  Martin Baulig  <martin@ximian.com>
6879
6880         * assign.cs (Assign.DoResolve): `target' must either be an
6881         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
6882         #37319.
6883
6884 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
6885
6886         * expression.cs (BinaryMethod): This kind of expression is created by the
6887         Binary class if it determines that the operator has to be handled
6888         by a method.
6889
6890         (BinaryDelegate): This kind of expression is created if we are
6891         dealing with a + or - operator on delegates.
6892
6893         (Binary): remove method, argumetns, and DelegateOperator: when
6894         dealing with methods, 
6895
6896         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
6897
6898         * statement.cs (Block): use bitfields for the three extra booleans
6899         we had in use.   Remove unused topblock parameter.
6900
6901         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
6902
6903         * assign.cs: Drop extra unneeded tests.
6904
6905 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
6906
6907         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
6908
6909         * statement.cs (Foreach): Use VariableStorage instead of
6910         LocalBuilders.   
6911
6912         * codegen.cs (VariableStorage): New class used by clients that
6913         require a variable stored: locals or fields for variables that
6914         need to live across yield.
6915
6916         Maybe provide a convenience api for EmitThis+EmitLoad?
6917
6918         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
6919         these bad boys.
6920
6921 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
6922
6923         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
6924         RemapParameterLValue): New methods that are used to turn a
6925         precomputed FieldInfo into an expression like this:
6926
6927                 instance.FieldInfo
6928
6929         The idea is to use this instead of making LocalVariableReference
6930         have more than one meaning.
6931
6932         * cs-parser.jay: Add error production to BASE.
6933
6934         * ecore.cs: Deal with TypeManager.GetField returning null, which
6935         is now a valid return value.
6936
6937         (FieldExprNoAddress): New expression for Fields whose address can
6938         not be taken.
6939
6940         * expression.cs (LocalVariableReference): During the resolve
6941         phases, create new expressions if we are in a remapping context.
6942         Remove code that dealt with remapping here.
6943
6944         (ParameterReference): same.
6945
6946         (ProxyInstance): New expression, like the `This' expression, but
6947         it is born fully resolved.  We know what we are doing, so remove
6948         the errors that are targeted to user-provided uses of `this'.
6949
6950         * statement.cs (Foreach): our variable is now stored as an
6951         Expression;  During resolution, follow the protocol, dont just
6952         assume it will return this.
6953
6954 2003-08-06  Martin Baulig  <martin@ximian.com>
6955
6956         * support.cs (SeekableStreamReader.cs): New public class.
6957
6958         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
6959         SeekableStreamReader instead of the normal StreamReader.
6960
6961 2003-08-04  Martin Baulig  <martin@ximian.com>
6962
6963         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
6964         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
6965         deambiguate casts and delegate invocations.
6966         (parenthesized_expression): Use the new tokens to ensure this is
6967         not a cast of method invocation.
6968
6969         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
6970         when reading a `)' and Deambiguate_CloseParens () was previously
6971         called.
6972
6973         * expression.cs (ParenthesizedExpression): New class.  This is
6974         just used for the CS0075 test.
6975         (Binary.DoResolve): Check for CS0075.   
6976
6977 2003-07-29  Ravi Pratap  <ravi@ximian.com>
6978
6979         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
6980         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
6981         reference comparison.
6982
6983         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
6984         examine the ReturnType for equality - this is necessary in the
6985         cases of implicit and explicit operators whose signature also
6986         includes the return type.
6987
6988 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
6989
6990         * namespace.cs: Cache the result of the namespace computation,
6991         instead of computing it every time.
6992
6993 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
6994
6995         * decl.cs: Use a global arraylist that we reuse over invocations
6996         to avoid excesive memory consumption.  Reduces memory usage on an
6997         mcs compile by one meg (45 average).
6998
6999         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7000         private, work around that.
7001
7002 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7003
7004         * literal.cs (IntLiteral): Define Zero and One static literals. 
7005
7006         * cs-parser.jay (integer_literal): use static literals to reduce
7007         memory usage for the most used literals (0, 1 and -1).  211kb
7008         reduced in memory usage.
7009
7010         Replace all calls to `new ArrayList' with `new
7011         ArrayList(4)' which is a good average number for most allocations,
7012         and also requires only 16 bytes of memory for its buffer by
7013         default. 
7014
7015         This reduced MCS memory usage in seven megabytes for the RSS after
7016         bootstrapping.
7017
7018 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7019
7020         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7021         handle params methods the correct way by forming only one
7022         applicable set with params and normal methods in them. Earlier we
7023         were looking at params methods only if we found no normal methods
7024         which was not the correct thing to do.
7025
7026         (Invocation.BetterFunction): Take separate arguments indicating
7027         when candidate and the best method are params methods in their
7028         expanded form.
7029
7030         This fixes bugs #43367 and #46199.
7031
7032         * attribute.cs: Documentation updates.
7033
7034         (CheckAttribute): Rename to CheckAttributeTarget.
7035         (GetValidPlaces): Rename to GetValidTargets.
7036
7037         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7038         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7039
7040         Fixes bug #44468.
7041
7042 2003-07-28  Martin Baulig  <martin@ximian.com>
7043
7044         * class.cs (TypeContainer.DefineMembers): Use the base type's full
7045         name when looking up the base class of a nested class.  Fixes #46977.
7046
7047 2003-07-26  Martin Baulig  <martin@ximian.com>
7048
7049         * expression.cs (Indexers.Indexer): New nested struct; contains
7050         getter, setter and the indexer's type.
7051         (Indexers.Properties): This is now an ArrayList of
7052         Indexers.Indexer's.
7053         (IndexerAccess.DoResolveLValue): Correctly set the type if the
7054         indexer doesn't have any getters.
7055
7056         * assign.cs (Assign.DoResolve): Also do the implicit conversions
7057         for embedded property and indexer assignments.
7058
7059 2003-07-26  Martin Baulig  <martin@ximian.com>
7060
7061         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
7062         preprocessor directive is not the first non-whitespace character
7063         on a line.
7064
7065 2003-07-26  Martin Baulig  <martin@ximian.com>
7066
7067         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
7068         namespace parsing, follow the spec more closely.
7069
7070         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
7071         NamespaceEntry.Lookup().
7072
7073 2003-07-25  Martin Baulig  <martin@ximian.com>
7074
7075         * MethodCore.cs (OverridesSomething): New public field; it's set
7076         from TypeContainer.DefineMembers if this method overrides
7077         something (which doesn't need to be a method).  Fix #39462.
7078
7079 2003-07-25  Ravi Pratap  <ravi@ximian.com>
7080
7081         * typemanager.cs (GetMembers): Ensure that the list of members is
7082         reversed. This keeps things in sync.
7083
7084         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
7085         find an AttributeUsage attribute.
7086
7087         * expression.cs (Invocation.OverloadResolve): Perform the check
7088         which disallows Invoke to be directly called on a Delegate.
7089
7090         (Error_InvokeOnDelegate): Report error cs1533.
7091
7092 2003-07-25  Martin Baulig  <martin@ximian.com>
7093
7094         * expression.cs (Indexers.GetIndexersForType): Only look in the
7095         interface hierarchy if the requested type is already an
7096         interface.  Fixes #46788 while keeping #46502 fixed.
7097
7098 2003-07-25  Martin Baulig  <martin@ximian.com>
7099
7100         * class.cs (TypeContainer.DefineMembers): Check whether all
7101         readonly fields have been assigned and report warning CS0649 if
7102         not.
7103
7104         * statement.cs (LocalInfo.IsFixed): Always return true if this is
7105         a valuetype.
7106
7107 2003-07-24  Ravi Pratap  <ravi@ximian.com>
7108
7109         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
7110         returned from GetMethods to make things consistent with the
7111         assumptions MCS makes about ordering of methods.
7112
7113         This should comprehensively fix bug #45127 and it does :-)
7114
7115         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
7116         ordering is actually reverse.
7117
7118         * Clean up some debug messages I left lying around.
7119
7120         * interface.cs (Populate*): Get rid of code which emits attributes
7121         since the stage in which we emit attributes is the 'Emit' stage,
7122         not the define stage.
7123
7124         (Emit): Move attribute emission for interface members here.
7125
7126 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7127
7128         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7129         closely: we eliminate methods in base types when we have an
7130         applicable method in a top-level type.
7131
7132         Please see section 14.5.5.1 for an exact description of what goes
7133         on. 
7134
7135         This fixes bug #45127 and a host of other related to corlib compilation.
7136
7137         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7138         array is the method corresponding to the top-level type (this is
7139         because of the changes made to icall.c) so we change this
7140         accordingly.
7141
7142         (MethodGroupExpr.Name): This too.
7143
7144         * typemanager.cs (GetElementType): New method which does the right
7145         thing when compiling corlib. 
7146
7147         * everywhere: Make use of the above in the relevant places.
7148
7149 2003-07-22  Martin Baulig  <martin@ximian.com>
7150
7151         * cs-parser.jay (invocation_expression): Moved
7152         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7153         `cast_expression', but create a InvocationOrCast which later
7154         resolves to either an Invocation or a Cast.
7155
7156         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7157         method; call this before EmitStatement() to make sure that this
7158         expression can be used as a statement.
7159
7160         * expression.cs (InvocationOrCast): New class; resolves to either
7161         an Invocation or a Cast.
7162
7163         * statement.cs (StatementExpression): Call ResolveStatement() on
7164         the ExpressionStatement before emitting it.
7165
7166 2003-07-21  Martin Baulig  <martin@ximian.com>
7167
7168         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7169         `ref' and `out' attributes match; fixes #46220.
7170         (MemberAccess.ResolveMemberAccess): You can't reference a type
7171         through an expression; fixes #33180.
7172         (Indexers.GetIndexersForType): Don't return the indexers from
7173         interfaces the class implements; fixes #46502.
7174
7175 2003-07-21  Martin Baulig  <martin@ximian.com>
7176
7177         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7178         CS0661 checks; fixes bug #30442.
7179
7180 2003-07-21  Martin Baulig  <martin@ximian.com>
7181
7182         * decl.cs (AdditionResult): Added `Error'.
7183
7184         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7185
7186         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
7187         makes cs0031.cs actually work.
7188
7189 2003-07-20  Martin Baulig  <martin@ximian.com>
7190
7191         * namespace.cs: Fixed that bug which caused a crash when compiling
7192         the debugger's GUI.
7193
7194 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7195
7196         * typemanager.cs (LookupTypeReflection): Never expose types which
7197         are NotPublic, NestedPrivate, NestedAssembly, or
7198         NestedFamANDAssem.  We used to return these, and later do a check
7199         that would report a meaningful error, but the problem is that we
7200         would not get the real match, if there was a name override.
7201
7202 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7203
7204         * namespace.cs (Namespace, Name): Do not compute the namespace
7205         name dynamically, compute it in the constructor.  This reduced
7206         memory usage by 1697 KB.
7207
7208         * driver.cs: Use --pause to pause at the end.
7209
7210 2003-07-17  Peter Williams  <peter@newton.cx>
7211
7212         * Makefile: Change the name of the test target so that it doesn't
7213         conflict with the recursive test target.
7214
7215 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7218         AddressOf): Do not use EmitThis, that was wrong, use the actual
7219         this pointer.
7220
7221 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7222
7223         * class.cs (MethodData.Define): While checking if a method is an
7224         interface implementation, improve the test: If we are not public
7225         (use new test here: use the computed MethodAttributes directly,
7226         instead of the parsed modifier flags) check if the `implementing'
7227         method comes from an interface or not.
7228
7229         * pending.cs (VerifyPendingMethods): Slightly better error
7230         message.
7231
7232         * makefile: add test target that does the mcs bootstrap.
7233
7234 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7235
7236         * interface.cs (Define): Do nothing here since there are no
7237         members to populate etc. Move the attribute emission out of here
7238         since this was just totally the wrong place to put it. Attribute
7239         application happens during the 'Emit' phase, not in the 'Define'
7240         phase.
7241
7242         (Emit): Add this method and move the attribute emission here
7243
7244         * rootcontext.cs (EmitCode): Call the Emit method on interface
7245         types too.
7246
7247 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7248
7249         * expression.cs (OverloadResolve): Report error only if Location
7250         is not 'Null' which means that there was a probe going on.
7251
7252 2003-07-14  Martin Baulig  <martin@ximian.com>
7253
7254         * expression.cs (ConditionalLogicalOperator): New public class to
7255         implement user defined conditional logical operators.
7256         This is section 14.11.2 in the spec and bug #40505.
7257
7258 2003-07-14  Martin Baulig  <martin@ximian.com>
7259
7260         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7261
7262 2003-07-14  Martin Baulig  <martin@ximian.com>
7263
7264         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7265
7266         * ecore.cs (IVariable.VerifyFixed): New interface method.
7267
7268         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7269         operator, check whether the variable is actually fixed.  Fixes bug
7270         #36055.  Set a variable definitely assigned when taking its
7271         address as required by the spec.
7272
7273         * statement.cs (LocalInfo.IsFixed): New field.
7274         (LocalInfo.MakePinned): Set `IsFixed' to true.
7275
7276 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7277
7278         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7279         for .ctors, ensure that we only ask for members declared in the
7280         attribute type (BindingFlags.DeclaredOnly).
7281
7282         Fixes bug #43632.
7283
7284         * expression.cs (Error_WrongNumArguments): Report error 1501
7285         correctly the way CSC does.
7286
7287 2003-07-13  Martin Baulig  <martin@ximian.com>
7288
7289         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7290         lookup on the fully qualified name, to make things like "X.X" work
7291         where "X.X" is a fully qualified type name, but we also have a
7292         namespace "X" in the using list.  Fixes #41975.
7293
7294 2003-07-13  Martin Baulig  <martin@ximian.com>
7295
7296         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7297         function. If we're a CompoundAssign, we need to create an embedded
7298         CompoundAssign, not an embedded Assign.
7299         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7300         Fixes #45854.
7301
7302 2003-07-13  Martin Baulig  <martin@ximian.com>
7303
7304         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7305         work to fix bug #46088.
7306
7307 2003-07-13  Ravi Pratap <ravi@ximian.com>
7308
7309         * class.cs (Operator.Emit): Do not emit attributes here - it is
7310         taken care of by the Method class that we delegate too. This takes
7311         care of bug #45876.
7312
7313 2003-07-10  Martin Baulig  <martin@ximian.com>
7314
7315         * expression.cs (TypeOfVoid): New class.
7316         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7317
7318 2003-07-10  Martin Baulig  <martin@ximian.com>
7319
7320         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7321         bug #35957.
7322
7323 2003-07-10  Martin Baulig  <martin@ximian.com>
7324
7325         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7326         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7327
7328         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7329
7330         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7331
7332 2003-07-10  Martin Baulig  <martin@ximian.com>
7333
7334         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7335         of decimal.  Fixes #42850.
7336
7337         NOTE: I also fixed the created byte blob, but this doesn't work on
7338         the MS runtime and csc never produces any byte blobs for decimal
7339         arrays.
7340
7341 2003-07-10  Martin Baulig  <martin@ximian.com>
7342
7343         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7344         structs; fixes #32068.
7345         (Block.AddChildVariableNames): Fixed #44302.
7346
7347 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7348
7349         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7350
7351 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7352
7353         * attribute.cs: And this test is onger needed.
7354
7355 2003-07-08  Martin Baulig  <martin@ximian.com>
7356
7357         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7358         inaccessible types.  Fixes #36313.
7359
7360         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7361
7362         * namespace.cs (NamespaceEntry): Create implicit entries for all
7363         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7364         implicit entries for N1.N2 and N1.
7365
7366 2003-07-08  Martin Baulig  <martin@ximian.com>
7367
7368         Rewrote the handling of namespaces to fix a lot of the issues
7369         wrt. `using' aliases etc.
7370
7371         * namespace.cs (Namespace): Splitted this class into a
7372         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7373
7374         * typemanager.cs (TypeManager.IsNamespace): Removed.
7375         (TypeManager.ComputeNamespaces): Only compute namespaces from
7376         loaded assemblies here, not the namespaces from the assembly we're
7377         currently compiling.
7378
7379 2003-07-08  Martin Baulig  <martin@ximian.com>
7380
7381         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7382
7383 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7384
7385         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7386         already fixed it.  
7387
7388         I thought about the memory savings here, but LookupTypeReflection
7389         is used under already very constrained scenarios.  Compiling
7390         corlib or mcs only exposes one hit, so it would not really reduce
7391         any memory consumption.
7392
7393 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7394
7395         * typemanager.cs: fixes bug #45889 by only adding public types from
7396         other assemblies to the list of known types.
7397
7398 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7399
7400         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7401         on the type we resolved.
7402
7403 2003-07-05  Martin Baulig  <martin@ximian.com>
7404
7405         * pending.cs (PendingImplementation.ParentImplements): Don't
7406         create the proxy if the parent is abstract.
7407
7408         * class.cs (TypeContainer.DefineIndexers): Process explicit
7409         interface implementations first.  Fixes #37714.
7410
7411 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7414         defined recursively;  but since we modify the input parameters
7415         (left is set to `this' temporarily), we reset this value if the
7416         left_is_explicit is false, which gives the original semantics to
7417         the code.  
7418
7419         * literal.cs (NullPointer): new class used to represent a null
7420         literal in a pointer context.
7421
7422         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7423         type is a pointer, use a NullPointer object instead of a
7424         NullLiteral.   Closes 43687
7425
7426         (ExplicitConversion): Convert pointer values using
7427         the conv opcode to the proper type.
7428
7429         * ecore.cs (New): change ValueTypeVariable property into a method,
7430         that returns whether the valuetype is suitable for being used.
7431
7432         * expression.cs (Binary.DoNumericPromotions): Only return if we
7433         the int constant was a valid uint, and we can return both left and
7434         right as uints.  If not, we continue processing, to trigger the
7435         type conversion.  This fixes 39018.
7436
7437         * statement.cs (Block.EmitMeta): During constant resolution, set
7438         the CurrentBlock property on the emitcontext, so that we resolve
7439         constants propertly.
7440
7441 2003-07-02  Martin Baulig  <martin@ximian.com>
7442
7443         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7444         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7445
7446         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7447         than emitting it here.
7448
7449         * statement.cs: Fixed some more flow analysis bugs.
7450
7451 2003-07-02  Martin Baulig  <martin@ximian.com>
7452
7453         * class.cs (MethodData.Define): When implementing interface
7454         methods, set Final unless we're Virtual.
7455
7456         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7457         check work for interface methods.
7458
7459 2003-07-01  Martin Baulig  <martin@ximian.com>
7460
7461         * ecore.cs (EmitContext.This): Replaced this property with a
7462         GetThis() method which takes a Location argument.  This ensures
7463         that we get the correct error location for a CS0188.
7464
7465 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7466
7467         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7468         ImplicitStandardConversion.
7469
7470         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7471
7472 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7473
7474         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7475         optimization.
7476
7477 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7478
7479         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7480         constructors.
7481
7482         (MethodData.Define): Turn off initlocals for unsafe methods.
7483
7484 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7485
7486         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7487         complete;  Fixes #37521.
7488
7489         * delegate.cs: Use Modifiers.TypeAttr to compute the
7490         TypeAttributes, instead of rolling our own.  This makes the flags
7491         correct for the delegates.
7492
7493 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7494
7495         * class.cs (Constructor.Define): Set the private flag for static
7496         constructors as well.
7497
7498         * cs-parser.jay (statement_expression): Set the return value to
7499         null, to avoid a crash when we catch an error.
7500
7501 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7502
7503         * cs-parser.jay: Applied patch from Jackson that adds support for
7504         extern and unsafe modifiers to destructor declarations.
7505
7506         * expression.cs: Report error 21 if the user is trying to index a
7507         System.Array.
7508
7509         * driver.cs: Add an error message, suggested by the bug report.
7510
7511         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7512         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7513
7514 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7515
7516         * namespace.cs: Add some information to reduce FAQs.
7517
7518 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7519
7520         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7521         underlying enumeration types.  Fixes #43915.
7522
7523         * expression.cs: Treat ushort/short as legal values to be used in
7524         bitwise operations.
7525
7526 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7527
7528         * delegate.cs: transfer custom attributes for paramenters from
7529         the delegate declaration to Invoke and BeginInvoke.
7530
7531 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7532
7533         * attribute.cs: handle custom marshalers and emit marshal info
7534         for fields, too.
7535
7536 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7537
7538         * makefile.gnu: Added anonymous.cs to the compiler sources.
7539
7540 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7541
7542         * iterators.cs: Change the name of the proxy class to include two
7543         underscores.
7544
7545         * cs-parser.jay: Update grammar to include anonymous methods.
7546
7547         * anonymous.cs: new file.
7548
7549 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7550
7551         * class.cs (Field.Define): Add missing test for pointers and
7552         safety. 
7553
7554 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7555
7556         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7557         we use the stobj opcode.
7558
7559         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7560         since it wasn't the correct fix. 
7561
7562         It still is puzzling that we are required to use stobj for IntPtr
7563         which seems to be a ValueType.
7564
7565 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7566
7567         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7568         during regular simple name resolution.   Now, the trick is that
7569         instead of returning for processing the simplename, we do a
7570         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7571         contextual lookup type).   If a match is found, return that, if
7572         not, return for further composition.
7573
7574         This fixes long-standing 30485.
7575
7576         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7577         using the address to initialize an object, do an Stobj instead of
7578         using the regular Stelem.
7579
7580         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7581         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7582         Because if we are a BaseIndexerAccess that value will be true.
7583         Fixes 43643.
7584
7585         * statement.cs (GotoCase.Resolve): Return after reporting an
7586         error, do not attempt to continue. 
7587
7588         * expression.cs (PointerArithmetic.Emit): If our operand is a
7589         long, convert our constants to match the operand before
7590         multiplying.  Convert to I type before adding.   Fixes 43670.
7591
7592 2003-05-14  Ravi Pratap  <ravi@ximian.com>
7593
7594         * enum.cs (ImplicitConversionExists) : Rename to
7595         ImplicitEnumConversionExists to remove ambiguity. 
7596
7597         * ecore.cs (NullCast): New type of cast expression class which
7598         basically is very similar to EmptyCast with the difference being
7599         it still is a constant since it is used only to cast a null to
7600         something else
7601         (eg. (string) null)
7602
7603         * convert.cs (ImplicitReferenceConversion): When casting a null
7604         literal, we return a NullCast.
7605
7606         * literal.cs (NullLiteralTyped): Remove - I don't see why this
7607         should be around anymore.
7608
7609         The renaming (reported was slightly wrong). Corrections:
7610
7611         ConvertImplicitStandard -> ImplicitConversionStandard
7612         ConvertExplicitStandard -> ExplicitConversionStandard
7613
7614         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
7615         before passing them in !
7616
7617         * convert.cs (ImplicitConversionStandard): When comparing for
7618         equal expr and target types, ensure that expr is not a
7619         NullLiteral.
7620
7621         In general, we must not be checking (expr_type ==
7622         target_type) in the top level conversion methods
7623         (ImplicitConversion, ExplicitConversion etc). This checking is
7624         done in the methods that they delegate to.
7625
7626 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
7627
7628         * convert.cs: Move Error_CannotConvertType,
7629         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
7630         ImplicitNumericConversion, ImplicitConversionExists,
7631         ImplicitUserConversionExists, StandardConversionExists,
7632         FindMostEncompassedType, FindMostSpecificSource,
7633         FindMostSpecificTarget, ImplicitUserConversion,
7634         ExplicitUserConversion, GetConversionOperators,
7635         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
7636         TryImplicitIntConversion, Error_CannotConvertImplicit,
7637         ConvertImplicitRequired, ConvertNumericExplicit,
7638         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
7639         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
7640         its own file.
7641
7642         Perform the following renames:
7643
7644         StandardConversionExists -> ImplicitStandardConversionExists
7645         ConvertImplicit -> ImplicitConversion
7646         ConvertImplicitStandard -> ImplicitStandardConversion
7647         TryImplicitIntConversion -> ImplicitIntConversion
7648         ConvertImplicitRequired -> ImplicitConversionRequired
7649         ConvertNumericExplicit -> ExplicitNumericConversion
7650         ConvertReferenceExplicit -> ExplicitReferenceConversion
7651         ConvertExplicit -> ExplicitConversion
7652         ConvertExplicitStandard -> ExplicitStandardConversion
7653
7654 2003-05-19  Martin Baulig  <martin@ximian.com>
7655
7656         * statement.cs (TypeInfo.StructInfo): Made this type protected.
7657         (TypeInfo): Added support for structs having structs as fields.
7658
7659         * ecore.cs (FieldExpr): Implement IVariable.
7660         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
7661         VariableInfo for the field.
7662
7663 2003-05-18  Martin Baulig  <martin@ximian.com>
7664
7665         * expression.cs (This.DoResolve): Report a CS0027 if we're
7666         emitting a field initializer.
7667
7668 2003-05-18  Martin Baulig  <martin@ximian.com>
7669
7670         * expression.cs (This.ResolveBase): New public function.
7671         (This.DoResolve): Check for CS0188.
7672
7673         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
7674         This.Resolve().
7675
7676         * ecore.cs (MethodGroupExpr.DoResolve): Set the
7677         `instance_expression' to null if we don't have any non-static
7678         methods.
7679
7680 2003-05-18  Martin Baulig  <martin@ximian.com>
7681
7682         Reworked the way how local variables and parameters are handled by
7683         the flow analysis code.
7684
7685         * statement.cs (TypeInfo, VariableMap): New public classes.
7686         (VariableInfo): New public class.  This is now responsible for
7687         checking whether a variable has been assigned.  It is used for
7688         parameters and local variables.
7689         (Block.EmitMeta): Take the InternalParameters as argument; compute
7690         the layout of the flow vectors here.
7691         (Block.LocalMap, Block.ParameterMap): New public properties.
7692         (FlowBranching): The .ctor doesn't get the InternalParameters
7693         anymore since Block.EmitMeta() now computes the layout of the flow
7694         vector.
7695         (MyStructInfo): This class is now known as `StructInfo' and nested
7696         in `TypeInfo'; we don't access this directly anymore.
7697
7698         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
7699         property and removed IsAssigned(), IsFieldAssigned(),
7700         SetAssigned() and SetFieldAssigned(); we now call them on the
7701         VariableInfo so we don't need to duplicate this code everywhere.
7702
7703         * expression.cs (ParameterReference): Added `Block block' argument
7704         to the .ctor.
7705         (LocalVariableReference, ParameterReference, This): The new
7706         VariableInfo class is now responsible for all the definite
7707         assignment stuff.
7708
7709         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
7710         IsParameterAssigned, SetParameterAssigned): Removed.
7711
7712 2003-05-18  Martin Baulig  <martin@ximian.com>
7713
7714         * typemanager.cs (InitCoreTypes): Try calling
7715         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
7716         the 3-args-version.  Corlib now also needs our `void_type'.
7717         (GetMethod): Added overloaded version which takes an optional
7718         `bool report_errors' to allow lookups of optional methods.
7719
7720 2003-05-12  Martin Baulig  <martin@ximian.com>
7721
7722         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
7723         only used for locals and not for parameters.
7724
7725 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
7726
7727         * support.cs (InternalParameters.ParameterType): Return the
7728         ExternalType of the parameter.
7729
7730         * parameter.cs (Parameter.ExternalType): drop the two arguments,
7731         they were unused.
7732
7733 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
7734
7735         * class.cs (MethodData.Define): Do not set the `newslot' on
7736         interface members, if they are also flagged as "override".
7737
7738         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
7739         better code for ++i and i++.  This only works for static fields
7740         and local variables.
7741
7742         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
7743         want to pull the DeclSpace out of the builder_to_declspace instead
7744         of the TypeBuilder (like in TypeContainer.FindMembers).
7745
7746         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
7747         instead of LookupTypeContainer.  Fixes the crash on .NET for
7748         looking up interface members.
7749
7750         * const.cs: Create our own emit context during the Definition
7751         stage, so that constants are evaluated in the proper context, when
7752         a recursive definition happens.
7753
7754 2003-05-11  Martin Baulig  <martin@ximian.com>
7755
7756         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
7757         new block for a switch section.
7758         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
7759         the adding/lookup in the switch block.  Fixes #39828.
7760
7761 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
7762
7763         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
7764         functionality: I needed to convert the data after I had performed
7765         the add/sub operation into the operands type size.
7766
7767         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
7768         pass the type for the box operation, otherwise the resulting
7769         object would have been of type object.
7770
7771         (BoxedCast): Add constructor to specify the type to box as.
7772
7773 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
7774
7775         * iterators.cs: I was reusing the `count' variable inadvertently,
7776         take steps to not allow this to happen.
7777
7778 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
7779
7780         * attribute.cs (Attribute.Resolve): Params attributes are encoded
7781         by creating an array at the point where the params starts and
7782         putting all those arguments there, then adjusting the size of the
7783         array.
7784
7785 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
7786
7787         * expression.cs (New.AddressOf): Implement interface
7788         IMemoryLocation.  This is used when the `new' operator is used in
7789         the context of an invocation to a method on a value type.
7790
7791         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
7792         example. 
7793
7794         * namespace.cs: Also check the using aliases here.
7795
7796         * driver.cs: Move the test for using validity after the types have
7797         been entered, so we do a single pass that also includes the using
7798         aliases. 
7799
7800         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
7801         in the regular case.   CreateSiblingForFinally is doing extra
7802         error checking.
7803
7804         * attribute.cs (GetAttributeArgumentExpression): Store the result
7805         on an out value, and use the return value to indicate failure
7806         instead of using null (which is a valid return for Constant.GetValue).
7807
7808         * statement.cs: Perform the analysis flow for the increment
7809         portion after the statement, because this will be the real flow of
7810         execution.  Fixes #42385
7811
7812         * codegen.cs (EmitContext.EmitArgument,
7813         EmitContext.EmitStoreArgument): New helper functions when the
7814         RemapToProxy flag is set.
7815
7816         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
7817         function.
7818
7819         Add support for remapping parameters. 
7820
7821         * iterators.cs: Propagate parameter values;  Store parameter
7822         values in the proxy classes.
7823
7824 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
7825
7826         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
7827         need a proxy reference;  I do not know what I was thinking
7828
7829         * cs-parser.jay (constructor_initializer): catch another error,
7830         and display nice message.
7831
7832         (field_declaration): catch void field declaration
7833         to flag a better error. 
7834
7835         * class.cs (MemberBase.CheckBase): Report an error instead of a
7836         warning if a new protected member is declared in a struct. 
7837         (Field.Define): catch the error of readonly/volatile.
7838
7839         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
7840
7841         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
7842         volatile variable is taken
7843
7844 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
7845
7846         * statement.cs (Fixed.Resolve): Report an error if we are not in
7847         an unsafe context.
7848
7849 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
7850
7851         * typemanager.cs: reuse the code that handles type clashes for
7852         delegates and enumerations.
7853
7854         * class.cs (Report28): Always report.
7855
7856         * expression.cs (EncodeAsAttribute): Allow nulls here.
7857
7858 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
7859
7860         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
7861         the functionality for testing whether an expression is valid for
7862         an attribute here.  Also handle the case of arrays of elements
7863         being stored. 
7864
7865         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
7866         encoding a linear array into an array of objects that are suitable
7867         to be passed to an CustomAttributeBuilder.
7868
7869         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
7870
7871         * ecore.cs: (FieldExpr): Handle field remapping here.
7872
7873         * iteratators.cs: Pass the instance variable (if the method is an
7874         instance method) to the constructors, so we can access the field
7875         variables on the class.
7876
7877         TODO: Test this with structs.  I think the THIS variable on
7878         structs might have to be a pointer, and not a refenrece
7879
7880 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
7881
7882         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
7883         local variables to fields in a proxy class.
7884
7885         * iterators.cs (PopulateProxy): Rename our internal fields to
7886         <XXX>.  
7887         Create a <THIS> field if we are an instance method, so we can
7888         reference our parent container variables.
7889         (MapVariable): Called back from the EmitContext code to enter a
7890         new variable to field mapping into the proxy class (we just create
7891         a FieldBuilder).
7892
7893         * expression.cs
7894         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
7895         for using the remapped locals to fields.
7896
7897         I placed the code here, because that gives the same semantics to
7898         local variables, and only changes the Emit code.
7899
7900         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
7901         statements inside iterators.
7902         (VariableInfo): Add a FieldBuilder for the cases when we are
7903         remapping local variables to fields in a proxy class
7904
7905         * ecore.cs (SimpleNameResolve): Avoid testing two times for
7906         current_block != null.
7907
7908         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
7909         not cope with strings, as it has been moved to the
7910         TableSwitchEmit.  Fixed bug in switch generation.
7911
7912         * expression.cs (New.DoResolve): Provide more context for the user
7913         when reporting an error.
7914
7915         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
7916         pointers. 
7917
7918         * expression.cs (MemberAccess.DoResolve): When we get a type back,
7919         check the permissions for it.  Note than in a type-resolution
7920         context the check was already present in DeclSpace.ResolveType,
7921         but was missing from the MemberAccess.
7922
7923         (ArrayCreation.CheckIndices): warn if the user has
7924         more nested levels of expressions, but there are no more
7925         dimensions specified.  Avoids crash on bug 41906.
7926
7927 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
7928
7929         * statement.cs (Block): replace Implicit bool, for a generic
7930         flags.   
7931         New flag: `Unchecked'.  This is used during the EmitMeta phase
7932         (which is out-of-line with the regular Resolve/Emit process for a
7933         statement, as this is done ahead of time, but still gets a chance
7934         to call constant resolve).
7935
7936         (Block.Flags): new enum for adding a new flag.
7937
7938         (Block.EmitMeta): track the state of unchecked.
7939
7940         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
7941         to enable constant resolution to work there as well.
7942
7943 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
7944
7945         * typemanager.cs (ienumerable_type): Also look up
7946         System.Collections.IEnumerable. 
7947
7948 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
7949
7950         TODO: Test more than one conditional per method.
7951
7952         * class.cs (Indexer.Define): Report the location where the user is
7953         referencing the unsupported feature.
7954
7955         (MethodData): Overload the use of `conditionals' to
7956         minimize the creation of needless ArrayLists.   This saves roughly
7957         212kb on my machine.
7958
7959         (Method): Implement the new IIteratorContainer interface.
7960         (Method.SetYields): Implement the method by setting the ModFlags
7961         to contain METHOD_YIELDS.
7962
7963         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
7964         which just got set to null.
7965
7966         * iterators.cs: New file.
7967
7968         (Yield, YieldBreak): New statements.
7969
7970         * statement.cs (Return.Resolve): Flag an error if we are used in
7971         an iterator method.
7972
7973         * codegen.cs (InIterator): New flag set if the code is being
7974         compiled in an iterator method.
7975
7976         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
7977         internal modifier, and we just use it to avoid adding extra
7978         fields, as this is seldom used.  
7979
7980         * cs-parser.jay: Add yield_statement (yield and yield break).
7981
7982         * driver.cs: New flag -v2 to turn on version 2 features. 
7983
7984         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
7985         hashtable when v2 is enabled.
7986
7987 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
7988
7989         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
7990         there is already a namespace defined with this name.
7991
7992         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
7993         people upgraded their corlibs.
7994
7995         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
7996         always use fully qualified types, no need to use the compiler
7997         front end.
7998
7999         (TypeManager.IsNamespace): Use binarysearch.
8000
8001         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8002         AddDelegate): I did not quite use the new IsValid API properly: I
8003         have to pass the short-name and the fullname.  I was passing only
8004         the basename instead of the fullname sometimes. 
8005
8006         (TypeContainer.DefineType): call NamespaceClash.
8007
8008         * interface.cs (Interface.DefineType): use NamespaceClash before
8009         defining the type.
8010
8011         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8012         defining the type.
8013
8014         * enum.cs: (Enum.DefineType): use NamespaceClash before
8015         defining the type.
8016
8017         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8018         speed increase.  First, use the negative_hits cache when we get a
8019         negative.  Second, add the type with its full original name
8020         instead of the new . and + encoded name (reflection uses + to
8021         separate type from a nested type).  Use LookupTypeReflection
8022         directly which bypasses the type->name hashtable (that we already
8023         know does not contain the type.
8024
8025         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8026         location/container type. 
8027
8028         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8029
8030 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8031
8032         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8033
8034         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8035         method is being referenced in the method group from a static
8036         context, and report error 120 if so.
8037
8038         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8039         Error118. 
8040
8041         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8042         is created, we create the A namespace).
8043
8044         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8045         Fixes #41591
8046
8047 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8048
8049         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8050         invocation to ModuleBuilder.GetType with the same values will
8051         return a new type instance, so we need to cache its return
8052         values. 
8053
8054         * expression.cs (Binary.ResolveOperator): Only allow the compare
8055         operators on enums if they are of the same type.
8056
8057         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8058         types of ValueType on their own case.  Before we were giving them
8059         the same treatment as objects.
8060
8061         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8062         fullname.  Short name is used to compare against container name.
8063         Fullname is used to check against defined namespace names.
8064
8065         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8066         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8067
8068         (Method.CheckBase): Call parent.
8069         (MemberBase.CheckBase): Check for protected members on sealed
8070         classes.
8071         (PropertyBase.CheckBase): Call parent.
8072         (Field.Define): Call parent.
8073
8074         * report.cs: Negative error codes are now mapped to 8000 - code,
8075         so that the display is render more nicely.
8076
8077         * typemanager.cs: Do not use try/catch, instead report a regular
8078         error. 
8079
8080         (GetPointerType, GetReferenceType): These methods provide
8081         mechanisms to obtain the T* and T& from a T.  We had the code
8082         previously scattered around the code base, and it also used
8083         TypeManager.LookupType that would go through plenty of caches.
8084         This one goes directly to the type source.
8085
8086         In some places we did the Type.GetType followed by
8087         ModuleBuilder.GetType, but not in others, so this unifies the
8088         processing as well.
8089
8090         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8091         statements now that we have namespace information.
8092
8093         * typemanager.cs (IsNamespace): New method, returns whether the
8094         string presented is a namespace or not.
8095
8096         (ComputeNamespaces): New public entry point, computes the list of
8097         available namespaces, using the GetNamespaces API call in Mono, or
8098         the slower version in MS.NET.   
8099
8100         Now before we start the semantic analysis phase, we have a
8101         complete list of namespaces including everything that the user has
8102         provided.
8103
8104         Deleted old code to cache namespaces in .nsc files.
8105
8106 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8107
8108         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8109         class/struct location definition Location for the implicit
8110         constructor location.
8111
8112         (Operator.Define): Use the location of the operator for the
8113         implicit Method definition.
8114
8115         (Constructor.Emit): use the constructor location for the implicit
8116         base initializer constructor.
8117
8118         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8119         and the Expression class now contains two new methods:
8120
8121         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8122         isolate type lookup from the rest of the resolution process.
8123
8124         Since we use Expressions to hold type definitions due to the way
8125         we parse the input we have historically overloaded Resolve to
8126         perform the Type lookups if a special flag is passed.  Now this is
8127         eliminated and two methods take their place. 
8128
8129         The differences in the two methods between xStep and xTerminal is
8130         that xStep is involved in our current lookup system that uses
8131         SimpleNames to compose a name, while xTerminal is used just to
8132         catch the case where the simplename lookup failed.
8133
8134 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8135
8136         * expression.cs (ResolveMemberAccess): Remove redundant code.
8137         TypeExpr expressions are always born fully resolved.
8138
8139         * interface.cs (PopulateMethod): Do not lookup the types twice.
8140         We were doing it once during SemanticAnalysis and once during
8141         PopulateMethod.
8142
8143         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8144         in local variable type definitions, were being returned as a
8145         SimpleName (we decomposed everything into a string), that is
8146         because primary_expression was being used instead of a type in the
8147         grammar (reduce/reduce conflicts).
8148
8149         The part that was wrong is that we converted the expression into a
8150         string (an oversimplification in one hand, compounded with primary
8151         expressions doing string concatenation).
8152
8153         So things like:
8154
8155         A.B.C [] x;
8156
8157         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8158         using clauses from working on this particular context.  And a type
8159         was being matched directly against "A.B.C[]".
8160
8161         We now use the correct approach, and allow for ComposedCast to be
8162         part of the unary expression.  So the "A.B.C []" become a composed
8163         cast of "A.B.C" (as a nested group of MemberAccess with a
8164         SimpleName at the end) plus the rank composition "[]". 
8165
8166         Also fixes 35567
8167
8168 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8169
8170         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8171         for the access level checking.
8172
8173         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8174         `TypeContainer container', because I kept getting confused when I
8175         was debugging this code.
8176
8177         * expression.cs (Indexers): Instead of tracking getters/setters,
8178         we now track them in parallel.  We create one arraylist less, but
8179         most importantly it is possible now for the LValue code to find a
8180         matching get for a set.
8181
8182         (IndexerAccess.DoResolveLValue): Update the code.
8183         GetIndexersForType has been modified already to extract all the
8184         indexers from a type.  The code assumed it did not.
8185
8186         Also make the code set the correct return type for the indexer.
8187         This was fixed a long time ago for properties, but was missing for
8188         indexers.  It used to be void_type.
8189
8190         (Binary.Emit): Test first for doubles instead of
8191         floats, as they are more common.
8192
8193         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8194         when dealing with floats and the <=, >= operators.  This fixes bug
8195         #39314 
8196
8197         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8198         to load the array value by emitting a load on the foreach variable
8199         type.  This was incorrect.  
8200
8201         We now emit the code to load an element using the the array
8202         variable type, and then we emit the conversion operator.
8203
8204         Fixed #40176
8205
8206 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8207
8208         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8209
8210 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8211
8212         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8213         test for protection before we test for signatures. 
8214
8215         (MethodSignature.ToString): implement.
8216
8217         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8218         to the case where we reduced into a LongConstant.
8219
8220         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8221         depend on whether the information is acurrate, because the
8222         Microsoft runtime will always claim that the array type is public,
8223         regardless of the real state.
8224
8225         If the type is a pointer, another problem happens: the type is
8226         reported as non-public in Microsoft.  
8227
8228         In both cases we have to call CheckAccessLevel recursively with
8229         the underlying type as the argument to be tested.
8230
8231 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8232
8233         * assign.cs (Assign.Emit): If we are dealing with a compound
8234         assignment expression, we should use the code path that stores the
8235         intermediate result in a temporary value.  This fixes #40903.
8236
8237         *expression.cs (Indirection.ToString): Provide ToString method for
8238         debugging. 
8239
8240 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8241
8242         * class.cs: Null out fields holding references to Block objects so
8243         they can be garbage collected.
8244
8245         * expression.cs (OverloadResolve): Remove unused local.
8246
8247 2003-04-07  Martin Baulig  <martin@ximian.com>
8248
8249         * codegen.cs (EmitContext.CurrentFile): New public field.
8250         (EmitContext.Mark): Use the CurrentFile to check whether the
8251         location is in the correct file.
8252         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8253
8254 2003-04-07  Martin Baulig  <martin@ximian.com>
8255
8256         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8257
8258         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8259         location.  [FIXME: The location argument which gets passed to this
8260         method is sometimes wrong!]
8261
8262 2003-04-07  Nick Drochak <ndrochak@gol.com>
8263
8264         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8265
8266 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8267
8268         * expression.cs (Indirection.EmitAssign): We were using the
8269         temporary, but returning immediately instead of continuing the
8270         EmitAssing flow.
8271
8272 2003-04-06  Martin Baulig  <martin@ximian.com>
8273
8274         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8275         if it's a nested child, but also deriving from the outer class.
8276         See test 190.cs.
8277
8278         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8279         nested child, but also deriving from the outer class.  See
8280         test-190.cs.
8281         (FilterWithClosure): We may access private members of the outer
8282         class if we're a nested child and deriving from the outer class.
8283         (RealMemberLookup): Only set `closure_private_ok' if the
8284         `original_bf' contained BindingFlags.NonPublic.
8285
8286 2003-04-05  Martin Baulig  <martin@ximian.com>
8287
8288         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
8289
8290 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8291
8292         * class.cs (Event.Define): Do not allow abstract events to have
8293         initializers. 
8294
8295 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8296
8297         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8298         block in event declarations.
8299
8300         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8301         value type, get its address.
8302
8303         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8304         leaving a class on the stack instead of a boolean value (int
8305         0/1).  Change the code so we compare against null, and then the
8306         result against zero.
8307
8308         * class.cs (TypeContainer.GetClassBases): We were checking for the
8309         parent class being sealed too late.
8310
8311         * expression.cs (Binary.Emit): For <= and >= when dealing with
8312         floating point values, use cgt.un and clt.un instead of cgt and
8313         clt alone.
8314
8315 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8316
8317         * statement.cs: Apply the same optimization as MS: skip the 
8318         GetEnumerator returning an IEnumerator, and use the one returning a 
8319         CharEnumerator instead. This allows us to avoid the try-finally block 
8320         and the boxing.
8321
8322 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8323
8324         * cs-parser.jay: Attributes cannot be applied to
8325                          namespaces. Fixes #40473
8326
8327 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8328
8329         * class.cs:
8330         (Add*): check if the name is valid using the full name for constants,
8331         fields, properties and events.
8332
8333 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8334
8335         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8336         char constants to be part of the enumeration.
8337
8338         * expression.cs (Conditional.DoResolve): Add support for operator
8339         true. Implements the missing functionality from 14.12
8340
8341         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8342         operator true/false as required by the spec.
8343
8344         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8345         implicit conversion to boolean.
8346
8347         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8348         also one where the type implements `operator true'. 
8349
8350         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8351         get an expression that will invoke operator true based on an
8352         expression.  
8353
8354         (GetConversionOperators): Removed the hack that called op_True
8355         here.  
8356
8357         (Expression.ResolveBoolean): Move this from Statement.
8358
8359 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8360
8361         * ecore.cs (FieldExpr): do not allow initialization of initonly
8362         fields on derived classes
8363
8364 2003-03-13  Martin Baulig  <martin@ximian.com>
8365
8366         * statement.cs (Block.Emit): Call ig.BeginScope() and
8367         ig.EndScope() when compiling with debugging info; call
8368         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8369
8370 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8371
8372         * expression.cs (Indexers): Do not construct immediately, allow
8373         for new members to be appended as we go.  Fixes 38143
8374
8375 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8376
8377         * expression.cs: save/restore context when resolving an unchecked
8378         expression.
8379
8380 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8381
8382         * cfold.cs: Catch division by zero in modulus operator during
8383         constant folding.
8384
8385 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8386
8387         * interface.cs (Interface.DefineMembers): Avoid defining members
8388         twice. 
8389
8390 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8391
8392         * driver.cs: handle the +/- options for -noconfig
8393
8394         * statement.cs (Unckeched.Resolve): Also track the state of
8395         unchecked in the Resolve phase.
8396
8397 2003-02-27  Martin Baulig  <martin@ximian.com>
8398
8399         * ecore.cs (Expression.MemberLookup): Don't create a
8400         MethodGroupExpr for something which is not a method.  Fixes #38291.
8401
8402 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8403
8404         * class.cs (MemberBase.CheckParameters): Also check that the type
8405         is unmanaged if it is a pointer.
8406
8407         * expression.cs (SizeOf.Resolve): Add location information.
8408
8409         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8410         a managed type is declared.
8411
8412         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8413         parameter modifiers as well.  Fixes bug 38606
8414
8415         * class.cs: Very sad.  Am backing out the speed up changes
8416         introduced by the ArrayList -> Array in the TypeContainer, as they
8417         were not actually that much faster, and introduced a bug (no error
8418         reports on duplicated methods).
8419
8420         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8421         source first, this will guarantee that we have a valid expression
8422         before calling in lower levels functions that will require a
8423         resolved object.  Then use this original_source in the
8424         target.ResolveLValue instead of the original source that was
8425         passed to us.
8426
8427         Another change.  Use target.Resolve instead of LValueResolve.
8428         Although we are resolving for LValues, we will let the Assign code
8429         take care of that (it will be called again from Resolve).  This
8430         basically allows code like this:
8431
8432         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8433         class Y { void A (X x) { x [0] += o; }
8434
8435         The problem was that the indexer was trying to resolve for
8436         set_Item (idx, object o) and never finding one.  The real set_Item
8437         was set_Item (idx, X).  By delaying the process we get the right
8438         semantics. 
8439
8440         Fixes bug 36505
8441
8442 2003-02-23  Martin Baulig  <martin@ximian.com>
8443
8444         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8445         while calling DoEmit ().
8446
8447         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8448         source files; if you use the #line directive inside a method, the
8449         compiler stops emitting line numbers for the debugger until it
8450         reaches the end of the method or another #line directive which
8451         restores the original file.
8452
8453 2003-02-23  Martin Baulig  <martin@ximian.com>
8454
8455         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8456
8457 2003-02-23  Martin Baulig  <martin@ximian.com>
8458
8459         * statement.cs (Block.AddChildVariableNames): We need to call this
8460         recursively, not just for our immediate children.
8461
8462 2003-02-23  Martin Baulig  <martin@ximian.com>
8463
8464         * class.cs (Event.Define): Always make the field private, like csc does.
8465
8466         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8467         actually work, fixes bug #37521.
8468
8469 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * delegate.cs: When creating the various temporary "Parameters"
8472         classes, make sure that we call the ComputeAndDefineParameterTypes
8473         on those new parameters (just like we do with the formal ones), to
8474         allow them to be resolved in the context of the DeclSpace.
8475
8476         This fixes the bug that Dick observed in Bugzilla #38530.
8477
8478 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8479
8480         * expression.cs (ResolveMemberAccess): When resolving a constant,
8481         do not attempt to pull a constant if the value was not able to
8482         generate a valid constant.
8483
8484         * const.cs (LookupConstantValue): Do not report more errors than required.
8485
8486 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8487
8488         * expression.cs: fixes bug #38328.
8489
8490 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8491
8492         * class.cs: Changed all the various members that can be part of a
8493         class from being an ArrayList to be an Array of the right type.
8494         During the DefineType type_list, interface_list, delegate_list and
8495         enum_list are turned into types, interfaces, delegates and enums
8496         arrays.  
8497
8498         And during the member population, indexer_list, event_list,
8499         constant_list, field_list, instance_constructor_list, method_list,
8500         operator_list and property_list are turned into their real arrays.
8501
8502         Although we could probably perform this operation earlier, for
8503         good error reporting we need to keep the lists and remove the
8504         lists for longer than required.
8505
8506         This optimization was triggered by Paolo profiling the compiler
8507         speed on the output of `gen-sample-program.pl' perl script. 
8508
8509         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8510         not crash in methods like MemberLookupFailed that use this field.  
8511
8512         This problem arises when the compiler fails to resolve a type
8513         during interface type definition for example.
8514
8515 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8516
8517         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8518         inherit from System.Object, so we have to stop at null, not only
8519         when reaching System.Object.
8520
8521 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8522
8523         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8524         DeclaredOnly because the parent indexer might have had a different
8525         name, but did not loop until the top of the hierarchy was reached.
8526
8527         The problem this one fixes is 35492: when a class implemented an
8528         indexer from an interface, we were getting the interface method
8529         (which was abstract) and we were flagging an error (can not invoke
8530         abstract method).
8531
8532         This also keeps bug 33089 functioning, and test-148 functioning.
8533
8534         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8535         out if a method is special is to see if it is declared in a
8536         property or event, or whether it is one of the predefined operator
8537         names.   This should fix correctly #36804.
8538
8539 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8540
8541         The goal here is to remove the dependency on EmptyCast.Peel ().
8542         Killing it completely.
8543
8544         The problem is that currently in a number of places where
8545         constants are expected, we have to "probe" for an EmptyCast, and
8546         Peel, which is not the correct thing to do, as this will be
8547         repetitive and will likely lead to errors. 
8548
8549         The idea is to remove any EmptyCasts that are used in casts that
8550         can be reduced to constants, so we only have to cope with
8551         constants. 
8552
8553         This bug hunt was triggered by Bug 37363 and the desire to remove
8554         the duplicate pattern where we were "peeling" emptycasts to check
8555         whether they were constants.  Now constants will always be
8556         constants.
8557
8558         * ecore.cs: Use an enumconstant here instead of wrapping with
8559         EmptyCast.  
8560
8561         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8562         throwing me off.  By handling this we can get rid of a few hacks.
8563
8564         * statement.cs (Switch): Removed Peel() code.
8565
8566 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
8567
8568         * class.cs: Location information for error 508
8569
8570         * expression.cs (New.DoResolve): Add a guard against double
8571         resolution of an expression.  
8572
8573         The New DoResolve might be called twice when initializing field
8574         expressions (see EmitFieldInitializers, the call to
8575         GetInitializerExpression will perform a resolve on the expression,
8576         and later the assign will trigger another resolution
8577
8578         This leads to bugs (#37014)
8579
8580         * delegate.cs: The signature for EndInvoke should contain any ref
8581         or out parameters as well.  We were not doing this in the past. 
8582
8583         * class.cs (Field.Define): Do not overwrite the type definition
8584         inside the `volatile' group.  Turns out that volatile enumerations
8585         were changing the type here to perform a validity test, which
8586         broke conversions. 
8587
8588 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
8589
8590         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
8591         and structs, we do not want to load the instance variable
8592
8593         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
8594         enum_type has to be handled like an object reference (implicit
8595         conversions exists from this to object), but the regular IsClass
8596         and IsValueType tests will never return true for this one.
8597
8598         Also we use TypeManager.IsValueType instead of type.IsValueType,
8599         just for consistency with the rest of the code (this is only
8600         needed if we ever use the construct exposed by test-180.cs inside
8601         corlib, which we dont today).
8602
8603 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
8604
8605         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
8606         just InternalCall.
8607
8608 2003-02-09  Martin Baulig  <martin@ximian.com>
8609
8610         * namespace.cs (Namespace..ctor): Added SourceFile argument.
8611         (Namespace.DefineNamespaces): New static public method; this is
8612         called when we're compiling with debugging to add all namespaces
8613         to the symbol file.
8614
8615         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
8616         pass it to the Namespace's .ctor.
8617
8618         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
8619         and MethodBase arguments; pass the namespace ID to the symwriter;
8620         pass the MethodBase instead of the token to the symwriter.
8621         (SymbolWriter.DefineNamespace): New method to add a namespace to
8622         the symbol file.
8623
8624 2003-02-09  Martin Baulig  <martin@ximian.com>
8625
8626         * symbolwriter.cs: New file.  This is a wrapper around
8627         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
8628         methods here in near future.
8629
8630 2003-02-09  Martin Baulig  <martin@ximian.com>
8631
8632         * codegen.cs (EmitContext.Mark): Just pass the arguments to
8633         ILGenerator.MarkSequencePoint() which are actually used by the
8634         symbol writer.
8635
8636 2003-02-09  Martin Baulig  <martin@ximian.com>
8637
8638         * location.cs (SourceFile): New public sealed class.  This
8639         contains the name and an index which is used in the location's token.
8640         (Location): Reserve an appropriate number of bits in the token for
8641         the source file instead of walking over that list, this gives us a
8642         really huge performance improvement when compiling with debugging.
8643
8644         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
8645         `SourceFile' argument instead of a string.
8646         (Driver.ProcessFile): Add all the files via Location.AddFile(),
8647         but don't parse/tokenize here, we need to generate the list of all
8648         source files before we do that.
8649         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
8650         the files.
8651
8652         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
8653         instead of a string.
8654
8655         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
8656         of a string.
8657
8658 2003-02-09  Martin Baulig  <martin@ximian.com>
8659
8660         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
8661         filename on `#line default'.
8662
8663 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
8664
8665         * statement.cs: don't clear the pinned var when the fixed statement
8666         returns from the method (fixes bug#37752).
8667
8668 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
8669
8670         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
8671         to IsValueType.
8672
8673 2003-02-07  Martin Baulig  <martin@ximian.com>
8674
8675         * driver.cs: Removed the `--debug-args' command line argument.
8676
8677         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
8678         automatically by the AsssemblyBuilder.
8679         (CodeGen.InitializeSymbolWriter): We don't need to call any
8680         initialization function on the symbol writer anymore.  This method
8681         doesn't take any arguments.
8682
8683 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
8684
8685         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
8686         from referenced assemblies as well.
8687
8688 2003-02-02  Martin Baulig  <martin@ximian.com>
8689
8690         * class.cs (MethodData.Emit): Generate debugging info for external methods.
8691
8692 2003-02-02  Martin Baulig  <martin@ximian.com>
8693
8694         * class.cs (Constructor.Emit): Open the symbol writer before
8695         emitting the constructor initializer.
8696         (ConstructorInitializer.Emit): Call ec.Mark() to allow
8697         single-stepping through constructor initializers.
8698
8699 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
8700
8701         * class.cs: Handle error 549: do not allow virtual methods in
8702         sealed classes. 
8703
8704 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
8705
8706         * decl.cs: Check access levels when resolving types
8707
8708 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
8709
8710         * statement.cs: Add parameters and locals set in catch blocks that might 
8711         return to set vector
8712
8713 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
8714
8715         * class.cs (Operator): Set the SpecialName flags for operators.
8716
8717         * expression.cs (Invocation.DoResolve): Only block calls to
8718         accessors and operators on SpecialName methods.
8719
8720         (Cast.TryReduce): Handle conversions from char constants.
8721
8722
8723 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
8724
8725         * statement.cs: small memory and time optimization in FlowBranching.
8726
8727 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
8728
8729         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
8730         problem that the last fix but in the other sid (Set).
8731
8732         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
8733         access when there is no indexer in the hierarchy.
8734
8735 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
8736
8737         * class.cs: Combine some if statements.
8738
8739 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8740
8741         * driver.cs: fixed bug #37187.
8742
8743 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
8744
8745         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
8746         any indexer, it's needed to build a list with all the indexers in the
8747         hierarchy (AllGetters), else we have problems. Fixes #35653.
8748
8749 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
8750
8751         * class.cs (MethodData.Define): It is wrong for an interface
8752         implementation to be static in both cases: explicit and implicit.
8753         We were only handling this in one case.
8754
8755         Improve the if situation there to not have negations.
8756
8757         * class.cs (Field.Define): Turns out that we do not need to check
8758         the unsafe bit on field definition, only on usage.  Remove the test.
8759
8760 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8761
8762         * driver.cs: use assembly.Location instead of Codebase (the latest
8763         patch made mcs fail when using MS assemblies).
8764
8765 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
8766
8767         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
8768         get the path to *corlib.dll.
8769
8770 2003-01-21  Nick Drochak <ndrochak@gol.com>
8771
8772         * cs-tokenizer.cs:
8773         * pending.cs:
8774         * typemanager.cs: Remove compiler warnings
8775
8776 2003-01-20  Duncan Mak  <duncan@ximian.com>
8777
8778         * AssemblyInfo.cs: Bump the version number to 0.19.
8779
8780 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8781
8782         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
8783
8784 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
8785
8786         * class.cs (Constructor::Emit): Emit debugging info for constructors.
8787
8788 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * cs-parser.jay: Small fix: we were not comparing the constructor
8791         name correctly.   Thanks to Zoltan for the initial pointer.
8792
8793 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
8794
8795         * cs-tokenizer.cs: Set file name when specified with #line
8796
8797 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
8798
8799         * cs-parser.jay: Only perform the constructor checks here if we
8800         are named like the class;  This will help provider a better
8801         error.  The constructor path is taken when a type definition is
8802         not found, but most likely the user forgot to add the type, so
8803         report that rather than the constructor error.
8804
8805 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
8806
8807         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
8808         allocations.
8809
8810 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
8811
8812         * cs-parser.jay: Add cleanup call.
8813
8814 2003-01-13  Duncan Mak  <duncan@ximian.com>
8815
8816         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
8817         consistent with other methods.
8818
8819 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
8820
8821         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
8822
8823 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
8824
8825         * attribute.cs: only set GuidAttr to true when we have a
8826         GuidAttribute.
8827
8828 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8829
8830         * ecore.cs:
8831         * expression.cs:
8832         * typemanager.cs: fixes to allow mcs compile corlib with the new
8833         Type.IsSubclassOf fix.
8834
8835 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
8836
8837         * expression.cs (LocalVariableReference.DoResolve): Classify a
8838         constant as a value, not as a variable.   Also, set the type for
8839         the variable.
8840
8841         * cs-parser.jay (fixed_statement): take a type instead of a
8842         pointer_type, so we can produce a better error message later.
8843
8844         * statement.cs (Fixed.Resolve): Flag types that are not pointers
8845         as an error.  
8846
8847         (For.DoEmit): Make inifinite loops have a
8848         non-conditional branch back.
8849
8850         (Fixed.DoEmit): First populate the pinned variables, then emit the
8851         statement, then clear the variables.  Before I was emitting the
8852         code once for each fixed piece.
8853
8854
8855 2003-01-08  Martin Baulig  <martin@ximian.com>
8856
8857         * statement.cs (FlowBranching.MergeChild): A break in a
8858         SWITCH_SECTION does not leave a loop.  Fixes #36155.
8859
8860 2003-01-08  Martin Baulig  <martin@ximian.com>
8861
8862         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
8863         lives in the same number space than `param_map'.  Fixes #36154.
8864
8865 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
8866
8867         * cs-parser.jay (constructor_declaration): Set the
8868         Constructor.ModFlags before probing for it.  This makes the
8869         compiler report 514, 515 and 132 (the code was there, but got
8870         broken). 
8871
8872         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
8873         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
8874         (GotoCase.Resolve): Set `Returns' to ALWAYS.
8875
8876 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
8877
8878         * enum.cs: create the enum static fields using the enum type.
8879
8880 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
8881
8882         * class.cs: don't try to create the ParamBuilder for the return
8883         type if it's not needed (and handle it breaking for the ms runtime
8884         anyway).
8885
8886 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
8887
8888         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
8889
8890 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
8891
8892         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
8893         the command.   This showed up while compiling the JANET source
8894         code, which used \r as its only newline separator.
8895
8896 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
8897
8898         * class.cs (Method.Define): If we are an operator (because it
8899         reuses our code), then set the SpecialName and HideBySig.  #36128
8900
8901 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
8902
8903         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
8904         exception, report error 120 `object reference required'.
8905
8906         * driver.cs: Add --pause option, used during to measure the size
8907         of the process as it goes with --timestamp.
8908
8909         * expression.cs (Invocation.DoResolve): Do not allow methods with
8910         SpecialName to be invoked.
8911
8912 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
8913
8914         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
8915         number before adding it.
8916
8917 2002-12-21  Ravi Pratap  <ravi@ximian.com>
8918
8919         * ecore.cs (StandardImplicitConversion): When in an unsafe
8920         context, we allow conversion between void * to any other pointer
8921         type. This fixes bug #35973.
8922
8923 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
8924
8925         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
8926         is not thrown when extensionless outputs are used 
8927
8928 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8929
8930         * rootcontext.cs: fixed compilation of corlib.
8931
8932 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
8933
8934         * attribute.cs (Attributes.Contains): Add new method.
8935
8936         * class.cs (MethodCore.LabelParameters): if the parameter is an
8937         `out' parameter, check that no attribute `[In]' has been passed.
8938
8939         * enum.cs: Handle the `value__' name in an enumeration.
8940
8941 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
8942
8943         * decl.cs: Added special case to allow overrides on "protected
8944         internal" methods
8945
8946 2002-12-18  Ravi Pratap  <ravi@ximian.com>
8947
8948         * attribute.cs (Attributes.AddAttributeSection): Rename to this
8949         since it makes much more sense.
8950
8951         (Attributes.ctor): Don't require a Location parameter.
8952
8953         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
8954
8955         * attribute.cs (ApplyAttributes): Remove extra Location parameters
8956         since we already have that information per attribute.
8957
8958         * everywhere : make appropriate changes.
8959
8960         * class.cs (LabelParameters): Write the code which actually
8961         applies attributes to the return type. We can't do this on the MS
8962         .NET runtime so we flag a warning in the case an exception is
8963         thrown.
8964
8965 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
8966
8967         * const.cs: Handle implicit null conversions here too.
8968
8969 2002-12-17  Ravi Pratap  <ravi@ximian.com>
8970
8971         * class.cs (MethodCore.LabelParameters): Remove the extra
8972         Type [] parameter since it is completely unnecessary. Instead
8973         pass in the method's attributes so that we can extract
8974         the "return" attribute.
8975
8976 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
8977
8978         * cs-parser.jay (parse): Use Report.Error to flag errors instead
8979         of ignoring it and letting the compile continue.
8980
8981         * typemanager.cs (ChangeType): use an extra argument to return an
8982         error condition instead of throwing an exception.
8983
8984 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
8985
8986         * expression.cs (Unary.TryReduce): mimic the code for the regular
8987         code path.  Perform an implicit cast in the cases where we can
8988         implicitly convert to one of the integral types, and then reduce
8989         based on that constant.   This fixes bug #35483.
8990
8991 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8992
8993         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
8994
8995 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8996
8997         * namespace.cs: fixed bug #35489.
8998
8999 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9000
9001         * class.cs: Remove some dead code.
9002
9003         * cs-parser.jay: Estimate the number of methods needed
9004         (RootContext.MethodCount);
9005
9006         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9007         numbers instead of StringBuilders.
9008
9009         * support.cs (PtrHashtable): Add constructor with initial size;
9010         We can now reduce reallocations of the method table.
9011
9012 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9013
9014         * attribute.cs (ApplyAttributes): Keep track of the emitted
9015         attributes on a per-target basis. This fixes bug #35413.
9016
9017 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9018
9019         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9020         default to the Windows 1252 encoding.
9021
9022         (UnixParseOption): Support version, thanks to Alp for the missing
9023         pointer. 
9024
9025         * AssemblyInfo.cs: Add nice assembly information.
9026
9027         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9028         (bug 35169).
9029
9030         * cs-parser.jay: Allow a trailing comma before the close bracked
9031         in the attribute_section production.
9032
9033         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9034         address of the instance was being taken, I will take this out,
9035         because we take the address of the object immediately here.
9036
9037 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9038
9039         * typemanager.cs (AreMultipleAllowed): Take care of the most
9040         obvious case where attribute type is not in the current assembly -
9041         stupid me ;-)
9042
9043 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9044
9045         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9046         definitions, instead of doing that afterwards.  
9047
9048         Also we use a nice little hack, depending on the constructor, we
9049         know if we are a "composed" name or a simple name.  Hence, we
9050         avoid the IndexOf test, and we avoid 
9051
9052         * codegen.cs: Add code to assist in a bug reporter to track down
9053         the source of a compiler crash. 
9054
9055 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9056
9057         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9058         types have been emitted for a given element and flag an error
9059         if something which does not have AllowMultiple set is used more
9060         than once.
9061
9062         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9063         attribute types and their corresponding AllowMultiple properties
9064
9065         (AreMultipleAllowed): Check the property for a given type.
9066
9067         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9068         property in the case we have a TypeContainer.
9069
9070         (Attributes.AddAttribute): Detect duplicates and just skip on
9071         adding them. This trivial fix catches a pretty gross error in our
9072         attribute emission - global attributes were being emitted twice!
9073
9074         Bugzilla bug #33187 is now fixed.
9075
9076 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9077
9078         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9079         instead of pp_and).
9080
9081         * expression.cs (Binary.ResolveOperator): I can only use the
9082         Concat (string, string, string) and Concat (string, string,
9083         string, string) if the child is actually a concatenation of
9084         strings. 
9085
9086 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9087
9088         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9089         context where we need a 2-character lookahead.
9090
9091         * pending.cs (PendingImplementation): Rework so we can keep track
9092         of interface types all the time, and flag those which were
9093         implemented by parents as optional.
9094
9095 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9096
9097         * expression.cs (Binary.ResolveOperator): Use
9098         String.Concat(string,string,string) or
9099         String.Concat(string,string,string,string) when possible. 
9100
9101         * typemanager: More helper methods.
9102
9103
9104 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9105
9106         * pending.cs: remove the bogus return from GetMissingInterfaces()
9107         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9108
9109 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9110
9111         * namespace.cs: avoid duplicated 'using xxx' being added to
9112         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9113         when we get more than one 'using' statement for the same namespace.
9114         Report a CS0105 warning for it.
9115
9116 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9117
9118         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9119         of calling getChar/putback, uses internal knowledge of it.    
9120
9121         (xtoken): Reorder tokenizer so most common patterns are checked
9122         first.  This reduces the compilation time in another 5% (from 8.11s
9123         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9124
9125         The parsing time is 22% of the compilation in mcs, and from that
9126         64% is spent on the tokenization process.  
9127
9128         I tried using a binary search for keywords, but this is slower
9129         than the hashtable.  Another option would be to do a couple of
9130         things:
9131
9132                 * Not use a StringBuilder, instead use an array of chars,
9133                   with a set value.  Notice that this way we could catch
9134                   the 645 error without having to do it *afterwards*.
9135
9136                 * We could write a hand-parser to avoid the hashtable
9137                   compares altogether.
9138
9139         The identifier consumption process takes 37% of the tokenization
9140         time.  Another 15% is spent on is_number.  56% of the time spent
9141         on is_number is spent on Int64.Parse:
9142
9143                 * We could probably choose based on the string length to
9144                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9145                   computations. 
9146
9147         Another 3% is spend on wrapping `xtoken' in the `token' function.
9148
9149         Handle 0xa0 as whitespace (#34752)
9150
9151 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9152
9153         * typemanager.cs (IsCLRType): New routine to tell whether a type
9154         is one of the builtin types.  
9155
9156         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9157         typecode in more places instead of doing pointer comparissions.
9158         We could leverage some knowledge about the way the typecodes are
9159         laid out.
9160
9161         New code to cache namespaces in assemblies, it is currently not
9162         invoked, to be used soon.
9163
9164         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9165
9166         * expression.cs (Binary.ResolveOperator): specially handle
9167         strings, and do not perform user-defined operator overloading for
9168         built-in types.
9169
9170 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9171
9172         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9173         internalcall as it is a pretty simple operation;  Avoid whenever
9174         possible to call Char.IsLetter.
9175
9176         (consume_identifier): Cut by half the number of
9177         hashtable calls by merging the is_keyword and GetKeyword behavior.
9178
9179         Do not short-circuit, because if we do, we
9180         report errors (ie, #if false && true would produce an invalid
9181         directive error);
9182
9183
9184 2002-11-24  Martin Baulig  <martin@ximian.com>
9185
9186         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9187         check constant ranges and report a CS0221.  Fixes #33186.
9188
9189 2002-11-24  Martin Baulig  <martin@ximian.com>
9190
9191         * cs-parser.jay: Make this work for uninitialized variable
9192         declarations in the `for' initializer.  Fixes #32416.
9193
9194 2002-11-24  Martin Baulig  <martin@ximian.com>
9195
9196         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9197         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9198
9199 2002-11-24  Martin Baulig  <martin@ximian.com>
9200
9201         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9202         argument; if true, we also check for user-defined conversions.
9203         This is only needed if both arguments are of a user-defined type.
9204         Fixes #30443, added test-175.cs.
9205         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9206
9207         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9208
9209 2002-11-24  Martin Baulig  <martin@ximian.com>
9210
9211         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9212         function to get the store opcode.
9213         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9214         only emit the Ldelema if the store opcode is Stobj.  You must run
9215         both test-34 and test-167 to test this.  Fixes #34529.
9216
9217 2002-11-23  Martin Baulig  <martin@ximian.com>
9218
9219         * ecore.cs (Expression.MemberLookup): Added additional
9220         `qualifier_type' argument which is used when we're being called
9221         from MemberAccess.DoResolve() and null if we're called from a
9222         SimpleName lookup.
9223         (Expression.MemberLookupFailed): New method to report errors; this
9224         does the CS1540 check and reports the correct error message.
9225
9226         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9227         argument for the CS1540 check and redone the way how we're dealing
9228         with private members.  See the comment in the source code for details.
9229         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9230         `closure_start_type' to `closure_qualifier_type' and check whether
9231         it's not null.  It was not this filter being broken, it was just
9232         being called with the wrong arguments.
9233
9234         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9235         and pass it the correct `qualifier_type'; this also does the error
9236         handling for us.
9237
9238 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9239
9240         * expression.cs (Invocation.EmitParams): If the we are dealing
9241         with a non-built-in value type, load its address as well.
9242
9243         (ArrayCreation): Use a a pretty constant instead
9244         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9245         static initializers.  
9246
9247         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9248         because they are not really value types, just glorified integers. 
9249
9250         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9251
9252         * ecore.cs: Remove redundant code for enumerations, make them use
9253         the same code path as everything else, fixes the casting issue
9254         with enumerations in Windows.Forms.
9255
9256         * attribute.cs: Do only cast to string if it is a string, the
9257         validation happens later.
9258
9259         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9260         people upgrade their corlibs.
9261
9262         * ecore.cs: Oops, enumerations were not following the entire code path
9263
9264 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9265
9266         * typemanager.cs (FilterWithClosure): Commented out the test for
9267         1540 in typemanager.cs, as it has problems when accessing
9268         protected methods from a parent class (see test-174.cs). 
9269
9270         * attribute.cs (Attribute.ValidateGuid): new method.
9271         (Attribute.Resolve): Use above.
9272
9273 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9274
9275         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9276
9277         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9278         handling for enumerations, as we only needed the TypeContainer
9279         functionality to begin with (this is required for the fix below to
9280         work for enums that reference constants in a container class for
9281         example). 
9282
9283         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9284
9285         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9286         a valid TypeBuilder to perform lookups on.o
9287
9288         * class.cs (InheritableMemberSignatureCompare): Use true in the
9289         call to GetGetMethod and GetSetMethod, because we are comparing
9290         the signature, and we need to get the methods *even* if they are
9291         private. 
9292
9293         (PropertyBase.CheckBase): ditto.
9294
9295         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9296         GotoCase.Resolve): Use Peel on EmpytCasts.
9297
9298         * ecore.cs (EmptyCast): drop child, add Peel method.
9299
9300 2002-11-17  Martin Baulig  <martin@ximian.com>
9301
9302         * ecore.cs (EmptyCast.Child): New public property.
9303
9304         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9305         label resolved to an EmptyCast.  Fixes #34162.
9306         (GotoCase.Resolve): Likewise.
9307         (Block.EmitMeta): Likewise.
9308
9309 2002-11-17  Martin Baulig  <martin@ximian.com>
9310
9311         * expression.cs (Invocation.BetterConversion): Prefer int over
9312         uint; short over ushort; long over ulong for integer literals.
9313         Use ImplicitConversionExists instead of StandardConversionExists
9314         since we also need to check for user-defined implicit conversions.
9315         Fixes #34165.  Added test-173.cs.
9316
9317 2002-11-16  Martin Baulig  <martin@ximian.com>
9318
9319         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9320         with the `true' and `false' literals.  Fixes #33151.
9321
9322 2002-11-16  Martin Baulig  <martin@ximian.com>
9323
9324         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9325         October 22nd; don't do the cs1540 check for static members.
9326
9327         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9328         now using our own filter here and doing the cs1540 check again.
9329
9330 2002-11-16  Martin Baulig  <martin@ximian.com>
9331
9332         * support.cs (InternalParameters): Don't crash if we don't have
9333         any fixed parameters.  Fixes #33532.
9334
9335 2002-11-16  Martin Baulig  <martin@ximian.com>
9336
9337         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9338         when looking up static methods to make this work on Windows.
9339         Fixes #33773.
9340
9341 2002-11-16  Martin Baulig  <martin@ximian.com>
9342
9343         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9344         a setter rather than using PropertyInfo.CanWrite.
9345
9346 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9347
9348         * class.cs: Allow acces to block member by subclasses. Fixes build
9349         breaker.
9350
9351 2002-11-14  Martin Baulig  <martin@ximian.com>
9352
9353         * class.cs (Constructor.Emit): Added the extern/block check.
9354         Fixes bug #33678.
9355
9356 2002-11-14  Martin Baulig  <martin@ximian.com>
9357
9358         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9359         iteration while looking for indexers, this is needed because the
9360         indexer may have a different name in our base classes.  Fixed the
9361         error reporting (no indexers at all, not get accessor, no
9362         overloaded match).  Fixes bug #33089.
9363         (IndexerAccess.DoResolveLValue): Likewise.
9364
9365 2002-11-14  Martin Baulig  <martin@ximian.com>
9366
9367         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9368         indexers.  Fixes the first part of bug #33089.
9369         (MethodSignature.InheritableMemberSignatureCompare): Added support
9370         for properties.
9371
9372 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9373
9374         * attribute.cs (Attribute.Resolve): Catch the
9375         NullReferenceException and report it since it isn't supposed to
9376         happen. 
9377
9378 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9379
9380         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9381         LogicalOr and LogicalAnd that can benefit from recursively
9382         handling EmitBranchable.  The code now should be nice for Paolo.
9383
9384 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9385
9386         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9387         the Type lookups, as we perform quite a number of lookups on
9388         non-Types.  This can be removed once we can deterministically tell
9389         whether we have a type or a namespace in advance.
9390
9391         But this might require special hacks from our corlib.
9392
9393         * TODO: updated.
9394
9395         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9396         and double which avoids a conversion from an integer to a double.
9397
9398         * expression.cs: tiny optimization, avoid calling IsConstant,
9399         because it effectively performs the lookup twice.
9400
9401 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9402
9403         But a bogus return here to keep the semantics of the old code
9404         until the Mono runtime is fixed.
9405
9406         * pending.cs (GetMissingInterfaces): New method used to remove all
9407         the interfaces that are already implemented by our parent
9408         classes from the list of pending methods. 
9409
9410         * interface.cs: Add checks for calls after ResolveTypeExpr.
9411
9412 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9413
9414         * class.cs (Class.Emit): Report warning 67: event not used if the
9415         warning level is beyond 3.
9416
9417         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9418         being a NullLiteral.
9419
9420         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9421         specifiers. 
9422
9423         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9424         path that might fail if a type can not be resolved.
9425
9426         * expression.cs (Binary.Emit): Emit unsigned versions of the
9427         operators. 
9428
9429         * driver.cs: use error 5.
9430
9431 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9432
9433         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9434
9435 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9436
9437         * cs-parser.jay (switch_section): A beautiful patch from Martin
9438         Baulig that fixed 33094.
9439
9440 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9441
9442         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9443         Check whether the base is abstract and report an error if so.
9444
9445         * expression.cs (IndexerAccess.DoResolveLValue,
9446         IndexerAccess.DoResolve): ditto. 
9447
9448         (Invocation.DoResolve): ditto.
9449
9450         (Invocation.FullMethodDesc): Improve the report string.
9451
9452         * statement.cs (Block): Eliminate IsVariableDefined as it is
9453         basically just a wrapper for GetVariableInfo.
9454
9455         * ecore.cs (SimpleName): Use new 
9456
9457         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9458         type, as we return the actual parameter ref/unref state on a
9459         different call.
9460
9461 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9462
9463         * support.cs: Return proper flags REF/OUT fixing the previous
9464         commit.  
9465
9466         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9467         not used to mean `ref' but `ref or out' in ParameterReference
9468
9469         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9470         full type signature instead of calling TypeManger.CSharpName
9471         ourselves. 
9472
9473         * support.cs (InternalParameters.ParameterDesc): Do not compare
9474         directly to the modflags, because REF/OUT will actually be bitsets
9475         if set. 
9476
9477         * delegate.cs (VerifyMethod): Check also the modifiers.
9478
9479         * cs-tokenizer.cs: Fix bug where floating point values with an
9480         exponent where a sign was missing was ignored.
9481
9482         * driver.cs: Allow multiple assemblies to be specified in a single
9483         /r: argument
9484
9485 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9486
9487         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9488         because identifiers after a parenthesis would end up in this kind
9489         of production, and we needed to desamiguate it for having casts
9490         like:
9491
9492                 (UserDefinedType *) xxx
9493
9494 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9495
9496         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9497         we should set on the Bindingflags.NonPublic, but not turn on
9498         private_ok.  private_ok controls whether a Private member is
9499         returned (this is chekced on the filter routine), while the
9500         BindingFlags.NonPublic just controls whether private/protected
9501         will be allowed.   This fixes the problem part of the problem of
9502         private properties being allowed to be used in derived classes.
9503
9504         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9505         so we can call the children DoResolveLValue method (this will
9506         properly signal errors on lvalue assignments to base properties)
9507
9508         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9509         getter are null, and we have a property info, we know that this
9510         happened because the lookup failed, so we report an error 122 for
9511         protection level violation.
9512
9513         We also silently return if setter and getter are null in the
9514         resolve functions, this condition only happens if we have flagged
9515         the error before.  This is the other half of the problem. 
9516
9517         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9518         not have accessibility information, that is why we were returning
9519         true in the filter function in typemanager.cs.
9520
9521         To properly report 122 (property is inaccessible because of its
9522         protection level) correctly, we report this error in ResolveAccess
9523         by failing if both the setter and the getter are lacking (ie, the
9524         lookup failed). 
9525
9526         DoResolve and DoLResolve have been modified to check for both
9527         setter/getter being null and returning silently, the reason being
9528         that I did not want to put the knowledge about this error in upper
9529         layers, like:
9530
9531         int old = Report.Errors;
9532         x = new PropertyExpr (...);
9533         if (old != Report.Errors)
9534                 return null;
9535         else
9536                 return x;
9537
9538         So the property expr is returned, but it is invalid, so the error
9539         will be flagged during the resolve process. 
9540
9541         * class.cs: Remove InheritablePropertySignatureCompare from the
9542         class, as we no longer depend on the property signature to compute
9543         whether it is possible to implement a method or not.
9544
9545         The reason is that calling PropertyInfo.GetGetMethod will return
9546         null (in .NET, in Mono it works, and we should change this), in
9547         cases where the Get Method does not exist in that particular
9548         class.
9549
9550         So this code:
9551
9552         class X { public virtual int A { get { return 1; } } }
9553         class Y : X { }
9554         class Z : Y { public override int A { get { return 2; } } }
9555
9556         Would fail in Z because the parent (Y) would not have the property
9557         defined.  So we avoid this completely now (because the alternative
9558         fix was ugly and slow), and we now depend exclusively on the
9559         method names.
9560
9561         (PropertyBase.CheckBase): Use a method-base mechanism to find our
9562         reference method, instead of using the property.
9563
9564         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9565         routines are gone now.
9566
9567         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9568         names, they were incorrectly named.
9569
9570         * cs-tokenizer.cs: Return are more gentle token on failure. 
9571
9572         * pending.cs (PendingImplementation.InterfaceMethod): This routine
9573         had an out-of-sync index variable, which caused it to remove from
9574         the list of pending methods the wrong method sometimes.
9575
9576 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9579         CanWrite, because those refer to this particular instance of the
9580         property, and do not take into account the fact that we can
9581         override single members of a property.
9582
9583         Constructor requires an EmitContext.  The resolution process does
9584         not happen here, but we need to compute the accessors before,
9585         because the resolution does not always happen for properties.
9586
9587         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
9588         subclass, before we did not update this flag, but we did update
9589         bindingflags. 
9590
9591         (GetAccessors): Drop this routine, as it did not work in the
9592         presence of partially overwritten set/get methods. 
9593
9594         Notice that this broke the cs1540 detection, but that will require
9595         more thinking. 
9596
9597 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9598
9599         * class.cs:
9600         * codegen.cs:
9601         * driver.cs: issue a warning instead of an error if we don't support
9602         debugging for the platform. Also ignore a couple of errors that may
9603         arise when trying to write the symbols. Undo my previous patch.
9604
9605 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9606
9607         * driver.cs: ignore /debug switch except for Unix platforms.
9608
9609 2002-10-23  Nick Drochak  <ndrochak@gol.com>
9610
9611         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
9612
9613 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
9614
9615         * driver.cs: Do not make mcs-debug conditional, so we do not break
9616         builds that use it.
9617
9618         * statement.cs (UsageVector.MergeChildren): I would like Martin to
9619         review this patch.  But basically after all the children variables
9620         have been merged, the value of "Breaks" was not being set to
9621         new_breaks for Switch blocks.  I think that it should be set after
9622         it has executed.  Currently I set this to the value of new_breaks,
9623         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
9624         conservative, but I do not understand this code very well.
9625
9626         I did not break anything in the build, so that is good ;-)
9627
9628         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
9629
9630 2002-10-20  Mark Crichton  <crichton@gimp.org>
9631
9632         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
9633
9634 2002-10-20  Nick Drochak  <ndrochak@gol.com>
9635
9636         * cfold.cs: Fixed compile blocker.
9637
9638 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
9639
9640         * driver.cs: I was chekcing the key, not the file.
9641
9642 2002-10-19  Ravi Pratap  <ravi@ximian.com>
9643
9644         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
9645         message that we were generating - we just need to silently return
9646         a null.
9647
9648 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
9649
9650         * class.cs (Event.Define): Change my previous commit, as this
9651         breaks the debugger.  This is a temporary hack, as it seems like
9652         the compiler is generating events incorrectly to begin with.
9653
9654         * expression.cs (Binary.ResolveOperator): Added support for 
9655         "U operator - (E x, E y)"
9656
9657         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
9658         y)".
9659
9660         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
9661         init-only variables, but this path did not take into account that
9662         there might be also instance readonly variables.  Correct this
9663         problem. 
9664
9665         This fixes bug 32253
9666
9667         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
9668         delegates as well.
9669
9670         * driver.cs: Change the extension for modules to `netmodule'
9671
9672         * cs-parser.jay: Improved slightly the location tracking for
9673         the debugger symbols.
9674
9675         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
9676         modifiers that were specified instead of the hardcoded value
9677         (FamAndAssem).  This was basically ignoring the static modifier,
9678         and others.  Fixes 32429.
9679
9680         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
9681         fixed a bug in the process (32476)
9682
9683         * expression.cs (ArrayAccess.EmitAssign): Patch from
9684         hwang_rob@yahoo.ca that fixes bug 31834.3
9685
9686 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
9687
9688         * driver.cs: Make the module extension .netmodule.
9689
9690 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
9691
9692         * driver.cs: Report an error if the resource file is not found
9693         instead of crashing.
9694
9695         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
9696         false, like Emit does.
9697
9698 2002-10-16  Nick Drochak  <ndrochak@gol.com>
9699
9700         * typemanager.cs: Remove unused private member.  Also reported mcs
9701         bug to report this as a warning like csc.
9702
9703 2002-10-15  Martin Baulig  <martin@gnome.org>
9704
9705         * statement.cs (Statement.Emit): Made this a virtual method; emits
9706         the line number info and calls DoEmit().
9707         (Statement.DoEmit): New protected abstract method, formerly knows
9708         as Statement.Emit().
9709
9710         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
9711
9712 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
9713
9714         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
9715         have fixed a remaining problem: not every AddXXXX was adding a
9716         fully qualified name.  
9717
9718         Now everyone registers a fully qualified name in the DeclSpace as
9719         being defined instead of the partial name.  
9720
9721         Downsides: we are slower than we need to be due to the excess
9722         copies and the names being registered this way.  
9723
9724         The reason for this is that we currently depend (on the corlib
9725         bootstrap for instance) that types are fully qualified, because
9726         we dump all the types in the namespace, and we should really have
9727         types inserted into the proper namespace, so we can only store the
9728         basenames in the defined_names array.
9729
9730 2002-10-10  Martin Baulig  <martin@gnome.org>
9731
9732         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
9733         from bug #31834, see the bug report for a testcase which is
9734         miscompiled.
9735
9736 2002-10-10  Martin Baulig  <martin@gnome.org>
9737
9738         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
9739         flow analysis code for this.
9740
9741         * statement.cs (Do, While, For): Tell the flow analysis code about
9742         infinite loops.
9743         (FlowBranching.UsageVector): Added support for infinite loops.
9744         (Block.Resolve): Moved the dead code elimination here and use flow
9745         analysis to do it.
9746
9747 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
9748
9749         * class.cs (Field.Define): Catch cycles on struct type
9750         definitions. 
9751
9752         * typemanager.cs (IsUnmanagedtype): Do not recursively check
9753         fields if the fields are static.  We only need to check instance
9754         fields. 
9755
9756         * expression.cs (As.DoResolve): Test for reference type.
9757
9758         * statement.cs (Using.ResolveExpression): Use
9759         ConvertImplicitRequired, not ConvertImplicit which reports an
9760         error on failture
9761         (Using.ResolveLocalVariableDecls): ditto.
9762
9763         * expression.cs (Binary.ResolveOperator): Report errors in a few
9764         places where we had to.
9765
9766         * typemanager.cs (IsUnmanagedtype): Finish implementation.
9767
9768 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
9769
9770         * expression.cs: Use StoreFromPtr instead of extracting the type
9771         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
9772
9773         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
9774         an enumeration value to a System.Enum, but System.Enum is not a
9775         value type, but an class type, so we need to box.
9776
9777         (Expression.ConvertExplicit): One codepath could return
9778         errors but not flag them.  Fix this.  Fixes #31853
9779
9780         * parameter.cs (Resolve): Do not allow void as a parameter type.
9781
9782 2002-10-06  Martin Baulig  <martin@gnome.org>
9783
9784         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
9785         if it's a class type and not a struct.  Fixes #31815.
9786
9787 2002-10-06  Martin Baulig  <martin@gnome.org>
9788
9789         * statement.cs: Reworked the flow analysis code a bit to make it
9790         usable for dead code elimination.
9791
9792 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9793
9794         * cs-parser.jay: allow empty source files. Fixes bug #31781.
9795
9796 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * expression.cs (ComposedCast.DoResolveType): A quick workaround
9799         to fix the test 165, will investigate deeper.
9800
9801 2002-10-04  Martin Baulig  <martin@gnome.org>
9802
9803         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
9804         finally blocks actually work.
9805         (Try.Resolve): We don't need to create a sibling for `finally' if
9806         there is no finally block.
9807
9808 2002-10-04  Martin Baulig  <martin@gnome.org>
9809
9810         * class.cs (Constructor.Define): The default accessibility for a
9811         non-default constructor is private, not public.
9812
9813 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
9814
9815         * class.cs (Constructor): Make AllowedModifiers public, add
9816         EXTERN.
9817
9818         * cs-parser.jay: Perform the modifiers test here, as the
9819         constructor for the Constructor class usually receives a zero
9820         because of the way we create it (first we create, later we
9821         customize, and we were never checking the modifiers).
9822
9823         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
9824         is a version of LookupTypeReflection that includes the type-name
9825         cache.  This can be used as a fast path for functions that know
9826         the fully qualified name and are only calling into *.GetType() to
9827         obtain a composed type.
9828
9829         This is also used by TypeManager.LookupType during its type
9830         composition.
9831
9832         (LookupType): We now also track the real type name, as sometimes
9833         we can get a quey for the real type name from things like
9834         ComposedCast.  This fixes bug 31422.
9835
9836         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
9837         complete type fullname, it does not have to go through the type
9838         resolution system to obtain the composed version of the type (for
9839         obtaining arrays or pointers).
9840
9841         (Conditional.Emit): Use the EmitBoolExpression to
9842         generate nicer code, as requested by Paolo.
9843
9844         (ArrayCreation.CheckIndices): Use the patch from
9845         hwang_rob@yahoo.ca to validate the array initializers. 
9846
9847 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
9848
9849         * class.cs (ConstructorInitializer.Emit): simplify code by using
9850         Invocation.EmitCall, and at the same time, fix the bugs in calling
9851         parent constructors that took variable arguments. 
9852
9853         * ecore.cs (Expression.ConvertNumericExplicit,
9854         Expression.ImplicitNumericConversion): Remove the code that
9855         manually wrapped decimal (InternalTypeConstructor call is now gone
9856         as well).
9857
9858         * expression.cs (Cast.TryReduce): Also handle decimal types when
9859         trying to perform a constant fold on the type.
9860
9861         * typemanager.cs (IsUnmanagedtype): Partially implemented.
9862
9863         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
9864         that only turned off an error report, and did nothing else. 
9865
9866 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * driver.cs: Handle and ignore /fullpaths
9869
9870 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
9871
9872         * expression.cs (Binary.ResolveOperator): Catch the case where
9873         DoNumericPromotions returns true, 
9874
9875         (Binary.DoNumericPromotions): Simplify the code, and the tests.
9876
9877 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
9878
9879         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
9880         report error 70.
9881
9882 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
9883
9884         * ecore.cs (ConvertNumericExplicit): It is not enough that the
9885         conversion exists, but it is also required that the conversion be
9886         performed.  This manifested in "(Type64Enum) 2".  
9887
9888         * class.cs (TypeManager.AddMethod): The fix is not to change
9889         AddEnum, because that one was using a fully qualified name (every
9890         DeclSpace derivative does), but to change the AddMethod routine
9891         that was using an un-namespaced name.  This now correctly reports
9892         the duplicated name.
9893
9894         Revert patch until I can properly fix it.  The issue
9895         is that we have a shared Type space across all namespaces
9896         currently, which is wrong.
9897
9898         Options include making the Namespace a DeclSpace, and merge
9899         current_namespace/current_container in the parser.
9900
9901 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
9902
9903         * cs-parser.jay: Improve error reporting when we get a different
9904         kind of expression in local_variable_type and
9905         local_variable_pointer_type. 
9906
9907         Propagate this to avoid missleading errors being reported.
9908
9909         * ecore.cs (ImplicitReferenceConversion): treat
9910         TypeManager.value_type as a target just like object_type.   As
9911         code like this:
9912
9913         ValueType v = 1;
9914
9915         Is valid, and needs to result in the int 1 being boxed before it
9916         is assigned to the value type v.
9917
9918         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
9919         to validate the enumeration name.
9920
9921         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
9922         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
9923         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
9924
9925         * ecore.cs (TryImplicitIntConversion): When doing an
9926         implicit-enumeration-conversion, check if the type is 64-bits and
9927         perform a conversion before passing to EnumConstant.
9928
9929 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
9930
9931         * decl.cs (Error_AmbiguousTypeReference); New routine used to
9932         report ambiguous type references.  Unlike the MS version, we
9933         report what the ambiguity is.   Innovation at work ;-)
9934
9935         (DeclSpace.FindType): Require a location argument to
9936         display when we display an ambiguous error.
9937
9938         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
9939
9940         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
9941
9942         * expression.cs (EmitDynamicInitializers): Apply patch from
9943         hwang_rob@yahoo.ca that fixes the order in which we emit our
9944         initializers. 
9945
9946 2002-09-21  Martin Baulig  <martin@gnome.org>
9947
9948         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
9949         delegate takes no arguments.
9950
9951 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
9952
9953         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
9954         from integers.
9955
9956         * expression.cs: Extract the underlying type.
9957
9958         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
9959
9960         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
9961
9962 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
9963
9964         * class.cs (TypeContainer.DefineType): We can not use the nice
9965         PackingSize with the size set to 1 DefineType method, because it
9966         will not allow us to define the interfaces that the struct
9967         implements.
9968
9969         This completes the fixing of bug 27287
9970
9971         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
9972         means also structs.  This fixes part of the problem. 
9973         (Expresion.ImplicitReferenceConversionExists): ditto.
9974
9975         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
9976         error if there were no errors reported during the type lookup
9977         process, to avoid duplicates or redundant errors.  Without this
9978         you would get an ambiguous errors plus a type not found.  We have
9979         beaten the user enough with the first error.  
9980
9981         (DeclSparce.FindType): Emit a warning if we have an ambiguous
9982         reference. 
9983
9984         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
9985         during the resolution process, stop the lookup, this avoids
9986         repeated error reports (same error twice).
9987
9988         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
9989
9990         * typemanager.cs (LookupType): Redo the type lookup code to match
9991         the needs of System.Reflection.  
9992
9993         The issue is that System.Reflection requires references to nested
9994         types to begin with a "+" sign instead of a dot.  So toplevel
9995         types look like: "NameSpace.TopLevelClass", and nested ones look
9996         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
9997         levels. 
9998
9999 2002-09-19  Martin Baulig  <martin@gnome.org>
10000
10001         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10002         says that a method always returns or always throws an exception,
10003         don't report the CS0161.
10004
10005         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10006         set `Returns = new_returns'.
10007
10008 2002-09-19  Martin Baulig  <martin@gnome.org>
10009
10010         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10011         to an enum constant, check for a CS0176.
10012
10013 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10014
10015         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10016         for operators that must be in pairs and report errors.
10017
10018         * ecore.cs (SimpleName.DoResolveType): During the initial type
10019         resolution process, when we define types recursively, we must
10020         check first for types in our current scope before we perform
10021         lookups in the enclosing scopes.
10022
10023         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10024
10025         (Invocation.VerifyArgumentsCompat): Call
10026         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10027         I thought we were supposed to always call this, but there are a
10028         few places in the code where we dont do it.
10029
10030 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * driver.cs: Add support in -linkres and -resource to specify the
10033         name of the identifier.
10034
10035 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10036
10037         * ecore.cs (StandardConversionExists): Sync with the conversion
10038         code: allow anything-* to void* conversions.
10039
10040         (FindMostSpecificSource): Use an Expression argument
10041         instead of a Type, because we might be handed over a Literal which
10042         gets a few more implicit conversions that plain types do not.  So
10043         this information was being lost.
10044
10045         Also, we drop the temporary type-holder expression when not
10046         required.
10047
10048 2002-09-17  Martin Baulig  <martin@gnome.org>
10049
10050         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10051         this is an explicit interface implementation.
10052
10053 2002-09-17  Martin Baulig  <martin@gnome.org>
10054
10055         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10056         different `IndexerName' attributes.
10057
10058         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10059         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10060         virtual CommonResolve().
10061
10062 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10063
10064         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10065         and convert that to the UnderlyingType.
10066
10067         * statement.cs (Foreach.Resolve): Indexers are just like variables
10068         or PropertyAccesses.
10069
10070         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10071         inside quoted strings, we were not doing this before.
10072
10073 2002-09-16  Martin Baulig  <martin@gnome.org>
10074
10075         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10076         resolve it.  This is needed for the definite assignment check of the
10077         instance expression, fixes bug #29846.
10078         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10079
10080 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10081
10082         * parameter.cs: Fix compile error.  Cannot reference static member
10083         from an instance object.  Is this an mcs bug?
10084
10085 2002-09-14  Martin Baulig  <martin@gnome.org>
10086
10087         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10088         multiple times.  Fixes bug #30295, added test-166.cs.
10089
10090 2002-09-14  Martin Baulig  <martin@gnome.org>
10091
10092         * statement.cs (Block.Emit): Don't emit unreachable code.
10093         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10094         `break' statements.
10095         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10096
10097 2002-09-14  Martin Baulig  <martin@gnome.org>
10098
10099         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10100         is set.
10101
10102 2002-09-14  Martin Baulig  <martin@gnome.org>
10103
10104         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10105         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10106         be false on the ms runtime.
10107
10108 2002-09-13  Martin Baulig  <martin@gnome.org>
10109
10110         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10111         the CS0038 error message.
10112
10113 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10114
10115         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10116         constant inside, return it.
10117
10118 2002-09-12  Martin Baulig  <martin@gnome.org>
10119
10120         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10121         implicit conversion can be done between enum types.
10122
10123         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10124         check whether an implicit conversion to the current enum's UnderlyingType
10125         exists and report an error if not.
10126
10127         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10128         without debugging support.
10129
10130         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10131         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10132
10133 2002-09-12  Martin Baulig  <martin@gnome.org>
10134
10135         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10136
10137         * ecore.cs (IMemberExpr.DeclaringType): New property.
10138         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10139         nonstatic member of an outer type (CS0038).
10140
10141 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * driver.cs: Activate the using-error detector at warning level
10144         4 (at least for MS-compatible APIs).
10145
10146         * namespace.cs (VerifyUsing): Small buglett fix.
10147
10148         * pending.cs (PendingImplementation): pass the container pointer. 
10149
10150         * interface.cs (GetMethods): Allow for recursive definition.  Long
10151         term, I would like to move every type to support recursive
10152         definitions, not the current ordering mechanism that we have right
10153         now.
10154
10155         The situation is this: Attributes are handled before interfaces,
10156         so we can apply attributes to interfaces.  But some attributes
10157         implement interfaces, we will now handle the simple cases
10158         (recursive definitions will just get an error).  
10159
10160         * parameter.cs: Only invalidate types at the end if we fail to
10161         lookup all types.  
10162
10163 2002-09-09  Martin Baulig  <martin@gnome.org>
10164
10165         * ecore.cs (PropertyExpr.Emit): Also check for
10166         TypeManager.system_int_array_get_length so this'll also work when
10167         compiling corlib.  Fixes #30003.
10168
10169 2002-09-09  Martin Baulig  <martin@gnome.org>
10170
10171         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10172         and throw an exception if we can't get the type's size.  Fixed #30040,
10173         added test-165.cs.
10174
10175 2002-09-09  Martin Baulig  <martin@gnome.org>
10176
10177         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10178
10179         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10180         context.  Fixes bug #30027.
10181
10182         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10183         virtual functions.  Fixes bug #30043, added test-164.cs.
10184
10185 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10186
10187         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10188
10189 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10190
10191         * driver.cs: Use an object to get the windows codepage since it's not a
10192         static property.
10193
10194 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10195
10196         * statement.cs (For.Emit): for infinite loops (test == null)
10197         return whether there is a break inside, not always "true".
10198
10199         * namespace.cs (UsingEntry): New struct to hold the name of the
10200         using definition, the location where it is defined, and whether it
10201         has been used in a successful type lookup.
10202
10203         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10204         strings.
10205
10206         * decl.cs: ditto.
10207
10208 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10209
10210         * attribute.cs : Fix incorrect code which relied on catching
10211         a NullReferenceException to detect a null being passed in
10212         where an object was expected.
10213
10214 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * statement.cs (Try): flag the catch variable as assigned
10217
10218         * expression.cs (Cast): Simplified by using ResolveType instead of
10219         manually resolving.
10220
10221         * statement.cs (Catch): Fix bug by using ResolveType.
10222
10223 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10224
10225         * expression.cs (BetterConversion): Special case for when we have
10226         a NullLiteral as the argument and we have to choose between string
10227         and object types - we choose string the way csc does.
10228
10229         * attribute.cs (Attribute.Resolve): Catch the
10230         NullReferenceException and report error #182 since the Mono
10231         runtime no more has the bug and having this exception raised means
10232         we tried to select a constructor which takes an object and is
10233         passed a null.
10234
10235 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10236
10237         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10238         message (1502, 1503) when we can't locate a method after overload
10239         resolution. This is much more informative and closes the bug
10240         Miguel reported.
10241
10242         * interface.cs (PopulateMethod): Return if there are no argument
10243         types. Fixes a NullReferenceException bug.
10244
10245         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10246         expressions too. Previously we were checking only in one place for
10247         positional arguments leaving out named arguments.
10248
10249         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10250         type to the enum type is not allowed. Remove code corresponding to
10251         that.
10252
10253         (ConvertNumericExplicit): Allow explicit conversions from
10254         the underlying type to enum type. This precisely follows the spec
10255         and closes a bug filed by Gonzalo.
10256
10257 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10258
10259         * compiler.csproj:
10260         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10261
10262 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10265         it was important that we stored the right value after the
10266         reduction in `converted'.
10267
10268 2002-09-04  Martin Baulig  <martin@gnome.org>
10269
10270         * location.cs (Location.SymbolDocument): Use full pathnames for the
10271         source files.
10272
10273 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10274
10275         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10276         of the expression resolve mechanism, because that will catch the
10277         SimpleName error failures.
10278
10279         (Conditional): If we can not resolve the
10280         expression, return, do not crash.
10281
10282 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10283
10284         * cs-tokenizer.cs:
10285         (location): display token name instead of its number.
10286
10287 2002-08-28  Martin Baulig  <martin@gnome.org>
10288
10289         * expression.cs (Binary.ResolveOperator): Don't silently return
10290         but return an error if an operator cannot be applied between two
10291         enum types.
10292
10293 2002-08-28  Martin Baulig  <martin@gnome.org>
10294
10295         * class.cs (Constructor.Define): Set the permission attributes
10296         correctly instead of making all constructors public.
10297
10298 2002-08-28  Martin Baulig  <martin@gnome.org>
10299
10300         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10301         for private members before reporting a CS0103; if we find anything,
10302         it's a CS0122.
10303
10304 2002-08-28  Martin Baulig  <martin@gnome.org>
10305
10306         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10307         to check whether `closure_start_type == closure_invocation_type',
10308         we also need to check whether `m.DeclaringType == closure_invocation_type'
10309         before bypassing the permission checks.  We might be accessing
10310         protected/private members from the base class.
10311         (TypeManager.RealMemberLookup): Only set private_ok if private
10312         members were requested via BindingFlags.NonPublic.
10313
10314         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10315
10316         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10317         MethodGroupExpr.IsExplicitImpl if appropriate.
10318         (Invocation.DoResolve): Don't report the CS0120 for explicit
10319         interface implementations.
10320
10321 2002-08-27  Martin Baulig  <martin@gnome.org>
10322
10323         * expression.cs (Invocation.DoResolve): If this is a static
10324         method and we don't have an InstanceExpression, we must report
10325         a CS0120.
10326
10327 2002-08-25  Martin Baulig  <martin@gnome.org>
10328
10329         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10330         `==' between a valuetype and an object.
10331
10332 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10333
10334         * ecore.cs (TypeExpr): Provide a ToString method.
10335
10336 2002-08-24  Martin Baulig  <martin@gnome.org>
10337
10338         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10339         now called proggie.dbg and it's a binary file.
10340
10341 2002-08-23  Martin Baulig  <martin@gnome.org>
10342
10343         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10344
10345 2002-08-23  Martin Baulig  <martin@gnome.org>
10346
10347         * struct.cs (MyStructInfo.ctor): Make this work with empty
10348         structs; it's not allowed to use foreach() on null.
10349
10350 2002-08-23  Martin Baulig  <martin@gnome.org>
10351
10352         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10353         writer the full pathname of the generated assembly.
10354
10355 2002-08-23  Martin Baulig  <martin@gnome.org>
10356
10357         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10358         A `finally' block never returns or breaks; improved handling of
10359         unreachable code.
10360
10361 2002-08-23  Martin Baulig  <martin@gnome.org>
10362
10363         * statement.cs (Throw.Resolve): Allow `throw null'.
10364
10365 2002-08-23  Martin Baulig  <martin@gnome.org>
10366
10367         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10368         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10369         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10370         MemberLookup would return a wrong event if this is an explicit
10371         interface implementation and the class has an event with the same
10372         name.
10373
10374 2002-08-23  Martin Baulig  <martin@gnome.org>
10375
10376         * statement.cs (Block.AddChildVariableNames): New public method.
10377         (Block.AddChildVariableName): Likewise.
10378         (Block.IsVariableNameUsedInChildBlock): Likewise.
10379         (Block.AddVariable): Check whether a variable name has already
10380         been used in a child block.
10381
10382         * cs-parser.jay (declare_local_variables): Mark all variable names
10383         from the current block as being used in a child block in the
10384         implicit block.
10385
10386 2002-08-23  Martin Baulig  <martin@gnome.org>
10387
10388         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10389         find the symbol writer.
10390
10391         * driver.cs: csc also allows the arguments to /define being
10392         separated by commas, not only by semicolons.
10393
10394 2002-08-23  Martin Baulig  <martin@gnome.org>
10395
10396         * interface.cs (Interface.GetMembers): Added static check for events.
10397
10398 2002-08-15  Martin Baulig  <martin@gnome.org>
10399
10400         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10401         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10402
10403         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10404         why the MethodData.EmitDestructor() change was necessary.
10405
10406 2002-08-20  Martin Baulig  <martin@gnome.org>
10407
10408         * class.cs (TypeContainer.FindMembers): Added static check for events.
10409
10410         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10411
10412         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10413         use Type.GetEvents(), not Type.FindMembers().
10414
10415 2002-08-20  Martin Baulig  <martin@gnome.org>
10416
10417         * decl.cs (MemberCache): Added a special method cache which will
10418         be used for method-only searched.  This ensures that a method
10419         search will return a MethodInfo with the correct ReflectedType for
10420         inherited methods.      
10421
10422 2002-08-20  Martin Baulig  <martin@gnome.org>
10423
10424         * decl.cs (DeclSpace.FindMembers): Made this public.
10425
10426 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10427
10428         * delegate.cs: fixed build on windows.
10429         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10430
10431 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10432
10433         * ecore.cs (StandardConversionExists): Return a false
10434         if we are trying to convert the void type to anything else
10435         since that is not allowed.
10436
10437         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10438         we flag error 70 in the event an event is trying to be accessed
10439         directly from outside the declaring type.
10440
10441 2002-08-20  Martin Baulig  <martin@gnome.org>
10442
10443         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10444         MemberCache from typemanager.cs to decl.cs.
10445
10446 2002-08-19  Martin Baulig  <martin@gnome.org>
10447
10448         * class.cs (TypeContainer): Implement IMemberContainer.
10449         (TypeContainer.DefineMembers): Create the MemberCache.
10450         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10451         return public members if BindingFlags.Public was given, check
10452         whether members are static.
10453
10454 2002-08-16  Martin Baulig  <martin@gnome.org>
10455
10456         * decl.cs (DeclSpace.Define): Splitted this in Define and
10457         DefineMembers.  DefineMembers is called first and initializes the
10458         MemberCache.
10459
10460         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10461         DefineMembers() on all our DeclSpaces.
10462
10463         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10464         but call DefineMembers() on all nested interfaces.  We call their
10465         Define() in our new Define() function.
10466
10467         * interface.cs (Interface): Implement IMemberContainer.
10468         (Interface.Define): Moved all code except the attribute stuf to
10469         DefineMembers().
10470         (Interface.DefineMembers): Initialize the member cache.
10471
10472         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10473         need this anymore since we can use MemberCache.FindMembers directly.
10474
10475 2002-08-19  Martin Baulig  <martin@gnome.org>
10476
10477         * typemanager.cs (MemberCache): When creating the cache for an
10478         interface type, add all inherited members.
10479         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10480         to `out bool used_cache' and documented it.
10481         (TypeManager.MemberLookup): If we already used the cache in the first
10482         iteration, we don't need to do the interfaces check.
10483
10484 2002-08-19  Martin Baulig  <martin@gnome.org>
10485
10486         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10487         here from IMemberFinder and don't implement this interface anymore.
10488         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10489
10490         * typemanager.cs (IMemberFinder): This interface is now only used by
10491         classes which actually support the member cache.
10492         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10493         since we only put DeclSpaces into this Hashtable.
10494         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10495         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10496
10497 2002-08-16  Martin Baulig  <martin@gnome.org>
10498
10499         * typemanager.cs (ICachingMemberFinder): Removed.
10500         (IMemberFinder.MemberCache): New property.
10501         (TypeManager.FindMembers): Merged this with RealFindMembers().
10502         This function will never be called from TypeManager.MemberLookup()
10503         so we can't use the cache here, just the IMemberFinder.
10504         (TypeManager.MemberLookup_FindMembers): Check whether the
10505         IMemberFinder has a MemberCache and call the cache's FindMembers
10506         function.
10507         (MemberCache): Rewrote larger parts of this yet another time and
10508         cleaned it up a bit.
10509
10510 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * driver.cs (LoadArgs): Support quoting.
10513
10514         (Usage): Show the CSC-like command line arguments.
10515
10516         Improved a few error messages.
10517
10518 2002-08-15  Martin Baulig  <martin@gnome.org>
10519
10520         * typemanager.cs (IMemberContainer.Type): New property.
10521         (IMemberContainer.IsInterface): New property.
10522
10523         The following changes are conditional to BROKEN_RUNTIME, which is
10524         defined at the top of the file.
10525
10526         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10527         class'es members, but add all members from TypeHandle.ObjectType
10528         if we're an interface.
10529         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10530         is the current type.
10531         (MemberCache.CacheEntry.Container): Removed this field.
10532         (TypeHandle.GetMembers): Include inherited members.
10533
10534 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10535
10536         * typemanager.cs: fixed compilation and added a comment on a field that
10537         is never used.
10538
10539 2002-08-15  Martin Baulig  <martin@gnome.org>
10540
10541         * class.cs (ConstructorInitializer.Resolve): In the
10542         Expression.MemberLookup call, use the queried_type as
10543         invocation_type.
10544
10545         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10546         declared' attribute, it's always true.
10547         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10548         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10549         temporary wrapper for FindMembers which tells MemberLookup whether
10550         members from the base classes are included in the return value.
10551         This will go away soon.
10552         (TypeManager.MemberLookup): Use this temporary hack here; once the
10553         new MemberCache is completed, we don't need to do the DeclaredOnly
10554         looping here anymore since the MemberCache will take care of this.
10555         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10556         (MemberCache): When creating the MemberCache for a class, get
10557         members from the current class and all its base classes.
10558         (MemberCache.CacheEntry.Container): New field.  This is a
10559         temporary hack until the Mono runtime is fixed to distinguish
10560         between ReflectedType and DeclaringType.  It allows us to use MCS
10561         with both the MS runtime and the unfixed Mono runtime without
10562         problems and without accecting performance.
10563         (MemberCache.SearchMembers): The DeclaredOnly looping from
10564         TypeManager.MemberLookup is now done here.      
10565
10566 2002-08-14  Martin Baulig  <martin@gnome.org>
10567
10568         * statement.cs (MyStructInfo.MyStructInfo): Don't call
10569         Type.GetFields on dynamic types but get the fields from the
10570         corresponding TypeContainer.
10571         (MyStructInfo.GetStructInfo): Added check for enum types.
10572
10573         * typemanager.cs (MemberList.IsSynchronized): Implemented.
10574         (MemberList.SyncRoot): Implemented.
10575         (TypeManager.FilterWithClosure): No need to check permissions if
10576         closure_start_type == closure_invocation_type, don't crash if
10577         closure_invocation_type is null.
10578
10579 2002-08-13  Martin Baulig  <martin@gnome.org>
10580
10581         Rewrote TypeContainer.FindMembers to use a member cache.  This
10582         gives us a speed increase of about 35% for the self-hosting MCS
10583         build and of about 15-20% for the class libs (both on GNU/Linux).
10584
10585         * report.cs (Timer): New class to get enhanced profiling.  This
10586         whole class is "TIMER" conditional since it remarkably slows down
10587         compilation speed.
10588
10589         * class.cs (MemberList): New class.  This is an IList wrapper
10590         which we're now using instead of passing MemberInfo[]'s around to
10591         avoid copying this array unnecessarily.
10592         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
10593         (ICachingMemberFinder, IMemberContainer): New interface.
10594         (TypeManager.FilterWithClosure): If `criteria' is null, the name
10595         has already been checked, otherwise use it for the name comparision.
10596         (TypeManager.FindMembers): Renamed to RealMemberFinder and
10597         provided wrapper which tries to use ICachingMemberFinder.FindMembers
10598         if possible.  Returns a MemberList, not a MemberInfo [].
10599         (TypeHandle): New class, implements IMemberContainer.  We create
10600         one instance of this class per type, it contains a MemberCache
10601         which is used to do the member lookups.
10602         (MemberCache): New class.  Each instance of this class contains
10603         all members of a type and a name-based hash table.
10604         (MemberCache.FindMembers): This is our new member lookup
10605         function.  First, it looks up all members of the requested name in
10606         the hash table.  Then, it walks this list and sorts out all
10607         applicable members and returns them.
10608
10609 2002-08-13  Martin Baulig  <martin@gnome.org>
10610
10611         In addition to a nice code cleanup, this gives us a performance
10612         increase of about 1.4% on GNU/Linux - not much, but it's already
10613         half a second for the self-hosting MCS compilation.
10614
10615         * typemanager.cs (IMemberFinder): New interface.  It is used by
10616         TypeManager.FindMembers to call FindMembers on a TypeContainer,
10617         Enum, Delegate or Interface.
10618         (TypeManager.finder_to_member_finder): New PtrHashtable.
10619         (TypeManager.finder_to_container): Removed.
10620         (TypeManager.finder_to_delegate): Removed.
10621         (TypeManager.finder_to_interface): Removed.
10622         (TypeManager.finder_to_enum): Removed.
10623
10624         * interface.cs (Interface): Implement IMemberFinder.
10625
10626         * delegate.cs (Delegate): Implement IMemberFinder.
10627
10628         * enum.cs (Enum): Implement IMemberFinder.
10629
10630         * class.cs (TypeContainer): Implement IMemberFinder.
10631
10632 2002-08-12  Martin Baulig  <martin@gnome.org>
10633
10634         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
10635
10636 2002-08-12  Martin Baulig  <martin@gnome.org>
10637
10638         * ecore.cs (ITypeExpression): New interface for expressions which
10639         resolve to a type.
10640         (TypeExpression): Renamed to TypeLookupExpression.
10641         (Expression.DoResolve): If we're doing a types-only lookup, the
10642         expression must implement the ITypeExpression interface and we
10643         call DoResolveType() on it.
10644         (SimpleName): Implement the new ITypeExpression interface.
10645         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
10646         hack, the situation that we're only looking up types can't happen
10647         anymore when this method is called.  Moved the type lookup code to
10648         DoResolveType() and call it.
10649         (SimpleName.DoResolveType): This ITypeExpression interface method
10650         is now doing the types-only lookup.
10651         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
10652         (ResolveFlags): Added MaskExprClass.
10653
10654         * expression.cs (MemberAccess): Implement the ITypeExpression
10655         interface.
10656         (MemberAccess.DoResolve): Added support for a types-only lookup
10657         when we're called via ITypeExpression.DoResolveType().
10658         (ComposedCast): Implement the ITypeExpression interface.
10659
10660         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
10661         Expression.Resolve() with ResolveFlags.Type instead.
10662
10663 2002-08-12  Martin Baulig  <martin@gnome.org>
10664
10665         * interface.cs (Interface.Define): Apply attributes.
10666
10667         * attribute.cs (Attribute.ApplyAttributes): Added support for
10668         interface attributes.
10669
10670 2002-08-11  Martin Baulig  <martin@gnome.org>
10671
10672         * statement.cs (Block.Emit): Only check the "this" variable if we
10673         do not always throw an exception.
10674
10675         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
10676         whether the property has a set accessor.
10677
10678 2002-08-11  Martin Baulig  <martin@gnome.org>
10679
10680         Added control flow analysis support for structs.
10681
10682         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
10683         with control flow analysis turned off.
10684         (IVariable): New interface.
10685         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
10686         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
10687         (FieldExpr.DoResolve): Resolve the instance expression with flow
10688         analysis turned off and do the definite assignment check after the
10689         resolving when we know what the expression will resolve to.
10690
10691         * expression.cs (LocalVariableReference, ParameterReference):
10692         Implement the new IVariable interface, only call the flow analysis
10693         code if ec.DoFlowAnalysis is true.
10694         (This): Added constructor which takes a Block argument.  Implement
10695         the new IVariable interface.
10696         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
10697         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
10698         This does the definite assignment checks for struct members.
10699
10700         * class.cs (Constructor.Emit): If this is a non-static `struct'
10701         constructor which doesn't have any initializer, call
10702         Block.AddThisVariable() to tell the flow analysis code that all
10703         struct elements must be initialized before control returns from
10704         the constructor.
10705
10706         * statement.cs (MyStructInfo): New public class.
10707         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
10708         argument to this indexer.  If non-zero, check an individual struct
10709         member, not the whole struct.
10710         (FlowBranching.CheckOutParameters): Check struct members.
10711         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
10712         overloaded versions of these methods which take an additional
10713         `int field_idx' argument to check struct members.
10714         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
10715         overloaded versions of these methods which take an additional
10716         `string field_name' argument to check struct member.s
10717         (VariableInfo): Implement the IVariable interface.
10718         (VariableInfo.StructInfo): New public property.  Returns the
10719         MyStructInfo instance of the variable if it's a struct or null.
10720         (Block.AddThisVariable): New public method.  This is called from
10721         Constructor.Emit() for non-static `struct' constructor which do
10722         not have any initializer.  It creates a special variable for the
10723         "this" instance variable which will be checked by the flow
10724         analysis code to ensure that all of the struct's fields are
10725         initialized before control returns from the constructor.
10726         (UsageVector): Added support for struct members.  If a
10727         variable/parameter is a struct with N members, we reserve a slot
10728         in the usage vector for each member.  A struct is considered fully
10729         initialized if either the struct itself (slot 0) or all its
10730         members are initialized.
10731
10732 2002-08-08  Martin Baulig  <martin@gnome.org>
10733
10734         * driver.cs (Driver.MainDriver): Only report an error CS5001
10735         if there were no compilation errors.
10736
10737         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
10738         `UnsafeContext' property to determine whether the parent is in
10739         unsafe context rather than checking the parent's ModFlags:
10740         classes nested in an unsafe class are unsafe as well.
10741
10742 2002-08-08  Martin Baulig  <martin@gnome.org>
10743
10744         * statement.cs (UsageVector.MergeChildren): Distinguish between
10745         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
10746         we return.  Added test17() and test18() to test-154.cs.
10747
10748 2002-08-08  Martin Baulig  <martin@gnome.org>
10749
10750         * typemanager.cs (TypeManager.FilterWithClosure): If we have
10751         Family access, make sure the invoking type isn't a subclass of the
10752         queried type (that'd be a CS1540).
10753
10754         * ecore.cs (Expression.MemberLookup): Added overloaded version of
10755         this method which takes an additional `Type invocation_type'.
10756
10757         * expression.cs (BaseAccess.DoResolve): Use the base type as
10758         invocation and query type.
10759         (MemberAccess.DoResolve): If the lookup failed and we're about to
10760         report a CS0122, try a lookup with the ec.ContainerType - if this
10761         succeeds, we must report a CS1540.
10762
10763 2002-08-08  Martin Baulig  <martin@gnome.org>
10764
10765         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
10766         (MethodGroupExpr): Implement the IMemberExpr interface.
10767
10768         * expression (MemberAccess.ResolveMemberAccess): No need to have
10769         any special code for MethodGroupExprs anymore, they're now
10770         IMemberExprs.   
10771
10772 2002-08-08  Martin Baulig  <martin@gnome.org>
10773
10774         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
10775         Family, FamANDAssem and FamORAssem permissions.
10776         (TypeManager.IsSubclassOrNestedChildOf): New public method.
10777
10778 2002-08-08  Martin Baulig  <martin@gnome.org>
10779
10780         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
10781         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
10782         or loop block.
10783
10784 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
10785
10786         * driver.cs: implemented /resource option to embed managed resources.
10787
10788 2002-08-07  Martin Baulig  <martin@gnome.org>
10789
10790         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
10791         (FieldBase.HasFieldInitializer): New public property.
10792         (FieldBase.GetInitializerExpression): New public method.  Resolves and
10793         returns the field initializer and makes sure it is only resolved once.
10794         (TypeContainer.EmitFieldInitializers): Call
10795         FieldBase.GetInitializerExpression to get the initializer, this ensures
10796         that it isn't resolved multiple times.
10797
10798         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
10799         the resolving process (SimpleName/MemberLookup) that we're currently
10800         emitting a field initializer (which must not access any instance members,
10801         this is an error CS0236).
10802
10803         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
10804         argument, if the `IsFieldInitializer' flag is set, we must report and
10805         error CS0236 and not an error CS0120.   
10806
10807 2002-08-07  Martin Baulig  <martin@gnome.org>
10808
10809         * ecore.cs (IMemberExpr): New public interface.
10810         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
10811         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
10812         if the expression is an IMemberExpr.
10813
10814         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
10815         to be null, implicitly default to `this' if we're non-static in
10816         this case.  Simplified the code a lot by using the new IMemberExpr
10817         interface.  Also fixed bug #28176 here.
10818
10819 2002-08-06  Martin Baulig  <martin@gnome.org>
10820
10821         * cs-parser.jay (SimpleLookup): Removed.  We need to create
10822         ParameterReferences during semantic analysis so that we can do a
10823         type-only search when resolving Cast, TypeOf and SizeOf.
10824         (block): Pass the `current_local_parameters' to the Block's
10825         constructor.
10826
10827         * class.cs (ConstructorInitializer): Added `Parameters parameters'
10828         argument to the constructor.
10829         (ConstructorInitializer.Resolve): Create a temporary implicit
10830         block with the parameters.
10831
10832         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
10833         references here if we aren't doing a type-only search.
10834
10835         * statement.cs (Block): Added constructor which takes a
10836         `Parameters parameters' argument.
10837         (Block.Parameters): New public property.
10838
10839         * support.cs (InternalParameters.Parameters): Renamed `parameters'
10840         to `Parameters' and made it public readonly.
10841
10842 2002-08-06  Martin Baulig  <martin@gnome.org>
10843
10844         * ecore.cs (Expression.Warning): Made this public as well.
10845
10846         * report.cs (Report.Debug): Print the contents of collections.
10847
10848 2002-08-06  Martin Baulig  <martin@gnome.org>
10849
10850         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
10851         used to tell Resolve() which kinds of expressions it may return.
10852         (Expression.Resolve): Added overloaded version of this method which
10853         takes a `ResolveFlags flags' argument.  This can be used to tell
10854         Resolve() which kinds of expressions it may return.  Reports a
10855         CS0118 on error.
10856         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
10857         ResolveFlags.SimpleName.
10858         (Expression.Error118): Added overloaded version of this method which
10859         takes a `ResolveFlags flags' argument.  It uses the flags to determine
10860         which kinds of expressions are allowed.
10861
10862         * expression.cs (Argument.ResolveMethodGroup): New public method.
10863         Resolves an argument, but allows a MethodGroup to be returned.
10864         This is used when invoking a delegate.
10865
10866         * TODO: Updated a bit.
10867
10868 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10869
10870         Fixed compilation with csc.
10871
10872         * ecore.cs: Expression.Error made public. Is this correct? Should
10873         Warning be made public too?
10874
10875         * expression.cs: use ea.Location instead of ea.loc.
10876         [FIXME:  Filed as bug #28607: MCS must report these errors.]
10877
10878 2002-08-06  Martin Baulig  <martin@gnome.org>
10879
10880         * ecore.cs (Expression.loc): Moved the location here instead of
10881         duplicating it in all derived classes.
10882         (Expression.Location): New public property.
10883         (Expression.Error, Expression.Warning): Made them non-static and
10884         removed the location argument.
10885         (Expression.Warning): Added overloaded version which takes an
10886         `int level' argument.
10887         (Expression.Error118): Make this non-static and removed the
10888         expression and location arguments.
10889         (TypeExpr): Added location argument to the constructor.
10890
10891         * expression.cs (StaticCallExpr): Added location argument to
10892         the constructor.
10893         (Indirection, PointerArithmetic): Likewise.
10894         (CheckedExpr, UnCheckedExpr): Likewise.
10895         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
10896         (StringPtr): Likewise.
10897
10898
10899 2002-08-05  Martin Baulig  <martin@gnome.org>
10900
10901         * expression.cs (BaseAccess.DoResolve): Actually report errors.
10902
10903         * assign.cs (Assign.DoResolve): Check whether the source
10904         expression is a value or variable.
10905
10906         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
10907         while resolving the corresponding blocks.
10908
10909         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
10910         an error, don't silently return null.
10911
10912         * statement.cs (Block.AddVariable): Do the error reporting here
10913         and distinguish between CS0128 and CS0136.
10914         (Block.DoResolve): Report all unused labels (warning CS0164).
10915         (LabeledStatement): Pass the location to the constructor.
10916         (LabeledStatement.HasBeenReferenced): New property.
10917         (LabeledStatement.Resolve): Set it to true here.
10918
10919         * statement.cs (Return.Emit): Return success even after reporting
10920         a type mismatch error (CS0126 or CS0127), this is what csc does and
10921         it avoids confusing the users with any consecutive errors.
10922
10923 2002-08-05  Martin Baulig  <martin@gnome.org>
10924
10925         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
10926
10927         * const.cs (Const.LookupConstantValue): Catch circular definitions.
10928
10929         * expression.cs (MemberAccess.DoResolve): Silently return if an
10930         error has already been reported.
10931
10932         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
10933         error has already been reported.
10934
10935 2002-08-05  Martin Baulig  <martin@gnome.org>
10936
10937         * statement.cs (UsageVector): Only initialize the `parameters'
10938         vector if we actually have any "out" parameters.
10939
10940 2002-08-05  Martin Baulig  <martin@gnome.org>
10941
10942         * expression.cs (Binary.ResolveOperator): When combining delegates,
10943         they must have the same type.
10944
10945 2002-08-05  Martin Baulig  <martin@gnome.org>
10946
10947         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
10948         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
10949         work with the ms runtime and we also don't need it: if we're a
10950         PropertyBuilder and not in the `indexer_arguments' hash, then we
10951         are a property and not an indexer.
10952
10953         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
10954         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
10955         since the latter one doesn't work with the ms runtime.
10956
10957 2002-08-03  Martin Baulig  <martin@gnome.org>
10958
10959         Fixed bugs #27998 and #22735.
10960
10961         * class.cs (Method.IsOperator): New public field.
10962         (Method.CheckBase): Report CS0111 if there's already a method
10963         with the same parameters in the current class.  Report CS0508 when
10964         attempting to change the return type of an inherited method.
10965         (MethodData.Emit): Report CS0179 if a method doesn't have a body
10966         and it's not marked abstract or extern.
10967         (PropertyBase): New abstract base class for Property and Indexer.
10968         (PropertyBase.CheckBase): Moved here from Property and made it work
10969         for indexers.
10970         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
10971         the same so we can reuse it there.
10972         (Property, Indexer): Derive from PropertyBase.
10973         (MethodSignature.inheritable_property_signature_filter): New delegate
10974         to find properties and indexers.
10975
10976         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
10977         argument and improved error reporting.
10978
10979         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
10980         EmptyReadOnlyParameters and made it a property.
10981
10982         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
10983         version of this method which takes a `PropertyInfo indexer'.
10984         (TypeManager.RegisterIndexer): New method.
10985
10986         * class.cs: Added myself as author of this file :-)
10987
10988 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10989
10990         * class.cs: fixed compilation on windoze.
10991
10992 2002-08-03  Martin Baulig  <martin@gnome.org>
10993
10994         * interface.cs (Interface.GetInterfaceBases): Check whether all
10995         base interfaces are at least as accessible than the current one.
10996
10997         * class.cs (TypeContainer.GetClassBases): Check whether base types
10998         are at least as accessible than the current type.
10999         (TypeContainer.AsAccessible): Implemented and made non-static.
11000         (MemberBase.CheckParameters): Report errors if the accessibility
11001         checks fail.
11002
11003         * delegate.cs (Delegate.Delegate): The default visibility is
11004         internal for top-level types and private for nested types.
11005         (Delegate.Define): Report errors if the accessibility checks fail.
11006
11007         * enum.cs (Enum.Enum): The default visibility is internal for
11008         top-level types and private for nested types.
11009         (Enum.DefineType): Compute the correct visibility.
11010
11011         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11012         function which takes a `bool is_toplevel' instead of a TypeContainer.
11013
11014         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11015         builtin type.
11016
11017 2002-08-02  Martin Baulig  <martin@gnome.org>
11018
11019         * expression.cs (LocalVariableReferenc): Added constructor which
11020         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11021         (LocalVariableReference.IsReadOnly): New property.
11022         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11023         variable is readonly, use our own readonly flag to do this; you can
11024         use the new constructor to get a writable reference to a read-only
11025         variable.
11026
11027         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11028         reference to the local variable.
11029
11030 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11031
11032         * rootcontext.cs (ResolveCore): Also include System.Exception
11033
11034         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11035         we reach an EmptyStatement.
11036
11037         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11038         is also fine.
11039
11040         * expression.cs (Binary.ResolveOperator): Check error result in
11041         two places.
11042
11043         use brtrue/brfalse directly and avoid compares to null.
11044
11045 2002-08-02  Martin Baulig  <martin@gnome.org>
11046
11047         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11048         Fixes bug #28407, added test-155.cs.
11049
11050 2002-08-01  Martin Baulig  <martin@gnome.org>
11051
11052         * class.cs (Event.EmitDefaultMethod): Make this work with static
11053         events.  Fixes #28311, added verify-3.cs.
11054
11055 2002-08-01  Martin Baulig  <martin@gnome.org>
11056
11057         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11058         `is_disposable' fields.
11059         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11060         `hm.is_disposable' if we're using the collection pattern.
11061         (Foreach.EmitCollectionForeach): Use the correct type for the
11062         enumerator's local variable, only emit the try/finally block if
11063         necessary (fixes #27713).
11064
11065 2002-08-01  Martin Baulig  <martin@gnome.org>
11066
11067         * ecore.cs (Expression.report118): Renamed to Error118 and made
11068         it public static.
11069
11070         * statement.cs (Throw.Resolve): Check whether the expression is of
11071         the correct type (CS0118) and whether the type derives from
11072         System.Exception (CS0155).
11073         (Catch.Resolve): New method.  Do the type lookup here and check
11074         whether it derives from System.Exception (CS0155).
11075         (Catch.CatchType, Catch.IsGeneral): New public properties.
11076
11077         * typemanager.cs (TypeManager.exception_type): Added.
11078
11079 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * driver.cs: Updated About function.
11082
11083 2002-07-31  Martin Baulig  <martin@gnome.org>
11084
11085         Implemented Control Flow Analysis.
11086
11087         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11088         (EmitContext.CurrentBranching): Added.
11089         (EmitContext.StartFlowBranching): Added.
11090         (EmitContext.EndFlowBranching): Added.
11091         (EmitContext.KillFlowBranching): Added.
11092         (EmitContext.IsVariableAssigned): Added.
11093         (EmitContext.SetVariableAssigned): Added.
11094         (EmitContext.IsParameterAssigned): Added.
11095         (EmitContext.SetParameterAssigned): Added.
11096         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11097         Added control flow analysis stuff here.
11098
11099         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11100         resolve the expression as lvalue.
11101         (LocalVariableReference.DoResolve): Check whether the variable has
11102         already been assigned.
11103         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11104         the parameter as assigned here.
11105         (ParameterReference.DoResolve): Check whether the parameter has already
11106         been assigned.
11107         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11108         expression as lvalue.
11109
11110         * statement.cs (FlowBranching): New class for the flow analysis code.
11111         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11112         (LabeledStatement.IsDefined): New public property.
11113         (LabeledStatement.AddUsageVector): New public method to tell flow
11114         analyis that the label may be reached via a forward jump.
11115         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11116         flow analysis.
11117         (VariableInfo.Number): New public field.  This is used by flow analysis
11118         to number all locals of a block.
11119         (Block.CountVariables): New public property.  This is the number of
11120         local variables in this block (including the locals from all parent
11121         blocks).
11122         (Block.EmitMeta): Number all the variables.
11123
11124         * statement.cs: Added flow analysis support to all classes.
11125
11126 2002-07-31  Martin Baulig  <martin@gnome.org>
11127
11128         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11129         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11130         then use this argument.
11131
11132         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11133
11134         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11135         use this to specify /define options.
11136
11137 2002-07-29  Martin Baulig  <martin@gnome.org>
11138
11139         * statement.cs (Fixed): Moved all code that does variable lookups
11140         and resolvings from Emit to Resolve.
11141
11142         * statement.cs (For): Moved all code that does variable lookups
11143         and resolvings from Emit to Resolve.
11144
11145         * statement.cs (Using): Moved all code that does variable lookups
11146         and resolvings from Emit to Resolve.
11147
11148 2002-07-29  Martin Baulig  <martin@gnome.org>
11149
11150         * attribute.cs (Attribute.Resolve): Explicitly catch a
11151         System.NullReferenceException when creating the
11152         CustromAttributeBuilder and report a different warning message.
11153
11154 2002-07-29  Martin Baulig  <martin@gnome.org>
11155
11156         * support.cs (ParameterData.ParameterName): Added method to
11157         get the name of a parameter.
11158
11159         * typemanager.cs (TypeManager.IsValueType): New public method.
11160
11161 2002-07-29  Martin Baulig  <martin@gnome.org>
11162
11163         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11164         is a flag which specifies that it's either ref or out.
11165         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11166         the out parameter to `out Parameter.Modifier mod', also set the
11167         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11168
11169         * support.cs (InternalParameters.ParameterModifier): Distinguish
11170         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11171         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11172
11173         * expression.cs (Argument.GetParameterModifier): Distinguish
11174         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11175         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11176
11177 2002-07-29  Martin Baulig  <martin@gnome.org>
11178
11179         * expression.cs (ParameterReference.ParameterReference): Added
11180         `Location loc' argument to the constructor.
11181
11182         * cs-parser.jay: Pass location to ParameterReference.
11183
11184 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * statement.cs (Try): Initialize the location.
11187
11188         * cs-parser.jay: pass location to Try.
11189
11190         * expression.cs (Unary.Reduce): Change the prototype to return
11191         whether a constant fold could be performed or not.  The result is
11192         returned in an out parameters.  In the case of Indirection and
11193         AddressOf, we want to perform the full tests.
11194
11195 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11196
11197         * statement.cs (Statement.Emit): Flag dead code.
11198
11199 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11200
11201         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11202
11203 2002-07-27  Martin Baulig  <martin@gnome.org>
11204
11205         * class.cs (MethodData.Define): Put back call to
11206         TypeManager.AddMethod(), accidentally commented this out.
11207
11208         * report.cs (Debug): New public method to print debugging information,
11209         this is `[Conditional ("DEBUG")]'.
11210
11211 2002-07-26  Martin Baulig  <martin@gnome.org>
11212
11213         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11214         (switch_statement): Push the current_block to the switch_stack and
11215         pop it again when we're done with the switch.
11216         (switch_section): The new block is a child of the current_block.
11217         Fixes bug #24007, added test-152.cs.
11218
11219 2002-07-27  Martin Baulig  <martin@gnome.org>
11220
11221         * expression.cs (Invocation.EmitArguments): When calling a varargs
11222         function with only its fixed arguments, we need to pass an empty
11223         array.
11224
11225 2002-07-27  Martin Baulig  <martin@gnome.org>
11226
11227         Mono 0.13 has been released.
11228
11229 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11230
11231         * driver.cs: Rename --resource to --linkres, because that is what
11232         we do currently, we dont support --resource yet.
11233
11234         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11235
11236 2002-07-25  Martin Baulig  <martin@gnome.org>
11237
11238         * class.cs (MethodData): New public class.  This is a `method builder'
11239         class for a method or one accessor of a Property/Indexer/Event.
11240         (MethodData.GetMethodFlags): Moved here from MemberBase.
11241         (MethodData.ApplyAttributes): Likewise.
11242         (MethodData.ApplyObsoleteAttribute): Likewise.
11243         (MethodData.ApplyConditionalAttribute): Likewise.
11244         (MethodData.ApplyDllImportAttribute): Likewise.
11245         (MethodData.CheckAbstractAndExternal): Likewise.
11246         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11247         (MethodData.Emit): Formerly known as Method.Emit().
11248         (MemberBase): Moved everything which was specific to a single
11249         accessor/method to MethodData.
11250         (Method): Create a new MethodData and call Define() and Emit() on it.
11251         (Property, Indexer, Event): Create a new MethodData objects for each
11252         accessor and call Define() and Emit() on them.
11253
11254 2002-07-25  Martin Baulig  <martin@gnome.org>
11255
11256         Made MethodCore derive from MemberBase to reuse the code from there.
11257         MemberBase now also checks for attributes.
11258
11259         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11260         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11261         as virtual.
11262         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11263         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11264         (MemberBase.ApplyAttributes): New virtual method; applies the
11265         attributes to a method or accessor.
11266         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11267         (MemberBase.ApplyConditionalAttribute): Likewise.
11268         (MemberBase.ApplyDllImportAttribute): Likewise.
11269         (MemberBase.CheckAbstractAndExternal): Likewise.
11270         (MethodCore.ParameterTypes): This is now a property instead of a
11271         method, it's initialized from DoDefineParameters().
11272         (MethodCore.ParameterInfo): Removed the set accessor.
11273         (MethodCore.DoDefineParameters): New protected virtual method to
11274         initialize ParameterTypes and ParameterInfo.
11275         (Method.GetReturnType): We can now simply return the MemberType.
11276         (Method.GetMethodFlags): Override the MemberBase version and add
11277         the conditional flags.
11278         (Method.CheckBase): Moved some code from Define() here, call
11279         DoDefineParameters() here.
11280         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11281         here to avoid some larger code duplication.
11282         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11283         ensure that abstract and external accessors don't declare a body.
11284
11285         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11286         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11287         lookup in the attribute's parent classes, so we need to abort as soon
11288         as we found the first match.
11289         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11290         the attribute has no arguments.
11291
11292         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11293         of a Method.
11294
11295 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11296
11297         * cs-parser.jay: reverted previous patch.
11298
11299 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11300
11301         * cs-parser.jay: fixed bug #22119.
11302
11303 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11304
11305         * attribute.cs: fixed compilation. The error was:
11306         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11307         be assigned to before control leaves the current method."
11308         [FIXME:  Filed as bug #28186: MCS must report this error.]
11309
11310 2002-07-25  Martin Baulig  <martin@gnome.org>
11311
11312         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11313         method to pull the condition name ouf of a Conditional attribute.
11314         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11315         the obsolete message and error flag out of an Obsolete attribute.
11316
11317         * class.cs (Method.GetMethodFlags): New public method to get the
11318         TypeManager.MethodFlags for this method.
11319         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11320         private methods.
11321         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11322         if we're overriding a virtual function, set the new private variable
11323         `parent_method'; call the new TypeManager.AddMethod().
11324
11325         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11326         the MethodBuilder and the Method in a PtrHashtable.
11327         (TypeManager.builder_to_method): Added for this purpose.
11328         (TypeManager.MethodFlags): Added IsObsoleteError.
11329         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11330         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11331         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11332         the message from the attribute.
11333
11334 2002-07-24  Martin Baulig  <martin@gnome.org>
11335
11336         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11337         preprocessor directives, ensure that the argument to #define/#undef is
11338         exactly one identifier and that it's actually an identifier.
11339
11340         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11341         did not work ....
11342
11343 2002-07-24  Martin Baulig  <martin@gnome.org>
11344
11345         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11346         initialize it to TypeManager.object_type in the constructor.
11347         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11348         of the `hm.get_current' method if we're using the collection pattern.
11349         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11350         for the explicit conversion to make it work when we're using the collection
11351         pattern and the `Current' property has a different return type than `object'.
11352         Fixes #27713.
11353
11354 2002-07-24  Martin Baulig  <martin@gnome.org>
11355
11356         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11357         does not match, but don't report any errors.  This method is called in
11358         order for all methods in a MethodGroupExpr until a matching method is
11359         found, so we don't want to bail out if the first method doesn't match.
11360         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11361         matches, report the 123.  Fixes #28070.
11362
11363 2002-07-24  Martin Baulig  <martin@gnome.org>
11364
11365         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11366         TypeManager.TypeToCoreType() to the top of the method so the
11367         following equality checks will work.  Fixes #28107.
11368
11369 2002-07-24  Martin Baulig  <martin@gnome.org>
11370
11371         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11372         operand is of type uint, and the other operand is of type sbyte,
11373         short or int, the operands are converted to type long." -
11374         Actually do what this comment already told us.  Fixes bug #28106,
11375         added test-150.cs.
11376
11377 2002-07-24  Martin Baulig  <martin@gnome.org>
11378
11379         * class.cs (MethodBase): New abstract class.  This is now a base
11380         class for Property, Indexer and Event to avoid some code duplication
11381         in their Define() and DefineMethods() methods.
11382         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11383         generic methods for Define() and DefineMethods().
11384         (FieldBase): Derive from MemberBase, not MemberCore.
11385         (Property): Derive from MemberBase, not MemberCore.
11386         (Property.DefineMethod): Moved all the code from this method to the
11387         new MethodBase.DefineAccessor(), just call it with appropriate
11388         argumetnts.
11389         (Property.Define): Call the new Property.DoDefine(), this does some
11390         sanity checks and we don't need to duplicate the code everywhere.
11391         (Event): Derive from MemberBase, not MemberCore.
11392         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11393         accessors, this will also make them work with interface events.
11394         (Indexer): Derive from MemberBase, not MemberCore.
11395         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11396         (Indexer.Define): Use the new MethodBase functions.
11397
11398         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11399         argument to the constructor.
11400         (Interface.FindMembers): Added support for interface events.
11401         (Interface.PopluateEvent): Implemented.
11402
11403         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11404
11405 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11406
11407         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11408         but this is required to check for a method name being the same as
11409         the containing class.  
11410
11411         Handle this now.
11412
11413 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11414
11415         * interface.cs: initialize variable.
11416
11417 2002-07-23  Martin Baulig  <martin@gnome.org>
11418
11419         Implemented the IndexerName attribute in interfaces.
11420
11421         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11422         name if this is an explicit interface implementation.
11423         (Indexer.InterfaceIndexerName): New public variable.  If we're
11424         implementing an interface indexer, this is the IndexerName in that
11425         interface.  Otherwise, it's the IndexerName.
11426         (Indexer.DefineMethod): If we're implementing interface indexer,
11427         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11428         and Pending.ImplementIndexer methods.
11429         (Indexer.Define): Also define the PropertyBuilder if we're
11430         implementing an interface indexer and this is neither an explicit
11431         interface implementation nor do the IndexerName match the one in
11432         the interface.
11433
11434         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11435         If a method is defined here, then we always need to create a proxy
11436         for it.  This is used when implementing interface indexers.
11437         (Pending.IsInterfaceIndexer): New public method.
11438         (Pending.ImplementIndexer): New public method.
11439         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11440         This is used when implementing interface indexers to define a proxy
11441         if necessary.
11442         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11443         define a proxy if necessary.
11444
11445         * interface.cs (Interface.IndexerName): New public variable.
11446         (Interface.PopulateIndexer): Set the IndexerName.
11447         (Interface.DefineIndexers): New private method.  Populate all the
11448         indexers and make sure their IndexerNames match.
11449
11450         * typemanager.cs (IndexerPropertyName): Added support for interface
11451         indexers.
11452
11453 2002-07-22  Martin Baulig  <martin@gnome.org>
11454
11455         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11456         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11457         ret if HasReturnLabel.
11458         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11459         variables.
11460
11461         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11462         and set the ec.LoopBeginTryCatchLevel.
11463         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11464         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11465         the current ec.TryCatchLevel, the branch goes out of an exception
11466         block.  In this case, we need to use Leave and not Br.
11467
11468 2002-07-22  Martin Baulig  <martin@gnome.org>
11469
11470         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11471         block unless the block does not always return or it is contained in
11472         another try { ... } catch { ... } block.  Fixes bug #26506.
11473         Added verify-1.cs to the test suite.
11474
11475 2002-07-22  Martin Baulig  <martin@gnome.org>
11476
11477         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11478         then we do not always return.  Fixes bug #24985.
11479
11480 2002-07-22  Martin Baulig  <martin@gnome.org>
11481
11482         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11483         lookup on a per-class level; ie. walk up the class hierarchy until we
11484         found at least one applicable method, then choose the best among them.
11485         Fixes bug #24463 and test-29.cs.
11486
11487 2002-07-22  Martin Baulig  <martin@gnome.org>
11488
11489         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11490         return types of the methods.  The return type is not part of the
11491         signature and we must not check it to make the `new' modifier work.
11492         Fixes bug #27999, also added test-147.cs.
11493         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11494
11495         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11496         on the method's return type.
11497
11498 2002-07-21  Martin Baulig  <martin@gnome.org>
11499
11500         * assign.cs: Make this work if the rightmost source is a constant and
11501         we need to do an implicit type conversion.  Also adding a few more tests
11502         to test-38.cs which should have caught this.
11503
11504         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11505         target in the makefile for this.  The makefile.gnu is primarily intended
11506         for end-users who don't want to debug the compiler.
11507
11508 2002-07-21  Martin Baulig  <martin@gnome.org>
11509
11510         * assign.cs: Improved the Assign class so it can now handle embedded
11511         assignments (X = Y = Z = something).  As a side-effect this'll now also
11512         consume less local variables.  test-38.cs now passes with MCS, added
11513         a few new test cases to that test.
11514
11515 2002-07-20  Martin Baulig  <martin@gnome.org>
11516
11517         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11518         instructions.  Fixes bug #27977, also added test-146.cs.
11519
11520 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11521
11522         * cs-tokenizer.cs: fixed getHex ().
11523
11524 2002-07-19  Martin Baulig  <martin@gnome.org>
11525
11526         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11527         not Type.GetType() to lookup the array type.  This is needed when
11528         we're constructing an array of a user-defined type.
11529         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11530         single-dimensional arrays, but also for single-dimensial arrays of
11531         type decimal.
11532
11533 2002-07-19  Martin Baulig  <martin@gnome.org>
11534
11535         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11536         this function is called, it's not allowed to share LocalBuilders
11537         among ILGenerators.
11538
11539 2002-07-19  Martin Baulig  <martin@gnome.org>
11540
11541         * expression.cs (Argument.Resolve): Report an error 118 when trying
11542         to pass a type as argument.
11543
11544 2002-07-18  Martin Baulig  <martin@gnome.org>
11545
11546         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11547         Conv_R_Un for the signed `long' type.
11548
11549 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11550
11551         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11552         `expr' for the temporary result, as that will fail if we do
11553         multiple resolves on the same expression.
11554
11555 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11556
11557         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11558         ec.TypeContainer for looking up aliases. 
11559
11560         * class.cs (TypeContainer): Remove LookupAlias from here.
11561
11562         * decl.cs (DeclSpace); Move here.
11563
11564 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
11565
11566         * class.cs (FindMembers): Only call filter if the constructor
11567         bulider is not null.
11568
11569         Also handle delegates in `NestedTypes' now.  Now we will perform
11570         type lookups using the standard resolution process.  This also
11571         fixes a bug.
11572
11573         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11574         This uses Expressions (the limited kind that can be parsed by the
11575         tree) instead of strings.
11576
11577         * expression.cs (ComposedCast.ToString): Implement, used to flag
11578         errors since now we have to render expressions.
11579
11580         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
11581         FormArrayType. 
11582
11583         * ecore.cs (SimpleName.ToString): ditto.
11584
11585         * cs-parser.jay: Instead of using strings to assemble types, use
11586         Expressions to assemble the type (using SimpleName, ComposedCast,
11587         MemberAccess).  This should fix the type lookups in declarations,
11588         because we were using a different code path for this.
11589
11590         * statement.cs (Block.Resolve): Continue processing statements
11591         even when there is an error.
11592
11593 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
11594
11595         * class.cs (Event.Define): Also remove the `remove' method from
11596         the list of pending items.
11597
11598         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
11599         generate more compact code. 
11600
11601 2002-07-17  Martin Baulig  <martin@gnome.org>
11602
11603         * const.cs (Const.LookupConstantValue): Add support for constant
11604         `unchecked' and `checked' expressions.
11605         Also adding test case test-140.cs for this.
11606
11607 2002-07-17  Martin Baulig  <martin@gnome.org>
11608
11609         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
11610         check whether mi.ReturnType implements the IEnumerator interface; the
11611         `==' and the IsAssignableFrom() will fail in this situation.
11612
11613 2002-07-16  Ravi Pratap  <ravi@ximian.com>
11614
11615         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
11616         here too.
11617
11618 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11619
11620         * expression.cs: fixed bug #27811.
11621
11622 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
11623
11624         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
11625         Molaro: when we are a ref, the value already contains a pointer
11626         value, do not take the address of it.
11627
11628 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
11629         * removed mb-parser.jay and mb-tokenizer.cs
11630
11631 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11632
11633         * expression.cs: check against the building corlib void type.
11634
11635 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
11636
11637         * ecore.cs: fix for valuetype static readonly fields: when 
11638         initializing them, we need their address, not the address of a copy.
11639
11640 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
11641
11642         * typemanager.cs: register also enum_type in corlib.
11643
11644 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
11645
11646         * class.cs: allow calling this (but not base) initializers in structs.
11647
11648 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
11649
11650         * ecore.cs: make sure we compare against the building base types
11651         in GetTypeSize ().
11652
11653 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
11654
11655         * typemanager.cs: fix TypeToCoreType() to handle void and object
11656         (corlib gets no more typerefs after this change).
11657
11658 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
11659
11660         * expression.cs (ArrayCreation.EmitArrayArguments): use
11661         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
11662
11663         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
11664         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
11665         array indexes, the runtime actually forbids them.
11666
11667         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
11668         for array arguments here.
11669
11670         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
11671         instead of the default for ValueTypes.
11672
11673         (New.DoEmit): Use IsValueType instead of
11674         IsSubclassOf (value_type)
11675         (New.DoResolve): ditto.
11676         (Invocation.EmitCall): ditto.
11677
11678         * assign.cs (Assign): ditto.
11679
11680         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
11681         Statements *are* currently doing part of their resolution during
11682         Emit.  
11683
11684         Expressions do always resolve during resolve, but statements are
11685         only required to propagate resolution to their children.
11686
11687 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
11688
11689         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
11690
11691         (LoadAssembly): Do not add the dll if it is already specified
11692
11693         (MainDriver): Add the System directory to the link path at the end,
11694         after all the other -L arguments. 
11695
11696         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
11697         wrong opcode for loading bytes and bools (ldelem.i1 instead of
11698         ldelem.u1) and using the opposite for sbytes.
11699
11700         This fixes Digger, and we can finally run it.
11701
11702         * driver.cs (UnixParseOption): Move the option parsing here.  
11703         (CSCParseOption): Implement CSC-like parsing of options.
11704
11705         We now support both modes of operation, the old Unix way, and the
11706         new CSC-like way.  This should help those who wanted to make cross
11707         platform makefiles.
11708
11709         The only thing broken is that /r:, /reference: and /lib: are not
11710         implemented, because I want to make those have the same semantics
11711         as the CSC compiler has, and kill once and for all the confussion
11712         around this.   Will be doing this tomorrow.
11713
11714         * statement.cs (Unsafe.Resolve): The state is checked during
11715         resolve, not emit, so we have to set the flags for IsUnsfe here.
11716
11717 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
11718
11719         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
11720         not catch the Error_ObjectRefRequired in SimpleName (as it is
11721         possible to have a class/instance variable name that later gets
11722         deambiguated), we have to check this here.      
11723
11724 2002-07-10  Ravi Pratap  <ravi@ximian.com>
11725
11726         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
11727         make static and put into Expression.
11728
11729         (Event.Define): Register the private field of the event with the 
11730         TypeManager so that GetFieldFromEvent can get at it.
11731
11732         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
11733         keep track of the private field associated with an event which
11734         has no accessors.
11735
11736         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
11737         private field.
11738
11739         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
11740
11741 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
11742
11743         * expression.cs (Binary.EmitBranchable): this routine emits the
11744         Binary expression in a branchable context.  This basically means:
11745         we need to branch somewhere, not just get the value on the stack.
11746
11747         This works together with Statement.EmitBoolExpression.
11748
11749         * statement.cs (Statement.EmitBoolExpression): Use
11750         EmitBranchable. 
11751
11752 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * statement.cs (For): Reduce the number of jumps in loops.
11755
11756         (For): Implement loop inversion for the For statement.
11757
11758         (Break): We can be breaking out of a Try/Catch controlled section
11759         (foreach might have an implicit try/catch clause), so we need to
11760         use Leave instead of Br.
11761
11762         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
11763         now).  If the instace expression supports IMemoryLocation, we use
11764         the AddressOf method from the IMemoryLocation to extract the
11765         address instead of emitting the instance.
11766
11767         This showed up with `This', as we were emitting the instance
11768         always (Emit) instead of the Address of This.  Particularly
11769         interesting when This is a value type, as we dont want the Emit
11770         effect (which was to load the object).
11771
11772 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
11775
11776         * statement.cs (Checked): Set the CheckedState during the resolve
11777         process too, as the ConvCast operations track the checked state on
11778         the resolve process, and not emit.
11779
11780         * cs-parser.jay (namespace_member_declaration): Flag that we have
11781         found a declaration when we do.  This is used to flag error 1529
11782
11783         * driver.cs: Report ok when we display the help only.
11784
11785 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
11786
11787         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
11788
11789 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
11790
11791         * cs-tokenizer.cs (define): We also have to track locally the
11792         defines.  AllDefines is just used for the Conditional Attribute,
11793         but we also need the local defines for the current source code. 
11794
11795 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
11796
11797         * statement.cs (While, For, Do): These loops can exit through a
11798         Break statement, use this information to tell whether the
11799         statement is the last piece of code.
11800
11801         (Break): Flag that we break.
11802
11803         * codegen.cs (EmitContexts): New `Breaks' state variable.
11804
11805 2002-07-03  Martin Baulig  <martin@gnome.org>
11806
11807         * class.cs (TypeContainer.MethodModifiersValid): Allow override
11808         modifiers in method declarations in structs.  Otherwise, you won't
11809         be able to override things like Object.Equals().
11810
11811 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * class.cs (Method, Property, Indexer): Do not allow the public
11814         modifier to be used in explicit interface implementations.
11815
11816         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
11817         override modifiers in method declarations in structs
11818
11819 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
11820
11821         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
11822         integer or real overflow, report an error
11823
11824 2002-07-02  Martin Baulig  <martin@gnome.org>
11825
11826         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
11827         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
11828         to tell the runtime about our newly created System.Object and
11829         System.ValueType types.
11830
11831 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
11832
11833         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
11834         struct instead of Ldarg/Starg.
11835
11836 2002-07-02  Martin Baulig  <martin@gnome.org>
11837
11838         * expression.cs (Indirection.Indirection): Call
11839         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
11840
11841 2002-07-02  Martin Baulig  <martin@gnome.org>
11842
11843         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
11844         ValueType, call TypeManager.TypeToCoreType() on it.
11845         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
11846         the OpCodes.Newarr argument.
11847
11848 2002-07-02  Martin Baulig  <martin@gnome.org>
11849
11850         * expression.cs (Invocation.EmitCall): When compiling corlib,
11851         replace all calls to the system's System.Array type to calls to
11852         the newly created one.
11853
11854         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
11855         System.Array methods.
11856         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
11857         from the system's System.Array type which must be replaced.
11858
11859 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
11860
11861         * typemanager.cs: load unverifiable_code_ctor so we can build
11862         corlib using the correct type. Avoid using GetTypeCode() with
11863         TypeBuilders.
11864         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
11865         TypeManager.object_type to allow building corlib.
11866
11867 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
11868
11869         * ecore.cs: handle System.Enum separately in LoadFromPtr().
11870
11871 2002-07-01  Martin Baulig  <martin@gnome.org>
11872
11873         * class.cs: Make the last change actually work, we need to check
11874         whether `ifaces != null' to avoid a crash.
11875
11876 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11877
11878         * class.cs: when we build structs without fields that implement
11879         interfaces, we need to add the interfaces separately, since there is
11880         no API to both set the size and add the interfaces at type creation
11881         time.
11882
11883 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
11884
11885         * expression.cs: the dimension arguments to the array constructors
11886         need to be converted if they are a long.
11887
11888 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
11889
11890         * class.cs: don't emit ldarg.0 if there is no parent constructor
11891         (fixes showstopper for corlib).
11892
11893 2002-06-29  Martin Baulig  <martin@gnome.org>
11894
11895         MCS now compiles corlib on GNU/Linux :-)
11896
11897         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
11898         ie. check for MethodImplOptions.InternalCall.
11899
11900         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
11901         and TypeManager.attribute_type are null, so we must explicitly check
11902         whether parent is not null to find out whether it's an attribute type.
11903         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
11904         and SetBuilder, not only if the property is neither abstract nor external.
11905         This is necessary to set the MethodImplOptions on the accessor methods.
11906         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
11907         SetBuilder, see Property.Emit().
11908
11909         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
11910         populate "System.Object", "System.ValueType" and "System.Attribute" since
11911         they've already been populated from BootCorlib_PopulateCoreTypes().
11912
11913 2002-06-29  Martin Baulig  <martin@gnome.org>
11914
11915         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
11916         is the NullLiteral, we also need to make sure that target_type is not
11917         an enum type.   
11918
11919 2002-06-29  Martin Baulig  <martin@gnome.org>
11920
11921         * rootcontext.cs (RootContext.ResolveCore): We must initialize
11922         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
11923         before calling BootstrapCorlib_ResolveDelegate ().
11924
11925 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11926
11927         * statement.cs: fixed build-breaker. All tests passed ok.
11928
11929 2002-06-27  Martin Baulig  <martin@gnome.org>
11930
11931         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
11932         for System.Decimal when compiling corlib.
11933
11934 2002-06-27  Martin Baulig  <martin@gnome.org>
11935
11936         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
11937         switch blocks which contain nothing but a default clause.
11938
11939 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
11940
11941        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
11942
11943 2002-06-27  Martin Baulig  <martin@gnome.org>
11944
11945         * ecore.cs (PropertyExpr.PropertyExpr): Call
11946         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
11947
11948         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
11949         is already a TypeBuilder.
11950
11951 2002-06-27  Martin Baulig  <martin@gnome.org>
11952
11953         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
11954         `target_type == TypeManager.array_type', not IsAssignableFrom() in
11955         the "from an array-type to System.Array" case.  This makes it work
11956         when compiling corlib.
11957
11958 2002-06-27  Martin Baulig  <martin@gnome.org>
11959
11960         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
11961         non-static PropertyExpr, set its InstanceExpression.  This makes
11962         the `ICollection.Count' property work in System/Array.cs.
11963
11964 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
11965
11966         * driver.cs: Made error handling more consistent.  Errors now
11967         tracked by Report class, so many methods which used to return int
11968         now return void.  Main() now prints success/failure and 
11969         errors/warnings message.
11970
11971         Renamed '--probe' compiler argument to '--expect-error'.  Removed
11972         the magic number return values (123 and 124).  Now, if the
11973         expected error occurs, the compiler exits with success (exit value
11974         0).  If the compilation completes without seeing that particular
11975         error, the compiler exits with failure (exit value 1).  The
11976         makefile in mcs/errors has been changed to handle the new behaviour.
11977
11978         * report.cs: Made 'expected error' number a property and renamed
11979         it from 'Probe' to 'ExpectedError'.
11980
11981         * genericparser.cs: Removed error handling support, since it is
11982         now all done by Report class.
11983
11984         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
11985         class, so parse() no longer returns an int.
11986
11987         * namespace.cs: Use Report.Error instead of GenericParser.error
11988
11989 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
11990
11991         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
11992         TypeContainer.AddOperator): At the front of the list put the
11993         explicit implementations, so they get resolved/defined first. 
11994
11995 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
11996
11997         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
11998         interface type is implemented by this TypeContainer.  Used during
11999         explicit interface implementation.
12000
12001         (Property.Define, Indexer.Define, Method.Define): Validate that
12002         the given interface in the explicit implementation is one of the
12003         base classes for the containing type.
12004
12005         Also if we are explicitly implementing an interface, but there is
12006         no match in the pending implementation table, report an error.
12007
12008         (Property.Define): Only define the property if we are
12009         not explicitly implementing a property from an interface.  Use the
12010         correct name also for those properties (the same CSC uses,
12011         although that is really not needed).
12012
12013         (Property.Emit): Do not emit attributes for explicitly implemented
12014         properties, as there is no TypeBuilder.
12015
12016         (Indexer.Emit): ditto.
12017
12018         Hiding then means that we do not really *implement* a pending
12019         implementation, which makes code fail.
12020
12021 2002-06-22  Martin Baulig  <martin@gnome.org>
12022
12023         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12024         the return value of Object.GetType().  [FIXME: we need to do this whenever
12025         we get a type back from the reflection library].
12026
12027 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12028
12029         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12030
12031 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12032
12033         * attribute.cs: Return null if we can not look up the type.
12034
12035         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12036         the interface types found.
12037
12038         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12039         interface types found.
12040
12041         * typemanager.cs (GetInterfaces): Make this routine returns alll
12042         the interfaces and work around the lame differences between
12043         System.Type and System.Reflection.Emit.TypeBuilder in the results
12044         result for GetInterfaces.
12045
12046         (ExpandInterfaces): Given an array of interface types, expand and
12047         eliminate repeated ocurrences of an interface.  This expands in
12048         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12049         be IA, IB, IC.
12050
12051 2002-06-21  Martin Baulig  <martin@gnome.org>
12052
12053         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12054         on System.Enum.
12055
12056 2002-06-21  Martin Baulig  <martin@gnome.org>
12057
12058         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12059         and called with one of the core types, return the corresponding typebuilder for
12060         that type.
12061
12062         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12063         element type.
12064
12065 2002-06-21  Martin Baulig  <martin@gnome.org>
12066
12067         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12068         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12069         (Expression.ConvertReferenceExplicit): Likewise.
12070
12071         * expression.cs (ElementAccess.DoResolve): Likewise.
12072         (ElementAccess.DoResolveLValue): Likewise.
12073
12074 2002-06-10  Martin Baulig  <martin@gnome.org>
12075
12076         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12077         add the "value" parameter to the parameter list.
12078
12079         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12080         to our caller.
12081
12082 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12083
12084         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12085         the argument to an int, uint, long or ulong, per the spec.  Also
12086         catch negative constants in array creation.
12087
12088 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12089
12090         * class.cs: do not allow the same interface to appear twice in
12091         the definition list.
12092
12093 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12094
12095         * ecore.cs: don't use ldlen with System.Array.
12096
12097 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12098
12099         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12100
12101 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12102
12103         * modifiers.cs: produce correct field attributes for protected
12104         internal. Easy fix so miguel can work on ther harder stuff:-)
12105
12106 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12107
12108         * pending.cs: New file.  Move the code from class.cs here.
12109         Support clearning the pending flag for all methods (when not doing
12110         explicit interface implementation).
12111
12112 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12113
12114         * rootcontext.cs: added a couple more types needed to bootstrap.
12115
12116 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12117
12118         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12119         constructor in the type, instead of any constructor in the type
12120         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12121         a bug in the Mono runtime when applying the params attribute). 
12122
12123 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12124         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12125
12126 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12127
12128         * expression.cs (Unary.ResolveOperator): Use TypeManager
12129         to resolve the type.
12130
12131 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12132
12133         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12134         attached.
12135
12136         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12137         with each member too.
12138
12139         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12140         field builders too - this takes care of the enum member case.
12141
12142 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12143
12144         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12145         address-of operator on both value types and pointers.
12146
12147 2002-06-10  Martin Baulig  <martin@gnome.org>
12148
12149         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12150         PropertyBuilder to the `property_builders' list.
12151
12152         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12153         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12154         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12155         find any indexers which are inherited from an interface.
12156
12157 2002-06-09  Martin Baulig  <martin@gnome.org>
12158
12159         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12160         the same type as the constant if necessary.  There's also a test-130.cs
12161         for this.
12162
12163         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12164
12165         * typemanager.cs (TypeManager.ChangeType): Previously known as
12166         Enum.ChangeEnumType().
12167
12168 2002-06-09  Martin Baulig  <martin@gnome.org>
12169
12170         * expression.cs (Cast.TryReduce): Added support for consts.
12171
12172 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12173
12174         * class.cs (Accessor): Hold attributes information so we can pass
12175         it along.
12176
12177         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12178         Modify to pass in attributes attached to the methods.
12179
12180         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12181
12182         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12183         to handle the Accessor kind :-)
12184
12185         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12186
12187 2002-06-08  Martin Baulig  <martin@gnome.org>
12188
12189         * expression.cs (Unary.TryReduceNegative): Added support for
12190         ULongConstants.
12191
12192 2002-06-08  Martin Baulig  <martin@gnome.org>
12193
12194         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12195         name can't be found in the `defined_names' - the caller will do a
12196         MemberLookup in this case and thus find methods in System.Enum
12197         such as Enum.IsDefined().
12198
12199 2002-06-08  Martin Baulig  <martin@gnome.org>
12200
12201         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12202         Convert.ChangeType() which works with TypeBuilder created types.
12203         (Enum.LookupEnumValue, Enum.Define): Use it here.
12204
12205         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12206         `TypeBuilder.BaseType != null' check.
12207         (TypeContainer.FindMembers): Only lookup parent members if we
12208         actually have a parent.
12209         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12210         (ConstructorInitializer.Resolve): Likewise.
12211
12212         * interface.cs (Interface.FindMembers): Added
12213         `TypeBuilder.BaseType != null' check.
12214
12215         * rootcontext.cs (RootContext.ResolveCore): Added
12216         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12217         classes_second_stage.
12218
12219         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12220         debug_type and trace_type when compiling with --nostdlib.       
12221
12222 2002-06-07  Martin Baulig  <martin@gnome.org>
12223
12224         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12225         (AddField): Set it to true when adding a non-static field.
12226         (DefineType): Use `have_nonstatic_fields' to find out whether we
12227         have non-static fields, not `Fields != null'.
12228
12229 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12232         dereferencing a null on the static-field code path)
12233
12234 2002-05-30  Martin Baulig  <martin@gnome.org>
12235
12236         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12237         to take command line arguments.  Use reflection to call the new
12238         custom `Initialize' function on the symbol writer and pass it the
12239         command line arguments.
12240
12241         * driver.cs (--debug-args): New command line argument to pass command
12242         line arguments to the symbol writer.
12243
12244 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12245
12246         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12247         the target type for indexers and properties.  Thanks to Joe for
12248         catching this.
12249
12250 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12251
12252         * typemanager.cs (MethodFlags): returns the method flags
12253         (Obsolete/ShouldIgnore) that control warning emission and whether
12254         the invocation should be made, or ignored. 
12255
12256         * expression.cs (Invocation.Emit): Remove previous hack, we should
12257         not do this on matching a base type, we should do this based on an attribute
12258
12259         Only emit calls to System.Diagnostics.Debug and
12260         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12261         on the command line.
12262
12263         * rootcontext.cs: Global settings for tracing and debugging.
12264
12265         * cs-tokenizer.cs (define): New utility function to track
12266         defines.   Set the global settings for TRACE and DEBUG if found.
12267
12268 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12269
12270         * interface.cs (Populate*): Pass in the TypeContainer as well as
12271         the DeclSpace as parameters so that we can create EmitContexts and
12272         then use that to apply attributes etc.
12273
12274         (PopulateMethod, PopulateEvent, PopulateProperty)
12275         (PopulateIndexer): Apply attributes everywhere.
12276
12277         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12278         etc.
12279
12280         (ApplyAttributes): Update accordingly.
12281
12282         We now apply interface attributes for all members too.
12283
12284 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12285
12286         * class.cs (Indexer.Define); Correctly check if we are explicit
12287         implementation (instead of checking the Name for a ".", we
12288         directly look up if the InterfaceType was specified).
12289
12290         Delay the creation of the PropertyBuilder.
12291
12292         Only create the PropertyBuilder if we are not an explicit
12293         interface implementation.   This means that explicit interface
12294         implementation members do not participate in regular function
12295         lookups, and hence fixes another major ambiguity problem in
12296         overload resolution (that was the visible effect).
12297
12298         (DefineMethod): Return whether we are doing an interface
12299         implementation. 
12300
12301         * typemanager.cs: Temporary hack until we get attributes in
12302         interfaces (Ravi is working on that) and we get IndexerName
12303         support in interfaces.
12304
12305         * interface.cs: Register the indexers as properties.
12306
12307         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12308         warning, I have verified that this is a bug in the .NET runtime
12309         (JavaScript suffers of the same problem).
12310
12311         * typemanager.cs (MemberLookup): When looking up members for
12312         interfaces, the parent of an interface is the implicit
12313         System.Object (so we succeed in searches of Object methods in an
12314         interface method invocation.  Example:  IEnumerable x;  x.ToString
12315         ()) 
12316
12317 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12318
12319         * class.cs (Event): Events should also register if they do
12320         implement the methods that an interface requires.
12321
12322         * typemanager.cs (MemberLookup); use the new GetInterfaces
12323         method. 
12324
12325         (GetInterfaces): The code used to lookup interfaces for a type is
12326         used in more than one place, factor it here. 
12327
12328         * driver.cs: Track the errors at the bottom of the file, we kept
12329         on going.
12330
12331         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12332         instance if the method we are calling is static!
12333
12334 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * attribute.cs (ApplyAttributes): Make this function filter out
12337         the IndexerName attribute (as that attribute in reality is never
12338         applied) and return the string constant for the IndexerName
12339         attribute. 
12340
12341         * class.cs (TypeContainer.Emit): Validate that all the indexers
12342         have the same IndexerName attribute, and if so, set the
12343         DefaultName attribute on the class. 
12344
12345         * typemanager.cs: The return value might contain other stuff (not
12346         only methods).  For instance, consider a method with an "Item"
12347         property and an Item method.
12348
12349         * class.cs: If there is a problem with the parameter types,
12350         return. 
12351
12352 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12353
12354         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12355         looks at user defined conversion after making a call to 
12356         StandardConversionExists - we need this for overload resolution.
12357
12358         * expression.cs : Update accordingly the various method calls.
12359
12360         This fixes 2 bugs filed against implicit user defined conversions 
12361
12362 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12363
12364         * statement.cs: Track the result of the assignment.
12365
12366 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * expression.cs (MemberAccess): Improved error reporting for
12369         inaccessible members.
12370
12371 2002-05-22  Martin Baulig  <martin@gnome.org>
12372
12373         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12374         itself with debugging support.
12375
12376 2002-05-22  Martin Baulig  <martin@gnome.org>
12377
12378         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12379         Removed, this isn't needed anymore.
12380
12381 2002-05-20  Martin Baulig  <martin@gnome.org>
12382
12383         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12384         be underlying type for an enum.
12385
12386 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12389         that splits out the loading of just the core types.
12390
12391         * rootcontext.cs (ResolveCore): Split the struct resolution in
12392         two, so we can load the enumeration underlying types before any
12393         enums are used.
12394
12395         * expression.cs (Is): Bandaid until we fix properly Switch (see
12396         bug #24985 for details).
12397
12398         * typemanager.cs (ImplementsInterface): The hashtable will contain
12399         a null if there are no interfaces implemented.
12400
12401 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12402
12403         * cs-parser.jay (indexer_declarator): It is fine to have array
12404         parameters
12405
12406 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12407
12408         * typemanager.cs: (RegisterBuilder): New function used to register
12409         TypeBuilders that implement interfaces.  Since
12410         TypeBuilder.GetInterfaces (as usual) does not work with lame
12411         Reflection.Emit. 
12412         (AddUserType): register interfaces.
12413
12414         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12415         dealing with TypeBuilder.  Also, arrays are showing up as
12416         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12417         methods can not be invoked on them!
12418
12419         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12420         (ImplicitReferenceConversionExists): Split out from
12421         StandardConversionExists. 
12422
12423         * expression.cs (As): We were only implementing one of the three
12424         cases for the as operator.  We now implement them all.
12425         (Is): Implement the various other cases for Is as well.
12426
12427         * typemanager.cs (CACHE): New define used to control if we want or
12428         not the FindMembers cache.  Seems to have a negative impact on
12429         performance currently
12430
12431         (MemberLookup): Nested types have full acess to
12432         enclosing type members
12433
12434         Remove code that coped with instance/static returns for events, we
12435         now catch this in RealFindMembers.
12436
12437         (RealFindMembers): only perform static lookup if the instance
12438         lookup did not return a type or an event.  
12439
12440 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12441
12442         * assign.cs (CompoundAssign): We pass more semantic information
12443         now to Compound Assignments than we did before: now we have all
12444         the information at hand, and now we resolve the target *before* we
12445         do the expression expansion, which allows the "CacheValue" method
12446         to have the effect we intended (before, a [x] += 1 would generate
12447         two differen ArrayAccess expressions from the ElementAccess,
12448         during the resolution process).
12449
12450         (CompoundAssign.DoResolve): Resolve target and original_source here.
12451
12452 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * expression.cs (ArrayAccess): dropped debugging information. 
12455
12456         * typemanager.cs: Small bug fix: I was always returning i_members,
12457         instead of one of i_members or s_members (depending on which had
12458         the content).
12459
12460         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12461         method is invoked before any code generation takes place, and it
12462         is a mechanism to inform that the expression will be invoked more
12463         than once, and that the method should use temporary values to
12464         avoid having side effects
12465
12466         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12467
12468         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12469         implementation.
12470
12471         * expression.cs (Indirection, ArrayAccess): Add support for
12472         CacheTemporaries in these two bad boys. 
12473
12474         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12475         ldobj or ldind_ref.  
12476         (StoreFromPtr): Handle stobj as well.
12477
12478         * expression.cs (UnaryMutator): Share more code.
12479
12480         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12481         down: I was not tracking the Filter function as well, which
12482         was affecting the results of the cache.
12483
12484 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * attribute.cs: Remove the hack to handle the CharSet property on
12487         StructLayouts. 
12488
12489 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * attribute.cs (DoResolve): More uglyness, we now only try to
12492         resolve the attribute partially, to extract the CharSet
12493         information (only if we are a StructLayout attribute).  Otherwise 
12494
12495         (GetExtraTypeInfo): Add some code to conditionally kill in the
12496         future this.   I am more and more convinced that the .NET
12497         framework has special code to handle the attribute setting on
12498         certain elements.
12499
12500         * expression.cs (IsParamsMethodApplicable): Revert my previous
12501         foreach change here, it was wrong.
12502
12503 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12504
12505         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12506         (pp_expr): do not abort on unknown input, just return.
12507         (eval): abort if there are pending chars.
12508
12509         * attribute.cs (Attribute.Resolve): Positional parameters are
12510         optional.  Deal with that case.
12511
12512         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12513         the Ansi/Unicode/Auto information for the type.
12514
12515         (TypeContainer.DefineType): instantiate the EmitContext here, as
12516         we will be using it during the type definition (to resolve
12517         attributes) and during the emit phase.
12518
12519         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12520         to pull type information out of the attributes
12521
12522         (Attribute.Resolve): track the constructor builder, and allow for
12523         multiple invocations (structs and classes will use this).
12524
12525         * ecore.cs (MemberLookupFinal): new version with all the
12526         parameters customizable.
12527
12528         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12529         constructors.  Return if the result value is null (as the error
12530         would have been flagged already by MemberLookupFinal)
12531
12532         Do not allow instances of abstract classes or interfaces to be
12533         created.
12534
12535         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12536         We have to compare the assembly property here when dealing with
12537         FamANDAssem and Assembly access modifiers, because we might be
12538         creating an assembly from *modules* (that means that we are not
12539         getting TypeBuilders for types defined in other modules that are
12540         part of this assembly).
12541
12542         (Method.Emit): If the method is marked abstract and has a body,
12543         emit an error. 
12544
12545         (TypeContainer.DefineMembers): If both the defined member and the
12546         parent name match are methods, then do not emit any warnings: let
12547         the Method.Define routine take care of flagging warnings.  But if
12548         there is a mismatch (method overrides something else, or method is
12549         overriwritten by something, then emit warning).
12550
12551         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12552         set to null, this means `do not check for the return type on the
12553         signature'. 
12554
12555         (Method.Define): set the return type for the method signature to
12556         null, so that we get methods with the same name and parameters and
12557         different return types.  This is used to flag warning 114 (you are
12558         hiding a method, and you probably want to use the new/override
12559         keywords instead).
12560
12561         * typemanager.cs (MemberLookup): Implemented proper access
12562         control, closing a long standing set of bug reports.  The problem
12563         was that the Framework only has two bits: Public and NonPublic,
12564         and NonPublic includes private and protected methods, but we need
12565         to enforce the FamANDAssem, FamOrAssem and Family. 
12566
12567 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
12568
12569         * statement.cs (GotoCase): Return true: Ammounts to giving up
12570         knowledge on whether we return or not, and letting the other case
12571         be responsible for it.
12572
12573 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
12574
12575         * driver.cs: Do not load directories for each file processed, only
12576         do it if there is a pattern.
12577
12578         * ecore.cs: Report readonly assigns here as well, as we might have
12579         been resolved only by MemberAccess.
12580
12581         (SimpleName.SimpleNameResolve): Also be useful for LValue
12582         resolution.   We need this to propagate assign to local readonly variables
12583
12584         * typemanager.cs: Use a ptrhashtable for the criteria, because we
12585         do not want to reuse potential criteria memory.
12586
12587         * class.cs (MyEventBuilder): Set reflected_type;
12588
12589         * ecore.cs (Constantify): Added support for constifying bools.
12590
12591         (RootContext.LookupType): Added a cache for values looked up in
12592         the declaration space.
12593
12594         * typemanager.cs (FindMembers): Now is a front-end to
12595         RealFindMembers, and provides a two-level hashtable-based cache to
12596         the request.  
12597
12598         15% performance improvement: from 22.5 to 19.2 seconds.
12599
12600         * expression.cs (IsParamsMethodApplicable): use foreach.
12601         (Invocation.DoResolve): ditto.
12602         (New.DoResolve): ditto.
12603         (ArrayCreation.DoResolve): ditto.
12604
12605         * ecore.cs (FindMostEncompassingType): use foreach.
12606
12607         * delegate.cs (NewDelegate.DoResolve): Use foreach
12608
12609         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
12610         (RemoveMethods): use foreach.
12611
12612         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
12613         nested foreach statements instead of for, and also break out of
12614         the inner loop once a match is found.
12615
12616         (Invocation.OverloadResolve): Use foreach, simplify the code. 
12617
12618 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
12619
12620         * cfold.cs (BinaryFold): During an enumeration evaluation context,
12621         we actually unwrap the expression to allow for extra information
12622         to be extracted. 
12623
12624         * expression.cs: Use Shr_Un on unsigned operations. 
12625
12626 2002-05-08  Ravi Pratap  <ravi@ximian.com>
12627
12628         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
12629         applicable operators was not being considered correctly. This closes
12630         the bug Miguel reported.
12631
12632 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
12633
12634         * attribute.cs: check that the type derives from System.Attribute
12635         and report the correct error in that case (moved the duplicate code to
12636         its own method, too).
12637
12638 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
12639
12640         * attribute.cs: lookup attribute type name as the spec says: first the
12641         bare attribute name and then name + "Attribute" (nant compiles with
12642         mcs after this fix).
12643
12644 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
12645
12646         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
12647         Because of the way we parse things, we should try to see if a
12648         UIntConstant can fit in an integer.
12649
12650 2002-05-07  Ravi Pratap  <ravi@ximian.com>
12651
12652         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
12653         when we are in an explicit context.
12654
12655         (ConvertReferenceExplicit): When converting from Iface type S to Class
12656         T make sure the rules are implemented as an OR.
12657
12658         * parameter.cs (ParameterType): Make it a property for now although the
12659         purpose really isn't anything immediate.
12660
12661         * expression.cs (Is*Applicable): Do better checking on the parameter type
12662         of a ref/out parameter. The ones from the system assemblies are already 
12663         marked with the correct type so we don't need to do any correction.
12664
12665         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
12666         the object type is standard too so include that.
12667
12668 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * ecore.cs (StandardConversionExists): Augment with missing code:
12671         deal with IntConstant, LongConstants and Enumerations.
12672
12673         * assign.cs: Report the error, instead of failing silently
12674
12675         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
12676         typecontainer that they are declared, because the
12677         typecontainer/namespace will have the list of using clauses that
12678         need to be applied.
12679
12680         Assembly Attributes were escaping the normal registration
12681         mechanism. 
12682
12683         (EmitCode): Apply attributes within an EmitContext that represents
12684         the container they were declared on.
12685
12686         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
12687
12688 2002-05-06  Ravi Pratap  <ravi@ximian.com>
12689
12690         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
12691         Revamp completely - make much cleaner as we now operate only
12692         on a set of Types.
12693
12694         (FindMostSpecificSource, FindMostSpecificTarget): New methods
12695         to implement the logic detailed in the spec more correctly.
12696
12697         (UserDefinedConversion): Update accordingly.
12698
12699 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12700
12701         * statement.cs: Return flow analysis information up.
12702
12703         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
12704         and the default.
12705
12706         (token): Do not consume an extra character before calling
12707         decimal_digits.
12708
12709 2002-05-06  Piers Haken <piersh@friskit.com>
12710
12711         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
12712
12713 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12714
12715         * class.cs (Constructor.Emit): Set the IsStatic flag in the
12716         EmitContext during the instance constructor initializer
12717         resolution, to stop access to instance variables.
12718
12719         This is mandated by the spec, last paragraph of the `constructor
12720         initializers' section. 
12721
12722 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
12723
12724         * cs-parser.jay, class.cs (Accessor): new class used to represent
12725         an accessor (get or set).  In the past we used `null' to represent
12726         a missing accessor.  But this is ambiguous because there was no
12727         way to tell in abstract indexers/properties if one of them was
12728         specified.
12729
12730         Now there is a way of addressing that.
12731
12732         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
12733         instead of FindMembers.
12734
12735         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
12736         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
12737
12738         * attribute.cs: Treat indexers and properties as the same in terms
12739         of applying attributes
12740
12741         * ecore.cs (FindMostEncompassedType): Use statically initialized
12742         EmptyExpressions()s like we do elsewhere to avoid creating useless
12743         objects (and we take this out of the tight loop).
12744
12745         (GetConversionOperators): Move the code to extract the actual
12746         operators to a separate routine to clean things up.
12747
12748 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
12749
12750         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
12751         events are always registered FieldBuilders.
12752
12753         * class.cs (FieldBase): New class shared by Fields 
12754
12755         * delegate.cs: If we are a toplevel delegate, use our full name.
12756         If we are a nested delegate, then only use our tail name.
12757
12758 2002-05-02  Ravi Pratap  <ravi@ximian.com>
12759
12760         * expression.cs (IsApplicable): Ensure that we add the "&" to
12761         ref/out types before comparing it with the type of the argument.
12762
12763         (IsParamsMethodApplicable): Ditto.
12764
12765         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
12766         silly me ;-)
12767
12768         * delegate.cs : Handle the case when we have more than one applicable
12769         method. Flag an error only when we finish checking all.
12770
12771 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
12772
12773         * expression.cs: Add support for boolean static initializers.
12774
12775 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
12776
12777         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
12778
12779         * parameter.cs (ComputeParameterTypes,
12780         ComputeAndDefineParameterTypes): Better error handling: now we
12781         clear the `types' cache if we fail during any of the type lookups.
12782         We also return the status code correctly to our caller
12783
12784         * delegate.cs: If we fail to define a delegate, abort the extra
12785         steps. 
12786
12787         * expression.cs (Binary.ResolveOperator): for
12788         operator==(object,object) and operator !=(object, object) we also
12789         have to verify that there is an implicit conversion from one to
12790         the other.
12791
12792         (ArrayAccess.DoResolve): Array Access can operate on
12793         non-variables. 
12794
12795 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
12796
12797         * assign.cs (CompoundAssign): A new class used as a "flag" that
12798         the assignment actually is happening as part of a compound
12799         assignment operator.
12800
12801         During compound assignment, a few new rules exist to enable things
12802         like:
12803
12804         byte b |= 1 + 2
12805
12806         From the spec:
12807
12808         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
12809         to the type of x) if y is implicitly convertible to the type of x,
12810         and the operator is a builtin operator and the return type of the
12811         operator is explicitly convertible to the type of x. 
12812
12813         * rootcontext.cs: Reset warning level to 2.  4 catches various
12814         "interesting" features in mcs, we must clean this up at some
12815         point, but currently am trying to kill other bugs ;-)
12816
12817         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
12818         in container classes as well.  
12819
12820         * expression.cs (Binary.ResolveOperator): Handle string case
12821         before anything else (as operator overloading does emit an error
12822         before doing anything else).
12823
12824         This code could go away when we move to a table driven model, but
12825         i could not come up with a good plan last night.
12826
12827 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
12828
12829         * typemanager.cs (CSharpName): reimplementation using regex.
12830         * class.cs: added null check for fields in Emit
12831         * rootcontext.cs: set warninglevel to 4
12832
12833 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
12834
12835         * typemanager.cs (CSharpName): reimplemented with Lupus
12836         suggestion.
12837
12838 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
12839
12840         * statement.cs (If): correclty implement Resolve, because we were
12841         not catching sem errors in there.  The same process is needed
12842         everywhere else. 
12843         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
12844
12845
12846         (Statement.Warning_DeadCodeFound): Factorize code.
12847         (While): Report dead code here too.
12848
12849         (Statement): Added Resolve virtual method to allow
12850         for resolution split from the emit code.
12851
12852 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
12853
12854         * statement.cs (EmitBoolExpression): No longer try to resolve the
12855         expression here.    
12856         (MakeBoolean): New utility function that resolve, implicitly
12857         converts to boolean and tags the expression. 
12858
12859
12860         (If, Do): Implement dead code elimination.
12861         (While): Implement loop inversion
12862
12863         (Do, While, For, If): Resolve the expression prior to calling our
12864         code generation.
12865
12866 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
12867
12868         * class.cs:
12869           - added method Report28 (warning: program has more than one entry point)
12870           - added method IsEntryPoint, implements paragraph 10.1 of the spec
12871           - modified method Method.Define, the part at the end of the method
12872
12873         * rootcontext.cs: added static public Location EntryPointLocation;
12874           
12875         * ../errors/cs0028.cs : Add test case for the above warning.              
12876
12877         * typemanager.cs:
12878           - modified method CSharpName to allow arrays of primitive type to
12879             be printed nicely (e.g. instead of System.Int32[][] it now prints
12880             int[][])
12881           - added method CSharpSignature: returns the signature of a method
12882             in string format to be used in reporting errors, warnings, etc.
12883
12884         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
12885         with String.Empty.
12886
12887 2002-04-26  Ravi Pratap  <ravi@ximian.com>
12888
12889         * delegate.cs (Define): Fix extremely silly bug where I was
12890         setting the type of the 'object' parameter of the BeginInvoke
12891         method to System.IAsyncResult instead of System.Object ;-)
12892
12893 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
12894
12895         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
12896         here. 
12897
12898         (Constructor.Emit): return if we fail to initialize the
12899         constructor.  Another door closed!  
12900
12901         * expression.cs (New.DoResolve): Improve error message (from -6 to
12902         1501).  Use DeclaredOnly lookup to find the exact constructor.
12903
12904         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
12905         loop.  This is useful.
12906
12907         * cs-parser.jay: Adjust the default parameters so that destructors
12908         have the proper signature.
12909
12910 2002-04-26  Martin Baulig  <martin@gnome.org>
12911
12912         * driver.cs (LoadAssembly): If `assembly' contains any characters
12913         which are only valid in path names and not in assembly names
12914         (currently slash, backslash and point), use Assembly.LoadFrom ()
12915         instead of Assembly.Load () on the `assembly' (before iteration
12916         over the link_paths).
12917
12918 2002-04-26  Martin Baulig  <martin@gnome.org>
12919
12920         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
12921
12922 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
12923
12924         * class.cs (Property): use the new typemanager.MemberLookup
12925
12926         (TypeContainer.MemberLookup): Implement using the
12927         TypeManager.MemberLookup now. 
12928
12929         * typemanager.cs: Make MemberLookup a function of the TypeManager,
12930         and return MemberInfos, so that these can be used without an
12931         EmitContext (what we had before).
12932
12933 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * expression.cs: Fix the case where the argument to params if the
12936         type of the params.  I omitted handling this before.   Fixed
12937
12938 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * driver.cs: Call BootCorlib_PopulateCoreType
12941
12942         * class.cs (Property.CheckBase): Check for properties only, not
12943         for all members. 
12944
12945         * interface.cs: Temporary hack: try/catch around the
12946         CustomAttributeBuilder, because I am getting an exception that I
12947         do not understand.
12948
12949         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
12950         types whose definitions are required to be there (attributes are
12951         defined before standard types).
12952
12953         Compute definitions as we boot the various types, as they are used
12954         immediately (value_type class will need object_type, but if we do
12955         not initialize object_type, we will pass a null, which will let
12956         the runtime pick the System.Object from the existing corlib, which
12957         is not what we want).
12958
12959 2002-04-22  Patrik Torstensson <totte@labs2.com>
12960
12961         * cs-tokenizer.cs: fixed a number of trim() issues.
12962
12963 2002-04-22  Ravi Pratap  <ravi@ximian.com>
12964
12965         * expression.cs (Argument.Type): Ensure that we return the correct
12966         type when we have out or ref parameters [in which case we 
12967         append a "&"].
12968
12969 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
12970
12971         * class.cs (Property, Indexer): Allow extern modifier in there. 
12972
12973         * typemanager.cs (InitBaseTypes): Initializes object_type and
12974         value_type, since those will be used early on during the bootstrap
12975         process to compile corlib.
12976
12977         (InitCoreTypes): Move code from here to InitBaseTypes.
12978
12979 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
12980
12981         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
12982         single-dimension arrays as using the ldlen opcode.  
12983
12984         Daniel Lewis discovered this optimization.  
12985
12986         * typemanager.cs: Add signature for System.Array::get_Length
12987
12988 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12989
12990         * statement.cs: report the error when the foreach does not apply to an
12991         array nor a collection.
12992
12993 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
12994
12995         * expression.cs: Add implicit conversions to the operator ~.
12996
12997         * constant.cs (DecimalConstant.Emit): Emit decimal value.
12998
12999         * typemanager.cs: Locate the decimal constructor.
13000
13001 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13002
13003         * attribute.cs: use the new property of TypeOf.
13004         * expression.cs: added 'get' property around typearg.
13005
13006         These changes fix a build breaker reported by NickD. Is this the
13007         correct way to fix?  If not, please, revert my changes and make it
13008         work :-).
13009
13010 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13011
13012         * attribute.cs: Add support for typeof in attribute invocations.
13013         I am not sure that this is right though.
13014
13015 2002-04-14  Duncan Mak  <duncan@ximian.com>
13016
13017         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13018         Binary.Operator.Division case.
13019
13020 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13021
13022         * class.cs (DefineType): Ensure that we do a proper check on
13023         attribute types and also register it with the TypeManager.
13024
13025         (TypeContainer.Targets): The default for attribute types is
13026         AttributeTargets.All.
13027
13028         * attribute.cs (ApplyAttributes): Registering the attribute type
13029         is done elsewhere, not when we discover we have a Usage attribute.
13030
13031 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13032
13033         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13034         and get rid of is_delegate parameter.
13035
13036         * everywhere : update.
13037
13038 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13039
13040         * cs-parser.jay (compilation_unit): Revamp completely to use
13041         some new ideas that I got from Rhys' grammar to solve the problems
13042         with assembly level attributes.
13043
13044         (outer_declaration): New grammar production.
13045
13046         (attribute_sections): Add.
13047
13048         (opt_attributes): Base on attribute_sections
13049
13050         (namespace_declaration): Allow opt_attributes to tackle the case
13051         when we have assembly level attributes - we are clever in this
13052         regard now ;-)
13053
13054         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13055         attributes in the non-global context.
13056
13057         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13058         instead of SetGlobalAttributes.
13059
13060         * class.cs, rootcontext.cs : Ensure we define and generate 
13061         attribute types before anything else.
13062
13063         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13064         and flag the new error -20 for the case when the attribute type
13065         does not have valid targets specified. csc does not catch this.
13066
13067         * ../errors/errors.txt : update for error # -20
13068
13069 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13070
13071         * support.cs (InternalParameters.ParameterModifier): Do some null
13072         checking and return sane values.
13073
13074         * class.cs (Method.Define): If we are a PInvoke method, ensure
13075         that we are static and extern. Report error # 601
13076
13077         * ../errors/cs0601.cs : Add test case for the above error.
13078
13079 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13080
13081         * rootcontext.cs (attribute_types): We need to keep type of
13082         all attribute types separately and emit code for them first.
13083
13084         (RegisterAttribute) : Implement.
13085
13086         * class.cs (DefineType): Check if the current Type is a custom
13087         attribute type and register it accordingly.
13088
13089         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13090         adding the first attribute twice and rename to
13091
13092         (SetGlobalAttributes): this.
13093
13094         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13095         lookups.
13096
13097         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13098         if we are processing global arguments. Hmm, I am unsure of this.
13099
13100 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13101
13102         * expression.cs: added static array of strings to avoid calling
13103         Enum.ToString () for Operator in Binary. Significant recover of
13104         performance.
13105
13106 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13107
13108         * class.cs (FindMembers): Allow the Builders of the various
13109         members to be null.  If they are skip them.  This only happens
13110         during the PInvoke declaration.
13111
13112 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13113
13114         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13115         failure, so we do not keep going afterwards.
13116
13117         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13118         wanted to pass `false' as the `is_delegate' argument.  If this is
13119         the case, why not use delegate_type == null to mean `is_delegate =
13120         false' and anything else as is_delegate = true.
13121
13122 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13123
13124         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13125         code for the section, not the beginning of the tests.
13126
13127 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13128
13129         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13130
13131         * expression.cs (Binary): same.  Warn about errors where we have
13132         Enum/Enum in operator + as well.
13133
13134 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13135
13136         * statement.cs:
13137                 - added support for switch(bool)
13138                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13139                 - add TableSwitchEmit() to handle table-based switch statements
13140
13141 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13142
13143         * expression.cs (Invocation.OverloadResolve): Factor out code which
13144         does parameter compatibility checking with arguments so that we can 
13145         re-use the code even from Delegate.VerifyApplicability
13146
13147         (VerifyArgumentsCompat): Move above code here.
13148
13149         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13150         and instead make a call to the above method.
13151
13152 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13153
13154         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13155         We use it to keep track of classes which are attribute types.
13156
13157 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13158
13159         * delegate.cs (Delegate.Define): Correctly define the types in the
13160         presence of fixed and array parameters.
13161
13162         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13163         doing FindMembers.
13164
13165         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13166         include NonPublic after the first iteration.
13167
13168         * class.cs (Indexer.CheckBase): Only check if both parents are
13169         non-null. 
13170
13171         * cs-parser.jay (accessor_body): If empty, set to null.
13172
13173         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13174         same code path here to resolve constants names that we did have in
13175         MemberAccess.DoResolve.  There is too much code duplicated here.
13176
13177 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13178
13179         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13180
13181         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13182         to MakeUnionSet.
13183
13184         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13185         tokens, numbers and strings.
13186
13187         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13188         parenthesis.
13189
13190         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13191         asyncronous parameters and the regular parameters.  
13192
13193         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13194         specify the target directory.
13195
13196         * expression.cs: (This.DoResolve): Simplify
13197         (As.Emit): Optimize, do not generate IsInst if the expression is
13198         always of the given type.
13199
13200         (Is.DoResolve): Bug fix, we were reporting both always/never for
13201         the is expression.
13202
13203         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13204         creating too many unnecessary arrays.
13205
13206 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13207
13208         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13209         fields instead of rolling our own initializer.   Takes care of all
13210         implicit conversions, and drops unnecessary static checks/argument.
13211
13212 2002-03-31  Dick Porter  <dick@ximian.com>
13213
13214         * driver.cs: use the GetDirectories() return values properly, and
13215         use "/" as path separator.
13216
13217 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13218
13219         * expression.cs (Unary): Optimize - - expr into expr.
13220         (Binary): Optimize a + (-b) into a -b.
13221
13222         * codegen.cs (CodeGen): Made all methods static.
13223
13224 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13225
13226         * rootcontext.cs: 
13227
13228         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13229         TypeBuilder property.
13230
13231         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13232         instead. 
13233
13234         * tree.cs: Removed the various RecordXXXX, and replaced with a
13235         single RecordDecl.  Removed all the accessor methods, and just
13236         left a single access point Type 
13237
13238         * enum.cs: Rename DefineEnum to DefineType.
13239
13240         * decl.cs: New abstract method `DefineType' used to unify the
13241         Defines for Enumerations, Interfaces, TypeContainers and
13242         Delegates.
13243
13244         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13245         LookupBaseClasses method that used to live in class.cs and
13246         interface.cs here, and renamed to FindType.
13247
13248         * delegate.cs: Implement DefineType.  Take advantage of the
13249         refactored pattern for locating the parent builder without taking
13250         the parent_builder argument (which we know does not work if we are
13251         nested, and triggering a toplevel definition).
13252
13253 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13254
13255         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13256         accessibility of a member has changed during override and report
13257         an error if so.
13258
13259         * class.cs (Method.Define, Property.Define): Only complain on
13260         overrides if the method is private, any other accessibility is
13261         fine (and since we just checked the permission is the same, we are
13262         good to go).
13263
13264         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13265         and elif are processed always.  The other pre-processing
13266         directives are only processed if we are "taking" the path
13267
13268 2002-03-29  Martin Baulig  <martin@gnome.org>
13269
13270         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13271         current location is not Null.
13272
13273         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13274         a separate method so we can profile it.
13275
13276         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13277         `span.Seconds' are just seconds, but no minutes or hours.
13278         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13279
13280 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13283         Remove the gratuitous set of Final:
13284
13285                                 // If an interface implementation, then we can set Final.
13286                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13287                                     implementing.DeclaringType.IsInterface)
13288                                         flags |= MethodAttributes.Final;
13289
13290         I do not know what I was smoking when I used that.
13291
13292
13293         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13294         step into fixing the name resolution issues for delegates and
13295         unifying the toplevel name resolution.
13296
13297 2002-03-28  Martin Baulig  <martin@gnome.org>
13298
13299         * class.cs (Method.Emit): If we have a symbol writer, call its
13300         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13301         tell it about the current method.
13302
13303         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13304         writer that we're going to emit the first byte of IL code for a new
13305         statement (a new source line).
13306         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13307         EmitContext.Mark() before emitting any code.
13308
13309         * location.cs (SymbolDocument): Return null when we're Null.
13310
13311         * statement.cs (Statement): Moved the `Location loc' variable here.
13312         (Statement.EmitBoolExpression): If we have a symbol writer, call
13313         ec.Mark() before emitting any code to tell it that we're at the
13314         beginning of a new statement.
13315         (StatementExpression): Added `Location' argument to the constructor.
13316         (Block): Added public readonly variable `StartLocation' and public
13317         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13318         (Block): Added constructor which takes a start and end location.
13319         (Block.SetEndLocation): New method. This sets the end location.
13320         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13321         local variables we create.
13322         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13323         each statement and do also mark the begin and end of the block.
13324
13325         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13326         tell it the current lexer.Location, use Location.Null for the end of the
13327         block.
13328         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13329         current block, set its end location using SetEndLocation().
13330         (statement_expression): StatementExpression constructor now takes the
13331         lexer.Location as additional argument.
13332         (for_statement, declare_local_variables): Likewise.
13333         (declare_local_variables): When creating a new implicit block, use the
13334         new Block constructor and pass it the lexer.Location.
13335
13336 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13339         members also on the parent interfaces recursively.
13340
13341 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13342
13343         * report.cs: Use new formats, since Gonzalo finished the missing
13344         bits. 
13345
13346         * expression.cs (Binary.ResolveOperator): added missing operator|
13347         operator& and operator^ for bool/bool.
13348
13349         * cs-parser.jay: CheckDef now takes a Location argument that is
13350         used to report errors more precisly (instead of reporting the end
13351         of a definition, we try to track something which is a lot closer
13352         to the source of the problem).
13353
13354         * cs-tokenizer.cs: Track global token use, so we can properly flag
13355         the use of #define/#undef after the first token has been seen.
13356
13357         Also, rename the reportXXXX to Error_DescriptiveName
13358
13359         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13360         TypeContainer, so that Enum and Interface can use this too.
13361
13362         * class.cs (TypeContainer.LookupInterfaceOrClass,
13363         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13364         `builder' argument.  Typically this was used to pass the parent
13365         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13366         the definition).  
13367
13368         The problem is that a nested class could trigger the definition of
13369         a toplevel class, and the builder would be obviously wrong in that
13370         case. 
13371
13372         So we drop this argument, and we compute dynamically the
13373         TypeBuilder/ModuleBuilder (the correct information was available
13374         to us anyways from DeclSpace.Parent)
13375
13376         * interface.cs (Interface.DefineInterface): Drop builder
13377         parameter cleanup like class.cs
13378
13379         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13380         like class.cs
13381
13382         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13383         values. 
13384
13385         (Try.Emit): Propagate the returns value from the statement.
13386
13387         (Return.Emit): Even if we are leavning 
13388
13389         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13390
13391         * modifiers.cs: Fix the computation of MethodAttributes flags.
13392
13393 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13394
13395         * driver.cs: allow compilation of files that start with '/'.
13396         Add a default case when checking the argument of --target.
13397
13398 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * interface.cs: Implement the same search algorithm for types in
13401         the interface code.
13402
13403         * delegate.cs: Do not allow multiple definition.
13404
13405         * Recovered ChangeLog that got accidentally amputated
13406
13407         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13408
13409         * rootcontext.cs: Load manually enum to allow core classes to
13410         contain enumerations.
13411
13412         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13413         Update to new static methods in TypeManager.
13414
13415         * typemanager.cs (GetMethod, GetConstructor): Use our
13416         implementation of FindMembers to find the members, since during
13417         corlib compilation, the types are TypeBuilders and GetMethod and
13418         GetConstructor do not work.
13419
13420         Make all methods in TypeManager static.
13421
13422         (InitCodeHelpers): Split the functionality from
13423         the InitCodeTypes function.
13424
13425         * driver.cs: Call InitCodeHelpers after we have populated the
13426         types. 
13427
13428         * cs-parser.jay (delegate_declaration): we did not used to compute
13429         the delegate name correctly for void delegates.
13430
13431 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * rootcontext.cs (RootContext): Init the interface_resolve_order
13434         and type_container_resolve_order always.
13435
13436         (ResolveCore, BootstrapCorlib_ResolveClass,
13437         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13438         compiler when compiling with --nostdlib
13439
13440         * class.cs (TypeContainer.DefineType): Check that our parent is
13441         not null.  This test is most important when we are bootstraping
13442         the core types.
13443
13444         * codegen.cs: Split out the symbol writing code.
13445
13446 2002-03-25  Martin Baulig  <martin@gnome.org>
13447
13448         * driver.cs (-g): Made -g an alias for --debug.
13449
13450 2002-03-24  Martin Baulig  <martin@gnome.org>
13451
13452         * codegen.cs (SymbolWriter): New public variable. Returns the
13453         current symbol writer.
13454         (CodeGen): Added `bool want_debugging_support' argument to the
13455          constructor. If true, tell the ModuleBuild that we want debugging
13456         support and ask it for the ISymbolWriter.
13457         (Save): If we have a symbol writer, call it's Close() method after
13458         saving the assembly.
13459
13460         * driver.c (--debug): New command line argument to create a
13461         debugger information file.
13462
13463         * location.cs (SymbolDocument): New public property. Returns an
13464         ISymbolDocumentWriter object for the current source file or null
13465         if we don't have a symbol writer.
13466
13467 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13468
13469         * driver.cs (LoadAssembly): Correctly return when all the paths
13470         have been tried and not before.
13471
13472         * statement.cs (Switch.Emit): return the actual coverage for this
13473         statement (returns/not-returns)
13474
13475         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13476         switch of the statement if we are the last switch section.  That
13477         kills two problems: try/catch problems (we used to emit an empty
13478         nop at the end) and switch statements where all branches would
13479         return. 
13480
13481 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13482
13483         * driver.cs: Add default assemblies (the equivalent to the
13484         Microsoft CSC.RSP file)
13485
13486         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13487         also update tokens_seen and set it to false.
13488
13489         * driver.cs: Implement --recurse for Mike.
13490
13491         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13492         correctly splitting out the paths.
13493
13494 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13495
13496         * interface.cs (Interface.PopulateProperty): Instead of using
13497         `parent' as the declaration space for the set parameters, use
13498         `this' 
13499
13500         * support.cs (InternalParameters): InternalParameters constructor
13501         takes a DeclSpace instead of a TypeContainer.
13502
13503         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13504         types are being initialized, load the address of it before calling
13505         the function.  
13506
13507         (New): Provide a mechanism to disable the generation of local
13508         value type temporaries when the caller will be providing us with
13509         an address to store it.
13510
13511         (ArrayCreation.EmitDynamicInitializers): Use it.
13512
13513 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13514
13515         * expression.cs (Invocation.EmitArguments): Only probe for array
13516         property if there is more than one argument.  Sorry about that.
13517
13518         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13519         empty param arrays.
13520
13521         * class.cs (Method.LabelParameters): Fix incorrect code path that
13522         prevented the `ParamArrayAttribute' from being applied to the
13523         params attribute.
13524
13525 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13526
13527         * support.cs (ReflectionParameters): Correctly compute whether the
13528         last argument is a params array.  Fixes the problem with
13529         string.Split ('a')
13530
13531         * typemanager.cs: Make the assemblies array always be non-null
13532         (empty, but non-null)
13533
13534         * tree.cs (RecordDecl): New function that abstracts the recording
13535         of names.  This reports error 101, and provides a pointer to the
13536         previous declaration.  Fixes a crash in the compiler.
13537
13538         * cs-parser.jay (constructor_declaration): Update to new grammar,
13539         and provide a constructor_body that can be empty.
13540
13541 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13542
13543         * driver.cs: Add support for --resources.
13544
13545         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13546         Make all types for the various array helper methods be integer.
13547
13548         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13549         CheckState to ConvCast.
13550
13551         (ConvCast): Now it takes a `checked' state argument, to avoid
13552         depending on the emit context for the conversion, and just using
13553         the resolve time setting.
13554
13555         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13556         instead of Invocation.EmitArguments.  We do not emit the original
13557         arguments, instead we emit those which have been converted to
13558         unsigned int expressions.
13559
13560         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13561
13562         * codegen.cs: ditto.
13563
13564         * expression.cs (LocalVariableReference): Drop the use of the
13565         Store function that depended on the variable index.
13566
13567         * statement.cs (VariableInfo): Drop the `Idx' property from this
13568         class, as this is not taking into account the indexes for
13569         temporaries tat we generate during the execution, getting the
13570         indexes wrong.
13571
13572         * class.cs: First emit class initializers, then call the parent
13573         constructor. 
13574
13575         * expression.cs (Binary): Fix opcode emision.
13576         (UnaryMutator.EmitCode): Support checked code generation
13577
13578         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13579         matches for events for both the Static and Instance scans,
13580         pointing to the same element.   Fix that.
13581
13582 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
13583
13584         * rootcontext.cs (ResolveTree): Always set the
13585         interface_resolve_order, because nested interfaces will be calling
13586         into us.
13587
13588         * class.cs (GetInterfaceOrClass): Track the same resolution
13589         process used by TypeManager.LookupType.  This fixes the nested
13590         type lookups in class declarations (separate path from
13591         LookupType). 
13592
13593         (TypeContainer.DefineType): Also define nested interfaces.
13594         (TypeContainer.RegisterOrder): New public function used to
13595         register the order in which child interfaces need to be closed.
13596
13597         Nested interfaces need to be closed after their parents have been
13598         created. 
13599
13600         * interface.cs (InterfaceAttr): Put all the logic for computing
13601         the interface attribute here. 
13602
13603         (DefineInterface): Register our interface order with the
13604         RootContext or with the TypeContainer depending on the case.
13605
13606 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13607
13608         * cs-parser.jay: rework foreach statement to work with the new
13609         changes to the policy on SimpleNames.
13610
13611         * report.cs: support Stacktrace on warnings as well.
13612
13613         * makefile: drop --unsafe and /unsafe from the compile.
13614
13615 2002-03-13  Ravi Pratap  <ravi@ximian.com>
13616
13617         * ecore.cs (StandardConversionExists): Modify to take an Expression
13618         as the first parameter. Ensure we do null -> reference type conversion
13619         checking.
13620
13621         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
13622         temporary Expression objects.
13623
13624 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
13625
13626         * interface.cs: workaround bug in method overloading resolution
13627         (there is already a bugzilla bug for it).
13628
13629 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13630
13631         We could also solve this problem by having a separate path for
13632         performing type lookups, instead of DoResolve, we could have a
13633         ResolveType entry point, and only participating pieces of the
13634         production (simplename, deref, array) would implement this. 
13635
13636         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
13637         signal SimpleName to only resolve type names and not attempt to
13638         resolve anything else.
13639
13640         * expression.cs (Cast): Set the flag.
13641
13642         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
13643
13644         * class.cs: Only report 108 if there is no `new' modifier.
13645
13646         * cs-parser.jay: rework foreach statement to work with the new
13647         changes to the policy on SimpleNames.
13648
13649         * report.cs: support Stacktrace on warnings as well.
13650
13651         * makefile: drop --unsafe and /unsafe from the compile.
13652
13653 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
13656         lookups here, instead of doing that at parse time.  This means
13657         that our grammar will not introduce `LocalVariableReferences' as
13658         expressions at this point.  That solves the problem of code like
13659         this:
13660
13661         class X {
13662            static void Main ()
13663            { int X = 1;
13664             { X x = null }}}
13665
13666         This is only half the fix.  The full fix requires parameters to
13667         also be handled in this way.
13668
13669         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
13670         makes the use more obvious of the DeclSpace.  The
13671         ec.TypeContainer.TypeBuilder is now only used to pull the
13672         TypeBuilder for it.
13673
13674         My theory is that I can get rid of the TypeBuilder completely from
13675         the EmitContext, and have typecasts where it is used (from
13676         DeclSpace to where it matters).  
13677
13678         The only pending problem is that the code that implements Aliases
13679         is on TypeContainer, and probably should go in DeclSpace.
13680
13681         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
13682         lookups here, instead of doing that at parse time.  This means
13683         that our grammar will not introduce `LocalVariableReferences' as
13684         expressions at this point.  That solves the problem of code like
13685         this:
13686
13687         class X {
13688            static void Main ()
13689            { int X = 1;
13690             { X x = null }}}
13691
13692         This is only half the fix.  The full fix requires parameters to
13693         also be handled in this way.
13694
13695         * class.cs (Property.DefineMethod): When implementing an interface
13696         method, set newslot, when implementing an abstract method, do not
13697         set the flag (before we tried never setting it, or always setting
13698         it, which is the difference).
13699         (Indexer.DefineMethod): same.
13700         (Method.DefineMethod): same.
13701
13702         * ecore.cs: Only set the status used flag if we get back a Field.
13703
13704         * attribute.cs: Temporary hack, so Paolo can keep working.
13705
13706 2002-03-08  Ravi Pratap  <ravi@ximian.com>
13707
13708         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
13709         the unmanaged type in the case we have a MarshalAs attribute.
13710
13711         (Resolve): Handle the case when we are parsing the special MarshalAs
13712         attribute [we need to store the unmanaged type to use later]
13713
13714         * typemanager.cs (marshal_as_attr_type): Built in type for the 
13715         MarshalAs Attribute.
13716
13717         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
13718         on parameters and accordingly set the marshalling info.
13719
13720 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
13721
13722         * class.cs: Optimizing slightly by removing redundant code after
13723         we switched to the `NoTypes' return value.
13724         (Property.DefineMethod): use NoTypes here too.
13725
13726         This fixes the bug I introduced in my last batch of changes.
13727
13728 2002-03-05  Ravi Pratap  <ravi@ximian.com>
13729
13730         * tree.cs (RecordEnum): Add. We now keep track of enums too.
13731
13732         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
13733         Enums since those are types too. 
13734
13735         * cs-parser.jay (enum_declaration): Record enums as we parse them.
13736
13737         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
13738         thanks to a call during the lookup process.
13739
13740 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
13741
13742         * statement.cs (Foreach): Lots of work to accomodate a particular
13743         kind of foreach statement that I had not kept in mind.  It is
13744         possible to have foreachs on classes that provide a GetEnumerator
13745         method that return objects that implement the "pattern" for using
13746         a foreach, there is no need to support GetEnumerator
13747         specifically. 
13748
13749         This is needed to compile nant.
13750
13751         * decl.cs: Only report 114 if the member is not `Finalize' and if
13752         the warning level is at least 2.
13753
13754         * class.cs: Moved the compare function from Method to
13755         MethodSignature. 
13756
13757         (MethodSignature.InheritableMemberSignatureCompare): Add new
13758         filter function that is used to extract inheritable methods from a
13759         class. 
13760
13761         (Method.Define): Use the new `inheritable_method_signature_filter'
13762         delegate
13763
13764         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
13765         command. 
13766
13767 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
13768
13769         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
13770
13771         * cs-parser.jay: Add opt_semicolon to the interface declaration.
13772
13773         * expression.cs: Pass location information to
13774         ConvertImplicitStandard. 
13775
13776         * class.cs: Added debugging code to track return values from
13777         interfaces. 
13778
13779 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * expression.cs (Is.DoResolve): If either side of the `is' is an
13782         interface, do not flag the warning.
13783
13784         * ecore.cs (ImplicitReferenceConversion): We need a separate test
13785         for interfaces
13786
13787         * report.cs: Allow for --fatal to be used with --probe.
13788
13789         * typemanager.cs (NoTypes): Move the definition for the empty Type
13790         array here. 
13791
13792         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
13793         properties. 
13794         (TypeContainer.DefineProxy): New function used to proxy to parent
13795         implementations when implementing interfaces.
13796         (TypeContainer.ParentImplements): used to lookup if our parent
13797         implements a public function that is required by an interface.
13798         (TypeContainer.VerifyPendingMethods): Hook this up.
13799
13800         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
13801         `modules' and `assemblies' arraylists into arrays.  We only grow
13802         these are the very early start up of the program, so this improves
13803         the speedof LookupType (nicely measured).
13804
13805         * expression.cs (MakeByteBlob): Replaced unsafe code with
13806         BitConverter, as suggested by Paolo.
13807
13808         * cfold.cs (ConstantFold.Binary): Special case: perform constant
13809         folding of string concatenation, but if either side is a string,
13810         and the other is not, then return null, and let the runtime use
13811         the concatenation on the string plus the object (using
13812         `Object.ToString'). 
13813
13814 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
13815
13816         Constant Folding has been implemented now.
13817
13818         * expression.cs (Unary.Reduce): Do not throw an exception, catch
13819         the error instead on types that are not supported in one's
13820         complement. 
13821
13822         * constant.cs (Constant and all children): New set of functions to
13823         perform implict and explicit conversions.
13824
13825         * ecore.cs (EnumConstant): Implement the new functions to perform
13826         conversion by proxying to the child expression.
13827
13828         * codegen.cs: (ConstantCheckState): Constant evaluation has its
13829         own separate setting that can not be turned off from the command
13830         line using --unchecked or --checked and is only controlled using
13831         the checked/unchecked statements and expressions.  This setting is
13832         used by the constant folder to flag errors.
13833
13834         * expression.cs (CheckedExpr, UncheckedExpr): Set the
13835         ConstantCheckState as well.   
13836
13837         During Resolve, they also have to flag the state, because the
13838         constant folder runs completely in the Resolve phase.
13839
13840         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
13841         well.
13842
13843 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
13844
13845         * cfold.cs: New file, this file contains the constant folder.
13846
13847         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
13848         argument to track whether we are using the resulting address to
13849         load or store a value and provide better error messages. 
13850
13851         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
13852         new AddressOf arguments.
13853
13854         * statement.cs (Foreach.EmitCollectionForeach): Update
13855
13856         * expression.cs (Argument.Emit): Call AddressOf with proper
13857         arguments to track usage.
13858
13859         (New.DoEmit): Call AddressOf with new arguments.
13860
13861         (Unary.Emit): Adjust AddressOf call.
13862
13863 2002-03-01  Ravi Pratap  <ravi@ximian.com>
13864
13865         * cs-parser.jay (member_access): Change the case for pre-defined types
13866         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
13867         this suggestion.
13868
13869         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
13870         a method body.
13871
13872         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
13873         essentially like methods and apply attributes like MethodImplOptions to them too.
13874
13875         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
13876         not being null.
13877
13878         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
13879         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
13880         is the DeclSpace.
13881
13882         * Update code everywhere accordingly.
13883
13884         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
13885
13886         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
13887
13888 2002-02-28  Ravi Pratap  <ravi@ximian.com>
13889
13890         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
13891         try performing lookups against those instead of jumping straight into using
13892         the 'using' clauses.
13893
13894         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
13895
13896         (LookupType): Perform lookups in implicit parents too.
13897
13898         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
13899         sequence as RootContext.LookupType. 
13900
13901         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
13902         the various cases of namespace lookups into this method.
13903
13904 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
13907         in positional arguments)
13908
13909         * class.cs (Operator): Update the AllowedModifiers to contain
13910         extern. 
13911
13912         * cs-parser.jay: Update operator declaration to allow for the
13913         operator body to be empty.
13914
13915         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
13916         values. 
13917
13918 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
13919
13920         * class.cs (Method.Emit): Label parameters.
13921
13922         * driver.cs: Return 1 or 0 as the program exit code.
13923
13924 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * expression.cs: Special case the `null' object when trying to
13927         auto-compute the type, as anything can be explicitly converted to
13928         that. 
13929
13930         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
13931         spotting this Paolo.
13932
13933         (Expression.ImplicitNumericConversion): Perform comparissions of
13934         the type using the underlying type in the case of an enumeration
13935         rather than using the enumeration type for the compare.
13936
13937         Cope with the underlying == type case, which is not possible to
13938         catch before. 
13939
13940         (Expression.ConvertNumericExplicit): Perform comparissions of
13941         the type using the underlying type in the case of an enumeration
13942         rather than using the enumeration type for the compare.
13943
13944         * driver.cs: If the user does not supply an extension, assume .exe
13945
13946         * cs-parser.jay (if_statement): Rewrote so that we can track the
13947         location for the if statement.
13948
13949         * expression.cs (Binary.ConstantFold): Only concat strings when
13950         the operation is "+", not everything ;-)
13951
13952         * statement.cs (Statement.EmitBoolExpression): Take a location
13953         argument. 
13954         (If, While, Do): Track location.
13955
13956         * expression.cs (Binary.ResolveOperator): In the object + string
13957         case, I was missing a call to ConvertImplicit
13958
13959 2002-02-25  Ravi Pratap  <ravi@ximian.com>
13960
13961         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
13962         Location arguments. Ensure we use RootContext.LookupType to do our work
13963         and not try to do a direct Type.GetType and ModuleBuilder.GetType
13964
13965         * interface.cs (PopulateMethod): Handle the type of the parameter being
13966         null gracefully.
13967
13968         * expression.cs (Invocation.BetterFunction): Handle the case when we 
13969         have a params method with no fixed arguments and a call is made with no
13970         arguments.
13971
13972 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
13973
13974         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
13975         the verbatim-string-literal
13976
13977         * support.cs (InternalParameters.ParameterModifier): handle null
13978         fixed parameters.
13979         (InternalParameters.ParameterType): ditto.
13980
13981         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
13982         duplicating the name of the variable parameter.
13983         (GetParameterByName): Fix bug where we were not looking up array
13984         paramters if they were the only present (thanks Paolo!).
13985         (GetParameterInfo): We only have an empty set of types if both
13986         fixed and array are set to null.
13987         (GetParameterInfo-idx): Handle FixedParameter == null
13988
13989         * cs-parser.jay: Handle the case where there is no catch
13990         statements (missing null test).
13991
13992 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * driver.cs (MainDriver): Be conservative on our command line
13995         handling.
13996
13997         Catch DirectoryNotFoundException when calling GetFiles.
13998
13999         (SplitPathAndPattern): Used to split the input specification into
14000         a path and a pattern that we can feed to Directory.GetFiles.
14001
14002 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * statement.cs (Fixed): Implement the last case of the Fixed
14005         statement (string handling).
14006
14007         * expression.cs (StringPtr): New class used to return a char * to
14008         a string;  Used by the Fixed statement.
14009
14010         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14011
14012         * expression.cs (Binary.ResolveOperator): Remove redundant
14013         MemberLookup pn parent type.
14014         Optimize union call, we do not need a union if the types are the same.
14015         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14016         type.
14017
14018         Specialize the use of MemberLookup everywhere, instead of using
14019         the default settings. 
14020
14021         (StackAlloc): Implement stackalloc keyword.
14022
14023         * cs-parser.jay: Add rule to parse stackalloc.
14024
14025         * driver.cs: Handle /h, /help, /?
14026
14027         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14028         before we supported unsafe code.
14029
14030         * makefile: add --unsafe to the self compilation of mcs.
14031
14032 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14033
14034         * expression.cs (PointerArithmetic): New class that is used to
14035         perform pointer arithmetic.
14036         (Binary.Resolve): Handle pointer arithmetic
14037         Handle pointer comparission.
14038         (ArrayPtr): Utility expression class that is used to take the
14039         address of an array.
14040
14041         (ElementAccess): Implement array access for pointers
14042
14043         * statement.cs (Fixed): Implement fixed statement for arrays, we
14044         are missing one more case before we are done.
14045
14046         * expression.cs (Indirection): Implement EmitAssign and set the
14047         ExprClass to Variable.  This allows pointer dereferences to be
14048         treated as variables, and to have values assigned to them.
14049
14050         * ecore.cs (Expression.StoreFromPtr): New utility function to
14051         store values dereferencing.
14052
14053 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14054
14055         * expression.cs (Binary.ResolveOperator): Ensure that we are
14056         not trying to operate on a void type - this fixes the reported
14057         bug.
14058
14059         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14060         the parent implementation is sealed.
14061
14062         * ../errors/cs0239.cs : Add.
14063
14064         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14065
14066         * typemanager.cs (unverifiable_code_type): Corresponds to 
14067         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14068         which have unsafe code in them.
14069
14070         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14071         unsafe context.
14072
14073 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * cs-tokenizer.cs: Add support for @"litreal strings"
14076
14077         Make tokenizer accept pre-processor directives
14078         on any column (remove the old C-like limitation). 
14079
14080         * rootcontext.cs (EmitCode): Emit any global attributes.
14081         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14082
14083         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14084
14085         * cs-parser.jay: Add support for global attributes.  
14086
14087 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14088
14089         * expression.cs (Indirection): New helper class.  Unary will
14090         create Indirection classes to be able to implement the
14091         IMemoryLocation interface on it.
14092
14093 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * cs-parser.jay (fixed_statement): reference the right statement.
14096
14097         * statement.cs (Fixed.Emit): Finish implementing the fixed
14098         statement for the &x case.
14099
14100 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14101
14102         * class.cs (Property.Define, Method.Define): Remove newslot when
14103         `implementing'.  
14104
14105         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14106         wrong.  NewSlot should only be used if the `new' keyword is present.
14107
14108         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14109         locating our system dir.  Sorry about this.
14110
14111 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14112
14113         * driver.cs (GetSystemDir): Compute correctly the location of our
14114         system assemblies.  I was using the compiler directory instead of
14115         the library directory.
14116
14117 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14118
14119         * expression.cs (BetterFunction): Put back in what Miguel commented out
14120         since it is the correct fix. The problem is elsewhere ;-)
14121
14122         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14123         parameters of the parms method are themselves compatible or not !
14124
14125         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14126         to check that a class implements an interface before saying that an implicit
14127         conversion was allowed. Use ImplementsInterface to do the checking.
14128
14129 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14130
14131         * class.cs (Method.Define): Track whether we are an explicit
14132         implementation or not.  And only call DefineMethodOverride if we
14133         are an explicit implementation.
14134
14135         (Property.DefineMethod): Ditto.
14136
14137 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14138
14139         * expression.cs (BetterFunction): Catch hideous bug which was
14140          preventing us from detecting ambiguous calls due to implicit casts i.e
14141         cs0121.
14142
14143 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14144
14145         * support.cs (Pair): Remove un-needed method.  I figured why I was
14146         getting the error in cs-parser.jay, the variable in a foreach loop
14147         is readonly, and the compiler does not really treat this as a variable.
14148
14149         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14150         instead of EQUALS in grammar.  
14151
14152         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14153
14154         * expression.cs (Unary.DoResolve): Check whether the argument is
14155         managed or not.
14156
14157 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14158
14159         * support.cs: Api for Pair to set a value.  Despite the fact that
14160         the variables are public the MS C# compiler refuses to compile
14161         code that accesses the field if the variable is part of a foreach
14162         statement. 
14163
14164         * statement.cs (Fixed): Begin implementation of the fixed
14165         statement.
14166
14167         (Block.AddVariable): Return the VariableInfo on success and null
14168         on failure instead of true/false. 
14169
14170         * cs-parser.jay (foreach): Catch errors on variables already
14171         defined (we were ignoring this value before) and properly unwind
14172         the block hierarchy
14173
14174         (fixed_statement): grammar for the fixed statement.
14175
14176 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14177
14178         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14179         pointer types to be incretemented.
14180
14181         (SizeOf): Implement.
14182
14183         * cs-parser.jay (pointer_member_access): Implement
14184         expr->IDENTIFIER production.
14185
14186         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14187         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14188         on safe contexts.
14189
14190         (Unary): Implement indirection.
14191
14192         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14193         use in non-unsafe context).
14194
14195         (SimpleName.DoResolve): Check for pointers in field access on safe
14196         contexts. 
14197
14198         (Expression.LoadFromPtr): Factor the load-indirect code in this
14199         function.  This was duplicated in UnboxCast and ParameterReference
14200
14201 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14202
14203         * expression.cs (ComposedCast): report an error if a pointer cast
14204         is used in a safe region.
14205
14206         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14207         pointer type casts in unsafe context.
14208
14209         * codegen.cs (EmitContext): Set up IsUnsafe.
14210
14211         * cs-parser.jay (non_expression_type): Add productions for pointer
14212         casts. 
14213
14214         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14215         code.  We should not use force into static mode if the method is
14216         not virtual.  Fixes bug in MIS
14217
14218         * statement.cs (Do.Emit, While.Emit, For.Emit,
14219         Statement.EmitBoolExpression): Add support to Do and While to
14220         propagate infinite loop as `I do return' semantics.
14221
14222         Improve the For case to also test for boolean constants.
14223
14224         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14225         to the list of attributes we can add.
14226
14227         Remove `EmitContext' argument.
14228
14229         * class.cs (Method.Define): Apply parameter attributes.
14230         (Constructor.Define): Apply parameter attributes.
14231         (MethodCore.LabelParameters): Move here the core of labeling
14232         parameters. 
14233
14234         * support.cs (ReflectionParameters.ParameterModifier,
14235         InternalParameters.ParameterModifier): Use IsByRef on the type and
14236         only return the OUT bit for these parameters instead of in/out/ref
14237         flags.
14238
14239         This is because I miss-understood things.  The ParameterInfo.IsIn
14240         and IsOut represent whether the parameter has the [In] and [Out]
14241         attributes set.  
14242
14243 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * ecore.cs (FieldExpr.Emit): Release temporaries.
14246
14247         * assign.cs (LocalTemporary.Release): new function.
14248
14249         * codegen.cs (EmitContext.GetTemporaryStorage,
14250         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14251         temporary storage.  Now we can "put back" localbuilders when we
14252         are done with them
14253
14254 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14255
14256         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14257         need to make a copy of the variable to generate verifiable code.
14258
14259 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14260
14261         * driver.cs: Compute dynamically the system directory.
14262
14263         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14264         Slower, but more generally useful.  Used by the abstract
14265         registering implementation. 
14266
14267         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14268         the rules for the special rule on Type/instances.  First check if
14269         we have the same name, and if so, try that special static path
14270         rather than the instance path.
14271
14272 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14273
14274         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14275         for, while and if.
14276
14277         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14278         Enum, ValueType, Delegate or Array for non-corlib compiles.
14279
14280         * cs-tokenizer.cs: Catch long identifiers (645)
14281
14282         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14283         piece of code.
14284
14285         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14286         fix, we were returning too early, so we were not registering
14287         pending methods from abstract classes.
14288
14289         Do not register pending methods if the class is abstract.
14290
14291         * expression.cs (Conditional.DoResolve): Report circular implicit
14292         conversions when we neecd to compute it for conditional
14293         expressions. 
14294
14295         (Is.DoResolve): If the expression is always of the provided type,
14296         flag warning 183.  If the expression can not ever be of the
14297         provided type flag warning 184.
14298
14299         * class.cs: Catch 169 as well.
14300
14301         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14302         read. 
14303
14304 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14305
14306         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14307
14308 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14309
14310         * interface.cs: (PopulateMethod): Check for pointers being defined
14311         only if the unsafe context is active.
14312         (PopulateProperty): ditto.
14313         (PopulateIndexer): ditto.
14314
14315         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14316         specified.  If pointers are present, make sure that they are
14317         present in an unsafe context.
14318         (Constructor, Constructor.Define): ditto.
14319         (Field, Field.Define): ditto.
14320         (Property, Property.Define): ditto.
14321         (Event, Event.Define): ditto.
14322
14323         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14324         hashtable if there are classes or structs defined.
14325
14326         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14327         code, as the constant resolution moved.
14328
14329         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14330         the metadata, so we can flag error 133. 
14331
14332         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14333         pointer is being declared in an unsafe context.
14334
14335 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14336
14337         * modifiers.cs (Modifiers.Check): Require a Location argument.
14338         Report error 227 for Unsafe use.
14339
14340         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14341
14342         * statement.cs (For.Emit): If the test is null, then report that
14343         we do `return', as we wont reach anything afterwards.
14344
14345         (Switch.SwitchGoverningType): Track the expression that matched
14346         the conversion.
14347
14348         * driver.cs: Allow negative numbers as an error code to flag.
14349
14350         * cs-parser.jay: Handle 1551.
14351
14352         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14353
14354 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14355
14356         * cs-parser.jay: Report 1518 (type declaration can only contain
14357         class, struct, interface, enum or delegate)
14358
14359         (switch_label): Report 1523 (keywords `case' or `default' must
14360         preced code)
14361
14362         (opt_switch_sections): Report 1522 (empty switch)
14363
14364         * driver.cs: Report 1515 (response file specified multiple times)
14365         Report 1516 (Source file specified multiple times).
14366
14367         * expression.cs (Argument.Resolve): Signal 1510
14368
14369         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14370         access not allowed in static code)
14371
14372 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14373
14374         * typemanager.cs (IsPointerType): Utility method which we are going
14375         to need a lot.
14376
14377         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14378         the object type, so we take care of that.
14379
14380         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14381
14382         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14383         added to non-params parameters :-)
14384
14385         * typemanager.cs (CSharpName): Include 'void' type too. 
14386
14387         (void_ptr_type): Include in the set of core types.
14388
14389         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14390         duplicating code.
14391
14392         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14393         an unsafe context.
14394
14395         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14396         completely forgotten about it.
14397
14398 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14399
14400         * cs-parser.jay (pointer_type): Add. This begins our implementation
14401         of parsing rules for unsafe code.
14402
14403         (unsafe_statement): Implement.
14404
14405         (embedded_statement): Modify to include the above.
14406
14407         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14408
14409         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14410         if the current context is an unsafe one.
14411
14412         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14413         are handled differently, we need separate rules for them.
14414
14415         (local_variable_declaration): Update to use local_variable_pointer_type
14416         to allow variable declarations of unmanaged pointer types.
14417
14418         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14419         in unsafe contexts.
14420
14421         * ../errors/cs0214.cs : Add.
14422
14423 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14424
14425         * makefile: remove 'response' file when cleaning.
14426
14427 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14428
14429         * cs-parser.jay: Report 1524.
14430
14431 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14432
14433         * typemanager.cs (RegisterMethod): drop checking if we have
14434         registered this from here
14435
14436 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14437
14438         * class.cs (Method.EmitDestructor): Implement calling our base
14439         destructor. 
14440
14441         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14442         value of InFinally.
14443
14444         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14445         this routine and will wrap the call in a try/catch block.  Deal
14446         with the case.
14447
14448 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * ecore.cs (Expression.MemberLookup): instead of taking a
14451         parameter `same_type' that was used to tell whether we could
14452         access private members we compute our containing type from the
14453         EmitContext.
14454
14455         (FieldExpr): Added partial support for volatile fields.  This does
14456         not work for volatile fields exposed from assemblies, as I can not
14457         figure out how to extract the modreq from it.
14458
14459         Updated all the source files to use this.
14460
14461         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14462         because it is referenced by MemberLookup very often. 
14463
14464 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14465
14466         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14467         TypeBuilder.GetCustomAttributes to retrieve what we need.
14468
14469         Get rid of redundant default_member_attr_type as this is the same as
14470         default_member_type which already exists.
14471
14472         * interface.cs, attribute.cs : Update accordingly.
14473
14474 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14477         work for TYpeBuilders though.  Ravi, can you please fix this?
14478
14479         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14480
14481         * expression.cs (Argument.Emit): Handle the case of ref objects
14482         being passed to ref functions;  
14483
14484         (ParameterReference.EmitLoad): Loads the content of the pointer
14485         without dereferencing.
14486
14487 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14488
14489         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14490
14491 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14492
14493         * class.cs (Indexer.DefineMethod): Incorporate the interface
14494         type in the name of the method if we are doing explicit interface
14495         implementation.
14496
14497         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14498
14499         (BetterConversion): Fix extremely trivial bug where we were referring to
14500         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14501         again !
14502
14503         * ../errors/bug16.cs : Add although we have fixed it.
14504
14505 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14506
14507         * expression.cs (BaseIndexer): Begin implementation.
14508
14509         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14510
14511         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14512         production directly to remove a shift/reduce, and implement
14513         explicit interface implementation.
14514
14515         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14516         after a floating point suffix.
14517
14518         * expression.cs (DoNumericPromotions): Improved the conversion for
14519         uint/uint.  If we have a constant, we avoid doing a typecast to a
14520         larger type.
14521
14522         * class.cs (Indexer): Implement explicit interface implementation
14523         for indexers.
14524
14525 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14526
14527         * class.cs: make the default instance constructor public and hidebysig.
14528
14529 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14530
14531         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14532         so we can call it from elsewhere.
14533
14534         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14535         we emit it internally if the class has a defined indexer; otherwise the user
14536         emits it by decorating the class definition with the DefaultMemberAttribute.
14537
14538         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14539         attribute is not used on a type which defines an indexer.
14540
14541         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14542         character when we skip whitespace.
14543
14544         * ../errors/cs0646.cs : Add.
14545
14546 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14547
14548         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14549         again. 
14550
14551         * makefile: Add practical target `mcs3.exe' which builds the third
14552         generation compiler. 
14553
14554         * expression.cs (New): Fix structures constructor calling.
14555
14556         * class.cs (Property, Method, Indexer): Emit Final flag on the
14557         method if we are an interface implementation and we are not
14558         abstract. 
14559
14560         * ecore.cs (PropertyExpr): New public field `IsBase', tells
14561         whether this property is referencing a `base' method.
14562
14563         * expression.cs (Invocation.EmitCall): take an extra argument:
14564         is_base, this is used to determine whether the `call' or
14565         `callvirt' opcode should be used.
14566
14567
14568         * delegate.cs: update EmitCall.
14569
14570         * class.cs (Method.Define): Set NewSlot for the cases where we are
14571         not implementing an interface method.
14572
14573         (Property.Define): ditto.
14574
14575 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
14576
14577         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14578         'r'.  Allows mcs to parse itself fully.
14579
14580 2002-01-02  Ravi Pratap  <ravi@ximian.com>
14581
14582         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14583         of the number of initializers that require the InitializeArray method.
14584
14585         (CheckIndices): Store the Expression in all cases - not the plain value. Also
14586         update the above field where necessary.
14587
14588         (MakeByteBlob): Update accordingly.
14589
14590         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
14591         greater than 2.
14592
14593         (EmitDynamicInitializers): Update in accordance with the new optimization.
14594
14595         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
14596         same OpCode applies.
14597
14598         * cs-parser.jay : Fix some glaring errors I introduced.
14599
14600 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
14601
14602         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
14603         so that we can check for name clashes there too.
14604
14605         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
14606         for interface indexers.
14607
14608         * interfaces.cs (Define): Emit the default member attribute.
14609
14610         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
14611         variable was being referred to while setting the value ;-)
14612
14613 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
14614
14615         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
14616         byte-by-byte information when we know the data is zero.
14617
14618         Make the block always a multiple of 4, because
14619         DefineInitializedData has a bug.
14620
14621         * assign.cs: Fix, we should assign from the temporary, not from
14622         the source. 
14623
14624         * expression.cs (MakeByteBlob): Fix my incorrect code.
14625
14626 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
14627
14628         * typemanager.cs (EnumToUnderlying): This function is used to get
14629         the underlying type from an enumeration, because it does not
14630         always work. 
14631
14632         * constant.cs: Use the I4_S form for values between -128 and 127.
14633
14634         * statement.cs (Block.LookupLabel): Looks up a label.
14635         (Block): Drop support for labeled blocks.
14636
14637         (LabeledStatement): New kind of statement that represents a label
14638         only.
14639
14640         (Goto): Finally implement this bad boy.
14641
14642         * cs-parser.jay: Update to reflect new mechanism to implement
14643         labels.
14644
14645 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * codegen.cs (EmitContext.This): a codegen property that keeps the
14648         a single instance of this instead of creating many different this
14649         instances. 
14650
14651         * delegate.cs (Delegate.DoResolve): Update to use the property;
14652
14653         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
14654
14655         * expression.cs (BaseAccess.DoResolve): Ditto.
14656
14657 2001-12-29  Ravi Pratap  <ravi@ximian.com>
14658
14659         * typemanager.cs (methodimpl_attr_type): Add to hold the type
14660         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
14661
14662         (InitCoreTypes): Update accordingly.
14663
14664         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
14665         so we can quickly store the state.
14666
14667         (ApplyAttributes): Set the correct implementation flags
14668         for InternalCall methods.
14669
14670 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
14671
14672         * expression.cs (EmitCall): if a method is not virtual, then do
14673         not use callvirt on it.
14674
14675         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
14676         user defined stuff) requires the use of stobj, which takes an
14677         address on the stack instead of an array and an index.  So emit
14678         the Ldelema operation for it.
14679
14680         (EmitStoreOpcode): Use stobj for valuetypes.
14681
14682         (UnaryMutator.EmitCode): Use the right 1 value depending on
14683         whether we are dealing with int64/uint64, float or doubles.
14684
14685         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
14686         constructors that I implemented last night.
14687
14688         (Constructor.IsDefault): Fix to work properly for static
14689         constructors.
14690
14691         * cs-parser.jay (CheckDef): report method signature errors.
14692         Update error number 103 to be 132.
14693
14694         * decl.cs: New AdditionResult enumeration value: MethodExists.
14695         Although we do this check for methods later on in the semantic
14696         analysis, catching repeated default constructors is so easy that
14697         we catch these here. 
14698
14699         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
14700         promotions code.
14701
14702         (ParameterReference.EmitAssign, Emit): handle
14703         bools as bytes.
14704
14705         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
14706         (ArrayAccess.EmitStoreOpcode): ditto.
14707
14708         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
14709
14710         * expression.cs (MakeByteBlob): Complete all the missing types
14711         (uint, short, ushort, byte, sbyte)
14712
14713         * class.cs: Only init instance field initializers on instance
14714         constructors. 
14715
14716         Rename `constructors' to instance_constructors. 
14717
14718         (TypeContainer.AddConstructor): Only add constructors to the list
14719         if it is not static.
14720
14721         Make sure that we handle default_static_constructor independently
14722         everywhere where we handle instance_constructors
14723
14724 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
14725
14726         * class.cs: Do not lookup or create a base initializer for a
14727         static constructor.
14728
14729         (ConstructorInitializer.Resolve): use the proper type to lookup
14730         for constructors.
14731
14732         * cs-parser.jay: Report error 1585 (modifiers between type and name).
14733
14734         * enum.cs, interface.cs: Remove CloseType, this is taken care by
14735         in DeclSpace. 
14736
14737         * decl.cs: CloseType is now an virtual method, the default
14738         implementation just closes this type.
14739
14740 2001-12-28  Ravi Pratap  <ravi@ximian.com>
14741
14742         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
14743         to PreserveSig by default. Also emit HideBySig on such methods.
14744
14745         Basically, set the defaults to standard values.
14746
14747         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
14748         argument, if candidate is better, it can't be worse than the best !
14749
14750         (Invocation): Re-write bits to differentiate between methods being
14751         applicable in their expanded form and their normal form - for params
14752         methods of course.
14753
14754         Get rid of use_standard everywhere as only standard conversions are allowed
14755         in overload resolution. 
14756
14757         More spec conformance.
14758
14759 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * driver.cs: Add --timestamp, to see where the compiler spends
14762         most of its time.
14763
14764         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
14765         `this' in static code.
14766
14767         (SimpleName.DoResolve): Implement in terms of a helper function
14768         that allows static-references to be passed upstream to
14769         MemberAccess.
14770
14771         (Expression.ResolveWithSimpleName): Resolve specially simple
14772         names when called by MemberAccess to implement the special
14773         semantics. 
14774
14775         (Expression.ImplicitReferenceConversion): Handle conversions from
14776         Null to reference types before others, as Null's type is
14777         System.Object. 
14778
14779         * expression.cs (Invocation.EmitCall): Handle the special case of
14780         calling methods declared on a reference type from a ValueType
14781         (Base classes System.Object and System.Enum)
14782
14783         (MemberAccess.Resolve): Only perform lookups on Enumerations if
14784         the left hand side is a TypeExpr, not on every enumeration. 
14785
14786         (Binary.Resolve): If types are reference types, then do a cast to
14787         object on operators != and == of both arguments.
14788
14789         * typemanager.cs (FindMembers): Extract instance and static
14790         members if requested.
14791
14792         * interface.cs (PopulateProperty): Use void_type instead of null
14793         as the return type for the setter method.
14794
14795         (PopulateIndexer): ditto.
14796
14797 2001-12-27  Ravi Pratap  <ravi@ximian.com>
14798
14799         * support.cs (ReflectionParameters): Fix minor bug where we
14800         were examining the wrong parameter for the ParamArray attribute.
14801
14802         Cope with requests for the type of the parameter at position
14803         greater than the params parameter's. We now return the element
14804         type of the params array as that makes more sense.
14805
14806         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
14807         accordingly as we no longer have to extract the element type
14808         ourselves.
14809
14810         (Invocation.OverloadResolve): Update.
14811
14812 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
14813
14814         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
14815         against IEnumerator, test whether the return value is a descendant
14816         of the IEnumerator interface.
14817
14818         * class.cs (Indexer.Define): Use an auxiliary method to implement
14819         the other bits of the method definition.  Begin support for
14820         explicit interface implementation.
14821
14822         (Property.DefineMethod): Use TypeManager.void_type instead of null
14823         for an empty return value.
14824
14825 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
14826
14827         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
14828         dealing with a FieldExpr which is composed of a FieldBuilder, in
14829         the code path we did extract the constant, but we should have
14830         obtained the underlying value to be able to cast it (otherwise we
14831         end up in an infinite loop, this is what Ravi was running into).
14832
14833         (ArrayCreation.UpdateIndices): Arrays might be empty.
14834
14835         (MemberAccess.ResolveMemberAccess): Add support for section
14836         14.5.4.1 that deals with the special case of E.I when E is a type
14837         and something else, that I can be a reference to a static member.
14838
14839         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
14840         handle a particular array type to create byte blobs, it is just
14841         something we dont generate byteblobs for.
14842
14843         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
14844         arguments. 
14845
14846         * location.cs (Push): remove the key from the hashtable that we
14847         are about to add.   This happens for empty files.
14848
14849         * driver.cs: Dispose files after we have parsed them.
14850
14851         (tokenize): new function that only runs the tokenizer on its
14852         input, for speed testing.
14853
14854 2001-12-26  Ravi Pratap  <ravi@ximian.com>
14855
14856         * class.cs (Event.Define): Define the private field only if there
14857         are no accessors defined.
14858
14859         * expression.cs (ResolveMemberAccess): If there is no associated
14860         field with the event, that means we have an event defined with its
14861         own accessors and we should flag error cs0070 since transforming
14862         ourselves into a field is not valid in that case.
14863
14864         * ecore.cs (SimpleName.DoResolve): Same as above.
14865
14866         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
14867         and charset to sane values.
14868
14869 2001-12-25  Ravi Pratap  <ravi@ximian.com>
14870
14871         * assign.cs (DoResolve): Perform check on events only if they 
14872         are being accessed outside the declaring type.
14873
14874         * cs-parser.jay (event_declarations): Update rules to correctly
14875         set the type of the implicit parameter etc.
14876
14877         (add_accessor, remove_accessor): Set current local parameters.
14878
14879         * expression.cs (Binary): For delegate addition and subtraction,
14880         cast the return value from the method into the appropriate delegate
14881         type.
14882
14883 2001-12-24  Ravi Pratap  <ravi@ximian.com>
14884
14885         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
14886         of these as the workaround is unnecessary.
14887
14888         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
14889         delegate data - none of that is needed at all.
14890
14891         Re-write bits to extract the instance expression and the delegate method
14892         correctly.
14893
14894         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
14895         on delegates too.
14896
14897         * attribute.cs (ApplyAttributes): New method to take care of common tasks
14898         of attaching attributes instead of duplicating code everywhere.
14899
14900         * everywhere : Update code to do attribute emission using the above method.
14901
14902 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
14903
14904         * expression.cs (IsParamsMethodApplicable): if there are not
14905         parameters, return immediately.
14906
14907         * ecore.cs: The 0 literal can be implicity converted to an enum
14908         type. 
14909
14910         (SimpleName.DoResolve): First lookup the type, then lookup the
14911         members. 
14912
14913         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
14914         want to get its address.  If the InstanceExpression is not
14915         addressable, store the result in a temporary variable, then get
14916         the address of it.
14917
14918         * codegen.cs: Only display 219 errors on warning level or above. 
14919
14920         * expression.cs (ArrayAccess): Make it implement the
14921         IMemoryLocation interface.
14922
14923         (Binary.DoResolve): handle the operator == (object a, object b)
14924         and operator != (object a, object b) without incurring into a
14925         BoxedCast (because 5 != o should never be performed).
14926
14927         Handle binary enumerator operators.
14928
14929         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
14930         value type, otherwise use Ldelem_ref.
14931
14932         Use precomputed names;
14933
14934         (AddressOf): Implement address of
14935
14936         * cs-parser.jay (labeled_statement): Fix recursive block
14937         addition by reworking the production.
14938
14939         * expression.cs (New.DoEmit): New has a special case:
14940                 
14941                  If we are dealing with a ValueType, we have a few
14942                  situations to deal with:
14943                 
14944                     * The target of New is a ValueType variable, that is
14945                       easy, we just pass this as the variable reference
14946                 
14947                     * The target of New is being passed as an argument,
14948                       to a boxing operation or a function that takes a
14949                       ValueType.
14950                 
14951                       In this case, we need to create a temporary variable
14952                       that is the argument of New.
14953
14954
14955 2001-12-23  Ravi Pratap  <ravi@ximian.com>
14956
14957         * rootcontext.cs (LookupType): Check that current_type is not null before
14958         going about looking at nested types.
14959
14960         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
14961         not implement the IAssignMethod interface any more.
14962
14963         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
14964         where we tranform them into FieldExprs if they are being resolved from within
14965         the declaring type.
14966
14967         * ecore.cs (SimpleName.DoResolve): Do the same here.
14968
14969         * assign.cs (DoResolve, Emit): Clean up code considerably. 
14970
14971         * ../errors/bug10.cs : Add.
14972
14973         * ../errors/cs0070.cs : Add.
14974
14975         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
14976
14977         * assign.cs : Get rid of EventIsLocal everywhere.
14978
14979 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
14980
14981         * ecore.cs (ConvertIntLiteral): finished the implementation.
14982
14983         * statement.cs (SwitchLabel): Convert the value we are using as a
14984         key before looking up the table.
14985
14986 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
14987
14988         * codegen.cs (EmitTopBlock): Require a Location argument now.
14989
14990         * cs-parser.jay (constructor_declarator): We need to setup
14991         current_local_parameters before we parse the
14992         opt_constructor_initializer, to allow the variables to be bound
14993         to the constructor arguments.
14994
14995         * rootcontext.cs (LookupType): First lookup nested classes in our
14996         class and our parents before we go looking outside our class.
14997
14998         * expression.cs (ConstantFold): Extract/debox the values at the
14999         beginnning. 
15000
15001         * rootcontext.cs (EmitCode): Resolve the constants first before we
15002         resolve the types.  This is not really needed, but it helps debugging.
15003
15004         * statement.cs: report location.
15005
15006         * cs-parser.jay: pass location to throw statement.
15007
15008         * driver.cs: Small bug fix.
15009
15010         * report.cs: Updated format to be 4-zero filled digits.
15011
15012 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15013
15014         * expression.cs (CheckIndices): Fix minor bug where the wrong
15015         variable was being referred to ;-)
15016
15017         (DoEmit): Do not call EmitStaticInitializers when the 
15018         underlying type is System.Object.
15019
15020 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15021
15022         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15023         and do the usual workaround for SRE.
15024
15025         * class.cs (MyEventBuilder.EventType): New member to get at the type
15026         of the event, quickly.
15027
15028         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15029
15030         * assign.cs (Assign.DoResolve): Handle the case when the target
15031         is an EventExpr and perform the necessary checks.
15032
15033         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15034         interface.
15035
15036         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15037
15038         (EventExpr): Set the type in the constructor itself since we 
15039         are meant to be born fully resolved.
15040
15041         (EventExpr.Define): Revert code I wrote earlier.
15042                 
15043         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15044         instance expression is null. The instance expression is a This in that case
15045         or a null, depending on whether it is a static method or not.
15046
15047         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15048         refers to more than one method.
15049
15050         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15051         and accordingly flag errors.
15052
15053 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15056
15057 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * location.cs (ToString): Provide useful rutine.
15060
15061 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15062
15063         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15064         objects, return the actual integral boxed.
15065
15066         * statement.cs (SwitchLabel): define an ILLabel for each
15067         SwitchLabel. 
15068
15069         (Switch.CheckSwitch): If the value is a Literal, extract
15070         the underlying literal.
15071
15072         Also in the unused hashtable we had, add the SwitchLabel so we can
15073         quickly look this value up.
15074
15075         * constant.cs: Implement a bunch of new constants.  Rewrite
15076         Literal based on this.  Made changes everywhere to adapt to this.
15077
15078         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15079         dereferencing array only once, and also copes with enumrations.
15080
15081         bytes are two bytes wide, not one.
15082
15083         (Cast): Perform constant conversions.
15084
15085         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15086         wrappers to the literals here.
15087
15088         * expression.cs (DoNumericPromotions): long literals can converted
15089         to ulong implicity (this is taken care of elsewhere, but I was
15090         missing this spot).
15091
15092         * ecore.cs (Expression.Literalize): Make the return type Literal,
15093         to improve type checking.
15094
15095         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15096
15097 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * literal.cs: Revert code from ravi that checked the bounds.  The
15100         bounds are sane by the definition of the type itself. 
15101
15102         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15103         need to actually look up in our parent hierarchy for interfaces
15104         implemented. 
15105
15106         * const.cs: Use the underlying type for enumerations
15107
15108         * delegate.cs: Compute the basename for the delegate creation,
15109         that should fix the delegate test case, and restore the correct
15110         Type Lookup semantics in rootcontext
15111
15112         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15113         referencing a nested type with the Reflection API is using the "+"
15114         sign. 
15115
15116         * cs-parser.jay: Do not require EOF token at the end.
15117
15118 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15119
15120         * rootcontext.cs (LookupType): Concatenate type names with
15121         a '.' instead of a '+' The test suite passes again.
15122
15123         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15124         field of the enumeration.
15125
15126         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15127         the case when the member is an EventExpr.
15128
15129         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15130         static has an associated instance expression.
15131
15132         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15133
15134         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15135
15136         * class.cs (Event.Define): Register event and perform appropriate checks
15137         for error #111.
15138
15139         We define the Add and Remove methods even if the use provides none because
15140         in that case, we provide default implementations ourselves.
15141
15142         Define a private field of the type of the event. This is done by the CSC compiler
15143         and we should be doing it too ;-)
15144
15145         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15146         More methods we use in code we generate.
15147
15148         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15149         is important.
15150
15151         (InitCoreTypes): Update accordingly for the above.
15152
15153         * class.cs (Event.Emit): Generate code for default accessors that we provide
15154
15155         (EmitDefaultMethod): Do the job in the above.
15156
15157         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15158         appropriate place.
15159
15160 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15163         builders even if we were missing one.
15164
15165         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15166         pass the Basename as our class name instead of the Name.  The
15167         basename will be correctly composed for us.
15168
15169         * parameter.cs (Paramters): Now takes a Location argument.
15170
15171         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15172         make all the code call directly LookupType in RootContext and take
15173         this chance to pass the Location information everywhere.
15174
15175         * Everywhere: pass Location information.
15176
15177 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15178
15179         * class.cs (Constructor.Define): Updated way of detecting the
15180         length of the parameters.
15181
15182         (TypeContainer.DefineType): Use basename as the type name for
15183         nested types.
15184
15185         (TypeContainer.Define): Do not recursively define types here, as
15186         definition is taken care in order by the RootContext.
15187
15188         * tree.cs: Keep track of namespaces in a per-file basis.
15189
15190         * parameter.cs (Parameter.ComputeSignature): Update to use
15191         DeclSpace. 
15192
15193         (Parameters.GetSignature): ditto.
15194
15195         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15196         instead of a TypeContainer.
15197
15198         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15199         resolve names.  Because we need to be resolve in our context, not
15200         our parents.
15201
15202         * driver.cs: Implement response files.
15203
15204         * class.cs (TypeContainer.DefineType): If we are defined, do not
15205         redefine ourselves.
15206
15207         (Event.Emit): Emit the code for add/remove handlers.
15208         (Event.Define): Save the MethodBuilders for add/remove.
15209
15210         * typemanager.cs: Use pair here too.
15211
15212         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15213         DictionaryEntry requires the first argument to be non-null.  
15214
15215         (enum_declaration): Compute full name for registering the
15216         enumeration.
15217
15218         (delegate_declaration): Instead of using
15219         formal_parameter_list, use opt_formal_parameter_list as the list
15220         can be empty.
15221
15222         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15223         (EventParsing): New property that controls whether `add' and
15224         `remove' are returned as tokens or identifiers (for events);
15225
15226 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15227
15228         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15229         use MyEventBuilder only and let it wrap the real builder for us.
15230
15231         (MyEventBuilder): Revamp constructor etc.
15232
15233         Implement all operations that we perform on EventBuilder in precisely the same
15234         way here too.
15235
15236         (FindMembers): Update to use the EventBuilder member.
15237
15238         (Event.Emit): Update accordingly.
15239
15240 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15241
15242         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15243         by calling the appropriate methods.
15244
15245         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15246         useful.
15247
15248         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15249
15250 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15251
15252         * delegate.cs (Delegate.Populate): Check that the return type
15253         and various parameters types are indeed accessible.
15254
15255         * class.cs (Constructor.Define): Same here.
15256
15257         (Field.Define): Ditto.
15258
15259         (Event.Define): Ditto.
15260
15261         (Operator.Define): Check that the underlying Method defined itself
15262         correctly - so it's MethodBuilder should not be null.
15263
15264         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15265         expression happens to be null.
15266
15267         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15268         members but as of now we don't seem to be able to do anything really useful with it.
15269
15270         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15271         not the EventBuilder.
15272
15273 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15274
15275         * cs-tokenizer.cs: Add support for defines.
15276         Add support for #if, #elif, #else, #endif
15277
15278         (eval_var): evaluates a variable.
15279         (eval): stubbed for evaluating functions.
15280
15281         * cs-parser.jay: Pass the defines information
15282
15283         * driver.cs: Add --define command line option.
15284
15285         * decl.cs: Move MemberCore here.
15286
15287         Make it the base class for DeclSpace.  This allows us to catch and
15288         report 108 and 109 for everything now.
15289
15290         * class.cs (TypeContainer.Define): Extract all the members
15291         before populating and emit the warning 108 (new keyword required
15292         to override) instead of having each member implement this.
15293
15294         (MemberCore.Define): New abstract method, we will be using this in
15295         the warning reporting engine in Populate.
15296
15297         (Operator.Define): Adjust to new MemberCore protocol. 
15298
15299         * const.cs (Const): This does not derive from Expression, it is a
15300         temporary object we use to create fields, it is a MemberCore. 
15301
15302         * class.cs (Method.Define): Allow the entry point to be in a
15303         specific class.
15304
15305         * driver.cs: Rewrite the argument handler to clean it up a bit.
15306
15307         * rootcontext.cs: Made it just an auxiliary namespace feature by
15308         making everything static.
15309
15310         * driver.cs: Adapt code to use RootContext type name instead of
15311         instance variable.
15312
15313         * delegate.cs: Remove RootContext argument.
15314
15315         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15316         argument. 
15317
15318         * class.cs (Event.Define): The lookup can fail.
15319
15320         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15321
15322         * expression.cs: Resolve the this instance before invoking the code.
15323
15324 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15325
15326         * cs-parser.jay: Add a production in element_access that allows
15327         the thing to become a "type" reference.  This way we can parse
15328         things like "(string [])" as a type.
15329
15330         Note that this still does not handle the more complex rules of
15331         casts. 
15332
15333
15334         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15335
15336         * ecore.cs: (CopyNewMethods): new utility function used to
15337         assemble the list of methods from running FindMembers.
15338
15339         (MemberLookup): Rework FindMembers so that 
15340
15341 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15342
15343         * class.cs (TypeContainer): Remove Delegates who fail to be
15344         defined.
15345
15346         * delegate.cs (Populate): Verify that we dont get null return
15347         values.   TODO: Check for AsAccessible.
15348
15349         * cs-parser.jay: Use basename to emit error 574 (destructor should
15350         have the same name as container class), not the full name.
15351
15352         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15353         possible representation.  
15354
15355         Also implements integer type suffixes U and L.
15356
15357 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15358
15359         * expression.cs (ArrayCreation.DoResolve): We need to do the
15360         argument resolution *always*.
15361
15362         * decl.cs: Make this hold the namespace.  Hold the root context as
15363         well.
15364         (LookupType): Move here.
15365
15366         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15367
15368         * location.cs (Row, Name): Fixed the code, it was always returning
15369         references to the first file.
15370
15371         * interface.cs: Register properties defined through interfaces.
15372
15373         * driver.cs: Add support for globbing on the command line
15374
15375         * class.cs (Field): Make it derive from MemberCore as well.
15376         (Event): ditto.
15377
15378 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15379
15380         * class.cs (Event::Define): Check that the type of the event is a delegate
15381         type else flag error #66.
15382
15383         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15384         same.
15385
15386         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15387         values of EntryPoint, CharSet etc etc.
15388
15389         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15390
15391         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15392         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15393         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15394         which needs this to do its work.
15395
15396         * ../errors/cs0066.cs : Add.
15397
15398 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15401         helper functions.
15402
15403         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15404         clears out the parameters field.
15405         (MemberSignatureCompare): Cleanup
15406
15407         (MemberCore): New base class used to share code between MethodCore
15408         and Property.
15409
15410         (RegisterRequiredImplementations) BindingFlags.Public requires
15411         either BindingFlags.Instace or Static.  Use instance here.
15412
15413         (Property): Refactored code to cope better with the full spec.
15414
15415         * parameter.cs (GetParameterInfo): Return an empty array instead
15416         of null on error.
15417
15418         * class.cs (Property): Abstract or extern properties have no bodies.
15419
15420         * parameter.cs (GetParameterInfo): return a zero-sized array.
15421
15422         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15423         method modifier validation to the typecontainer so we can reuse
15424         this on properties.
15425
15426         (MethodCore.ParameterTypes): return an empty sized array of types.
15427
15428         (Property.Define): Test property modifier validity.
15429
15430         Add tests for sealed/override too.
15431
15432         (Method.Emit): abstract or extern methods have no bodies.
15433
15434 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15435
15436         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15437         thing.
15438
15439         (Method::Define, ::Emit): Modify accordingly.
15440
15441         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15442
15443         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15444
15445         * makefile: Pass in /unsafe.
15446
15447 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * class.cs (MakeKey): Kill routine.
15450
15451         * class.cs (TypeContainer.Define): Correctly define explicit
15452         method implementations (they require the full interface name plus
15453         the method name).
15454
15455         * typemanager.cs: Deply the PtrHashtable here and stop using the
15456         lame keys.  Things work so much better.
15457
15458         This of course broke everyone who depended on `RegisterMethod' to
15459         do the `test for existance' test.  This has to be done elsewhere.
15460
15461         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15462         the object stupid Equals method (because, that like fails all over
15463         the place).  We still do not use it.
15464
15465         * class.cs (TypeContainer.SetRequiredInterface,
15466         TypeContainer.RequireMethods): Killed these two routines and moved
15467         all the functionality to RegisterRequiredImplementations.
15468
15469         (TypeContainer.RegisterRequiredImplementations): This routine now
15470         registers all the implementations required in an array for the
15471         interfaces and abstract methods.  We use an array of structures
15472         which can be computed ahead of time to reduce memory usage and we
15473         also assume that lookups are cheap as most classes will not
15474         implement too many interfaces.
15475
15476         We also avoid creating too many MethodSignatures.
15477
15478         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15479         clear the "pending" bit if we find that there are problems with
15480         the declaration.
15481
15482         (TypeContainer.VerifyPendingMethods): Update to report errors of
15483         methods that look like implementations but are not.
15484
15485         (TypeContainer.Define): Add support for explicit interface method
15486         implementation. 
15487
15488 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15489
15490         * typemanager.cs: Keep track of the parameters here instead of
15491         being a feature of the TypeContainer.
15492
15493         * class.cs: Drop the registration of parameters here, as
15494         InterfaceMethods are also interface declarations.
15495
15496         * delegate.cs: Register methods with the TypeManager not only with
15497         the TypeContainer.  This code was buggy.
15498
15499         * interface.cs: Full registation here.
15500
15501 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * expression.cs: Remove reducer for binary expressions, it can not
15504         be done this way.
15505
15506         * const.cs: Put here the code that used to go into constant.cs
15507
15508         * constant.cs: Put here the code for constants, this is a new base
15509         class for Literals.
15510
15511         * literal.cs: Make Literal derive from Constant.
15512
15513 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15514
15515         * statement.cs (Return.Emit): Report error 157 if the user
15516         attempts to return from a finally block.
15517
15518         (Return.Emit): Instead of emitting a return, jump to the end of
15519         the function.
15520
15521         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15522         LocalBuilder to store the result of the function.  ReturnLabel is
15523         the target where we jump.
15524
15525
15526 2001-12-09  Radek Doulik  <rodo@ximian.com>
15527
15528         * cs-parser.jay: remember alias in current namespace
15529
15530         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15531         namespaces
15532
15533         * class.cs (LookupAlias): lookup alias in my_namespace
15534
15535         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15536         aliases hashtable
15537         (LookupAlias): lookup alias in this and if needed in parent
15538         namespaces
15539
15540 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * support.cs: 
15543
15544         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15545         making things static.  I need this to avoid passing the
15546         TypeContainer when calling ParameterType.
15547
15548         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15549         that did string manipulation to compute the type and then call
15550         GetType.  Use Parameter.ParameterType instead.
15551
15552         * cs-tokenizer.cs: Consume the suffix for floating values.
15553
15554         * expression.cs (ParameterReference): figure out whether this is a
15555         reference parameter or not.  Kill an extra variable by computing
15556         the arg_idx during emission.
15557
15558         * parameter.cs (Parameters.GetParameterInfo): New overloaded
15559         function that returns whether a parameter is an out/ref value or not.
15560
15561         (Parameter.ParameterType): The type of the parameter (base,
15562         without ref/out applied).
15563
15564         (Parameter.Resolve): Perform resolution here.
15565         (Parameter.ExternalType): The full type (with ref/out applied).
15566
15567         * statement.cs (Using.Emit, Using.EmitExpression): Implement
15568         support for expressions on the using statement.
15569
15570 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
15571
15572         * statement.cs (Using.EmitLocalVariableDecls): Split the
15573         localvariable handling of the using statement.
15574
15575         (Block.EmitMeta): Keep track of variable count across blocks.  We
15576         were reusing slots on separate branches of blocks.
15577
15578         (Try.Emit): Emit the general code block, we were not emitting it. 
15579
15580         Check the type of the declaration to be an IDisposable or
15581         something that can be implicity converted to it. 
15582
15583         Emit conversions if required.
15584
15585         * ecore.cs (EmptyExpression): New utility class.
15586         (Expression.ImplicitConversionExists): New utility function.
15587
15588 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
15589
15590         * statement.cs (Using): Implement.
15591
15592         * expression.cs (LocalVariableReference): Support read only variables.
15593
15594         * statement.cs: Remove the explicit emit for the Leave opcode.
15595         (VariableInfo): Add a readonly field.
15596
15597 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
15598
15599         * ecore.cs (ConvCast): new class used to encapsulate the various
15600         explicit integer conversions that works in both checked and
15601         unchecked contexts.
15602
15603         (Expression.ConvertNumericExplicit): Use new ConvCast class to
15604         properly generate the overflow opcodes.
15605
15606 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * statement.cs: The correct type for the EmptyExpression is the
15609         element_type, not the variable type.  Ravi pointed this out.
15610
15611 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15612
15613         * class.cs (Method::Define): Handle PInvoke methods specially
15614         by using DefinePInvokeMethod instead of the usual one.
15615
15616         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
15617         above to do the task of extracting information and defining the method.
15618
15619 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15620
15621         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
15622         of the condition for string type.
15623
15624         (Emit): Move that here. 
15625
15626         (ArrayCreation::CheckIndices): Keep string literals in their expression
15627         form.
15628
15629         (EmitDynamicInitializers): Handle strings appropriately.
15630
15631 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15632
15633         * codegen.cs (EmitContext): Replace multiple variables with a
15634         single pointer to the current Switch statement.
15635
15636         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
15637         EmitContext.
15638
15639 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
15640
15641         * statement.cs 
15642
15643         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
15644         default'.
15645
15646         (Foreach.Emit): Foreach on arrays was not setting
15647         up the loop variables (for break/continue).
15648
15649         (GotoCase): Semi-implented.
15650
15651 2001-12-03  Ravi Pratap  <ravi@ximian.com>
15652
15653         * attribute.cs (CheckAttribute): Handle system attributes by using
15654         Attribute.GetAttributes to examine information we need.
15655
15656         (GetValidPlaces): Same here.
15657
15658         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
15659
15660         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
15661
15662         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
15663
15664         (Method::Define): Set appropriate flags if we have a DllImport attribute.
15665
15666         (Method::Emit): Handle the case when we are a PInvoke method.
15667
15668 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
15669
15670         * expression.cs: Use ResolveWithSimpleName on compound names.
15671
15672 2001-12-02  Ravi Pratap  <ravi@ximian.com>
15673
15674         * constant.cs (EmitConstant): Make sure we resolve the associated expression
15675         before trying to reduce it.
15676
15677         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
15678
15679         * constant.cs (LookupConstantValue): Implement.
15680
15681         (EmitConstant): Use the above in emitting the constant.
15682
15683         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
15684         that are user-defined by doing a LookupConstantValue on them.
15685
15686         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
15687         too, like above.
15688
15689 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
15690
15691         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
15692
15693         (BaseAccess.DoResolve): Implement.
15694
15695         (MemberAccess.DoResolve): Split this routine into a
15696         ResolveMemberAccess routine that can be used independently
15697
15698 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
15699
15700         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
15701         As that share bits of the implementation.  Is returns a boolean,
15702         while As returns the Type that is being probed.
15703
15704 2001-12-01  Ravi Pratap  <ravi@ximian.com>
15705
15706         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
15707         instead of a Literal - much easier.
15708
15709         (EnumInTransit): Remove - utterly useless :-)
15710
15711         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
15712
15713         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
15714
15715         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
15716         chain when we have no associated expression.
15717
15718 2001-11-30  Ravi Pratap  <ravi@ximian.com>
15719
15720         * constant.cs (Define): Use Location while reporting the errror.
15721
15722         Also emit a warning when 'new' is used and there is no inherited
15723         member to hide.
15724
15725         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
15726         populated.
15727
15728         (LookupEnumValue): Implement to lookup an enum member's value and define it
15729         if necessary.
15730
15731         (Populate): Re-write accordingly to use the above routine.
15732
15733 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * expression.cs (This): Fix prototype for DoResolveLValue to
15736         override the base class DoResolveLValue.
15737
15738         * cs-parser.cs: Report errors cs574 and cs575 (destructor
15739         declarations) 
15740
15741         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
15742         (we need to load the address of the field here).  This fixes
15743         test-22. 
15744
15745         (FieldExpr.DoResolveLValue): Call the DoResolve
15746         function to initialize the Instance expression.
15747
15748         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
15749         correctly the GetEnumerator operation on a value type.
15750
15751         * cs-parser.jay: Add more simple parsing error catches.
15752
15753         * statement.cs (Switch): Add support for string switches.
15754         Handle null specially.
15755
15756         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
15757
15758 2001-11-28  Ravi Pratap  <ravi@ximian.com>
15759
15760         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
15761
15762         (declare_local_constant): New helper function.
15763
15764         * statement.cs (AddConstant): Keep a separate record of constants
15765
15766         (IsConstant): Implement to determine if a variable is a constant.
15767
15768         (GetConstantExpression): Implement.
15769
15770         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
15771
15772         * statement.cs (IsVariableDefined): Re-write.
15773
15774 2001-11-27  Ravi Pratap  <ravi@ximian.com>
15775
15776         * class.cs (TypeContainer::FindMembers): Look for constants
15777         in the case when we are looking for MemberTypes.Field
15778
15779         * expression.cs (MemberAccess::DoResolve): Check that in the
15780         case we are a FieldExpr and a Literal, we are not being accessed
15781         by an instance reference.
15782
15783         * cs-parser.jay (local_constant_declaration): Implement.
15784
15785         (declaration_statement): Implement for constant declarations.
15786
15787 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
15788
15789         * statement.cs (Switch): Catch double defaults.
15790
15791         (Switch): More work on the switch() statement
15792         implementation.  It works for integral values now, need to finish
15793         string support.
15794
15795
15796 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
15797
15798         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
15799         integer literals into other integer literals.  To be used by
15800         switch. 
15801
15802 2001-11-24  Ravi Pratap  <ravi@ximian.com>
15803
15804         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
15805         some memory.
15806
15807         (EmitDynamicInitializers): Cope with the above since we extract data
15808         directly from ArrayData now.
15809
15810         (ExpectInitializers): Keep track of whether initializers are mandatory
15811         or not.
15812
15813         (Bounds): Make it a hashtable to prevent the same dimension being 
15814         recorded for every element in that dimension.
15815
15816         (EmitDynamicInitializers): Fix bug which prevented the Set array method
15817         from being found.
15818
15819         Also fix bug which was causing the indices to be emitted in the reverse
15820         order.
15821
15822 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
15823
15824         * expression.cs (ArrayCreation): Implement the bits that Ravi left
15825         unfinished.  They do not work, because the underlying code is
15826         sloppy.
15827
15828 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15829
15830         * cs-parser.jay: Remove bogus fixme.
15831
15832         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
15833         on Switch statement.
15834
15835 2001-11-23  Ravi Pratap  <ravi@ximian.com>
15836
15837         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
15838         the same. 
15839
15840         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
15841         parameter. Apparently, any expression is allowed. 
15842
15843         (ValidateInitializers): Update accordingly.
15844
15845         (CheckIndices): Fix some tricky bugs thanks to recursion.
15846
15847         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
15848         I was being completely brain-dead.
15849
15850         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
15851         and re-write acordingly.
15852
15853         (DelegateInvocation): Re-write accordingly.
15854
15855         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
15856
15857         (MakeByteBlob): Handle types more correctly.
15858
15859         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
15860         initialization from expressions but it is incomplete because I am a complete
15861         Dodo :-|
15862
15863 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15864
15865         * statement.cs (If.Emit): Fix a bug that generated incorrect code
15866         on If.  Basically, we have to return `true' (ie, we do return to
15867         our caller) only if both branches of the if return.
15868
15869         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
15870         short-circuit operators, handle them as short circuit operators. 
15871
15872         (Cast.DoResolve): Resolve type.
15873         (Cast.Cast): Take an expression as the target type.
15874
15875         * cs-parser.jay (cast_expression): Remove old hack that only
15876         allowed a limited set of types to be handled.  Now we take a
15877         unary_expression and we resolve to a type during semantic
15878         analysis.
15879
15880         Use the grammar productions from Rhys to handle casts (this is
15881         not complete like Rhys syntax yet, we fail to handle that corner
15882         case that C# has regarding (-x), but we will get there.
15883
15884 2001-11-22  Ravi Pratap  <ravi@ximian.com>
15885
15886         * class.cs (EmitFieldInitializer): Take care of the case when we have a
15887         field which is an array type.
15888
15889         * cs-parser.jay (declare_local_variables): Support array initialization too.
15890
15891         * typemanager.cs (MakeKey): Implement.
15892
15893         (everywhere): Use the above appropriately.
15894
15895         * cs-parser.jay (for_statement): Update for array initialization while
15896         declaring variables.
15897
15898         * ecore.cs : The error message was correct, it's the variable's names that
15899         were misleading ;-) Make the code more readable.
15900
15901         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
15902         the correct type etc.
15903
15904         (ConvertExplicit): Handle Enum types by examining the underlying type.
15905
15906 2001-11-21  Ravi Pratap  <ravi@ximian.com>
15907
15908         * parameter.cs (GetCallingConvention): Always return
15909         CallingConventions.Standard for now.
15910
15911 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * expression.cs (Binary.ResolveOperator): Update the values of `l'
15914         and `r' after calling DoNumericPromotions.
15915
15916         * ecore.cs: Fix error message (the types were in the wrong order).
15917
15918         * statement.cs (Foreach.ProbeCollectionType): Need to pass
15919         BindingFlags.Instance as well 
15920
15921         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
15922         implicit int literal conversion in an empty cast so that we
15923         propagate the right type upstream.
15924
15925         (UnboxCast): new class used to unbox value types.
15926         (Expression.ConvertExplicit): Add explicit type conversions done
15927         by unboxing.
15928
15929         (Expression.ImplicitNumericConversion): Oops, forgot to test for
15930         the target type before applying the implicit LongLiterals to ULong
15931         literal cast.
15932
15933 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
15934
15935         * cs-parser.jay (for_statement): Reworked the way For works: now
15936         we declare manually any variables that are introduced in
15937         for_initializer to solve the problem of having out-of-band code
15938         emition (that is what got for broken).
15939
15940         (declaration_statement): Perform the actual variable declaration
15941         that used to be done in local_variable_declaration here.
15942
15943         (local_variable_declaration): Do not declare anything, just pass
15944         the information on a DictionaryEntry
15945
15946 2001-11-20  Ravi Pratap  <ravi@ximian.com>
15947
15948         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
15949         re-write of the logic to now make it recursive.
15950
15951         (UpdateIndices): Re-write accordingly.
15952
15953         Store element data in a separate ArrayData list in the above methods.
15954
15955         (MakeByteBlob): Implement to dump the array data into a byte array.
15956
15957 2001-11-19  Ravi Pratap  <ravi@ximian.com>
15958
15959         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
15960         into CheckIndices.
15961
15962         * constant.cs (Define): Implement.
15963
15964         (EmitConstant): Re-write fully.
15965
15966         Pass in location info.
15967
15968         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
15969         respectively.
15970
15971         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
15972         DictionaryEntry since we need location info too.
15973
15974         (constant_declaration): Update accordingly.
15975
15976         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
15977         code into another method : UpdateIndices.
15978
15979 2001-11-18  Ravi Pratap  <ravi@ximian.com>
15980
15981         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
15982         some type checking etc.
15983
15984 2001-11-17  Ravi Pratap  <ravi@ximian.com>
15985
15986         * expression.cs (ArrayCreation::ValidateInitializers): Implement
15987         bits to provide dimension info if the user skips doing that.
15988
15989         Update second constructor to store the rank correctly.
15990
15991 2001-11-16  Ravi Pratap  <ravi@ximian.com>
15992
15993         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
15994         and try to implement.
15995
15996         * ../errors/cs0150.cs : Add.
15997
15998         * ../errors/cs0178.cs : Add.
15999
16000 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * statement.cs: Implement foreach on multi-dimensional arrays. 
16003
16004         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16005         name of the params argument.
16006
16007         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16008         initializing the array.
16009
16010         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16011         we can use this elsewhere.
16012
16013         * statement.cs: Finish implementation of foreach for single
16014         dimension arrays.
16015
16016         * cs-parser.jay: Use an out-of-band stack to pass information
16017         around, I wonder why I need this.
16018
16019         foreach_block: Make the new foreach_block the current_block.
16020
16021         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16022         function used to return a static Parameters structure.  Used for
16023         empty parameters, as those are created very frequently.
16024
16025         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16026
16027 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16028
16029         * interface.cs : Default modifier is private, not public. The
16030         make verify test passes again.
16031
16032 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16033
16034         * support.cs (ReflectionParameters): Fix logic to determine
16035         whether the last parameter is a params one. Test 9 passes again.
16036
16037         * delegate.cs (Populate): Register the builders we define with
16038         RegisterParameterForBuilder. Test 19 passes again.
16039
16040         * cs-parser.jay (property_declaration): Reference $6 instead
16041         of $$ to get at the location.
16042
16043         (indexer_declaration): Similar stuff.
16044
16045         (attribute): Ditto.
16046
16047         * class.cs (Property): Register parameters for the Get and Set methods
16048         if they exist. Test 23 passes again.
16049
16050         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16051         call to EmitArguments as we are sure there aren't any params arguments. 
16052         Test 32 passes again.
16053
16054         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16055         IndexOutOfRangeException. 
16056
16057         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16058         Test 33 now passes again.
16059
16060 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16063         broke a bunch of things.  Will have to come up with a better way
16064         of tracking locations.
16065
16066         * statement.cs: Implemented foreach for single dimension arrays.
16067
16068 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16071         an error.  This removes the lookup from the critical path.
16072
16073         * cs-parser.jay: Removed use of temporary_loc, which is completely
16074         broken. 
16075
16076 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16077
16078         * support.cs (ReflectionParameters.ParameterModifier): Report
16079         whether the argument is a PARAMS argument or not.
16080
16081         * class.cs: Set the attribute `ParamArrayAttribute' on the
16082         parameter argument.
16083
16084         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16085         and cons_param_array_attribute (ConstructorInfo for
16086         ParamArrayAttribute)., 
16087
16088         * codegen.cs: Emit the return using the `Return' statement, that
16089         way we can report the error correctly for missing return values. 
16090
16091         * class.cs (Method.Emit): Clean up.
16092
16093         * expression.cs (Argument.Resolve): Take another argument: the
16094         location where this argument is used.  Notice that this is not
16095         part of the "Argument" class as to reduce the size of the
16096         structure (we know the approximate location anyways).
16097
16098         Test if the argument is a variable-reference, if not, then
16099         complain with a 206.
16100
16101         (Argument.Emit): Emit addresses of variables.
16102
16103         (Argument.FullDesc): Simplify.
16104
16105         (Invocation.DoResolve): Update for Argument.Resolve.
16106
16107         (ElementAccess.DoResolve): ditto.
16108
16109         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16110         method should be virtual, as this method is always virtual.
16111
16112         (NewDelegate.DoResolve): Update for Argument.Resolve.
16113
16114         * class.cs (ConstructorInitializer.DoResolve): ditto.
16115
16116         * attribute.cs (Attribute.Resolve): ditto.
16117
16118 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16119
16120         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16121
16122         * expression.cs (ParameterReference): Drop IStackStorage and implement
16123         IAssignMethod instead. 
16124
16125         (LocalVariableReference): ditto.
16126
16127         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16128         IAssignMethod instead. 
16129
16130 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16131
16132         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16133         enumerations that are used in heavily used structures derive from
16134         byte in a laughable and pathetic attempt to reduce memory usage.
16135         This is the kind of pre-optimzations that you should not do at
16136         home without adult supervision.
16137
16138         * expression.cs (UnaryMutator): New class, used to handle ++ and
16139         -- separatedly from the other unary operators.  Cleans up the
16140         code, and kills the ExpressionStatement dependency in Unary.
16141
16142         (Unary): Removed `method' and `Arguments' from this class, making
16143         it smaller, and moving it all to SimpleCall, so I can reuse this
16144         code in other locations and avoid creating a lot of transient data
16145         strucutres when not required.
16146
16147         * cs-parser.jay: Adjust for new changes.
16148
16149 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16150
16151         * enum.cs (Enum.Populate): If there is a failure during
16152         definition, return
16153
16154         * cs-parser.jay (opt_enum_base): we used to catch type errors
16155         here, but this is really incorrect.  The type error should be
16156         catched during semantic analysis.
16157
16158 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16159
16160         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16161         current_local_parameters as expected since I, in my stupidity, had forgotten
16162         to do this :-)
16163
16164         * attribute.cs (GetValidPlaces): Fix stupid bug.
16165
16166         * class.cs (Method::Emit): Perform check on applicability of attributes.
16167
16168         (Constructor::Emit): Ditto.
16169
16170         (Field::Emit): Ditto.
16171
16172         (Field.Location): Store location information.
16173
16174         (Property, Event, Indexer, Operator): Ditto.
16175
16176         * cs-parser.jay (field_declaration): Pass in location for each field.
16177
16178         * ../errors/cs0592.cs : Add.
16179
16180 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16181
16182         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16183
16184         (InitCoreTypes): Update accordingly.
16185
16186         (RegisterAttrType, LookupAttr): Implement.
16187
16188         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16189         info about the same.
16190
16191         (Resolve): Update to populate the above as necessary.
16192
16193         (Error592): Helper.
16194
16195         (GetValidPlaces): Helper to the above.
16196
16197         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16198
16199         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16200
16201 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16202
16203         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16204
16205         * ../errors/cs0617.cs : Add.
16206
16207 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16208
16209         * enum.cs (Emit): Rename to Populate to be more consistent with what
16210         we expect it to do and when exactly it is called.
16211
16212         * class.cs, rootcontext.cs : Update accordingly.
16213
16214         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16215         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16216
16217         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16218
16219         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16220         of a fieldinfo using the above, when dealing with a FieldBuilder.
16221
16222 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16223
16224         * ../errors/cs0031.cs : Add.
16225
16226         * ../errors/cs1008.cs : Add.
16227
16228         * ../errrors/cs0543.cs : Add.
16229
16230         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16231         enum type.
16232
16233         (FindMembers): Implement.
16234
16235         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16236         enums and delegates too.
16237
16238         (enum_types): Rename to builder_to_enum.
16239
16240         (delegate_types): Rename to builder_to_delegate.
16241
16242         * delegate.cs (FindMembers): Implement.
16243
16244 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16245
16246         * typemanager.cs (IsEnumType): Implement.
16247
16248         * enum.cs (Emit): Re-write parts to account for the underlying type
16249         better and perform checking etc.
16250
16251         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16252         of the underlying type.
16253
16254         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16255         value
16256
16257         * enum.cs (error31): Helper to report error #31.
16258
16259         * cs-parser.jay (enum_declaration): Store location of each member too.
16260
16261         * enum.cs (member_to_location): New hashtable. 
16262
16263         (AddEnumMember): Update location hashtable.
16264
16265         (Emit): Use the location of each member while reporting errors.
16266
16267 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16268
16269         * cs-parser.jay: A for_initializer if is a
16270         local_variable_declaration really ammount to have an implicit
16271         block with the variable declaration and no initializer for for.
16272
16273         * statement.cs (For.Emit): Cope with null initializers.
16274
16275         This fixes the infinite loop on for initializers.
16276
16277 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16278
16279         * enum.cs: More cleanup.
16280
16281         * ecore.cs: Remove dead code.
16282
16283         * class.cs (Property.Emit): More simplification.
16284         (Event.Emit): ditto.
16285
16286         Reworked to have less levels of indentation.
16287
16288 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16289
16290         * class.cs (Property): Emit attributes.
16291
16292         (Field): Ditto.
16293
16294         (Event): Ditto.
16295
16296         (Indexer): Ditto.
16297
16298         (Operator): Ditto.
16299
16300         * enum.cs (Emit): Ditto.
16301
16302         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16303         Enums too.
16304
16305         * class.cs (Field, Event, etc.): Move attribute generation into the
16306         Emit method everywhere.
16307
16308         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16309         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16310         as we had no way of defining nested enums !
16311
16312         * rootcontext.cs : Adjust code accordingly.
16313
16314         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16315
16316 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16317
16318         * expression.cs (EvalConstantExpression): Move into ecore.cs
16319
16320         * enum.cs (Enum): Rename some members and make them public and readonly
16321         according to our convention.
16322
16323         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16324         nothing else.
16325
16326         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16327
16328         (Enum::Emit): Write a simple version for now which doesn't try to compute
16329         expressions. I shall modify this to be more robust in just a while.
16330
16331         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16332
16333         (TypeContainer::CloseType): Create the Enum types too.
16334
16335         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16336
16337         * expression.cs (EvalConstantExpression): Get rid of completely.
16338
16339         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16340         user-defined values and other cases.
16341
16342         (IsValidEnumLiteral): Helper function.
16343
16344         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16345         out there in the case we had a literal FieldExpr.
16346
16347         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16348
16349         (Literalize): Revamp a bit to take two arguments.
16350
16351         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16352
16353 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16354
16355         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16356
16357         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16358
16359         (Resolve): Use the above to ensure we have proper initializers.
16360
16361 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16362
16363         * expression.cs (Expression::EvalConstantExpression): New method to 
16364         evaluate constant expressions.
16365
16366         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16367
16368 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16369
16370         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16371         in an array.
16372
16373         (Binary.ResolveOperator): Handle operator != (object a, object b)
16374         and operator == (object a, object b);
16375
16376         (Binary.DoNumericPromotions): Indicate whether the numeric
16377         promotion was possible.
16378
16379         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16380         Implement.  
16381
16382         Made the ArrayAccess implement interface IAssignMethod instead of
16383         IStackStore as the order in which arguments are passed reflects
16384         this.
16385
16386         * assign.cs: Instead of using expr.ExprClass to select the way of
16387         assinging, probe for the IStackStore/IAssignMethod interfaces.
16388
16389         * typemanager.cs: Load InitializeArray definition.
16390
16391         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16392         static data that can be used to initialize arrays. 
16393
16394 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16395
16396         * expression.cs: Handle operator== and operator!= for booleans.
16397
16398         (Conditioal.Reduce): Implement reducer for the ?: operator.
16399
16400         (Conditional.Resolve): Implement dead code elimination.
16401
16402         (Binary.Resolve): Catch string literals and return a new
16403         concatenated string.
16404
16405         (Unary.Reduce): Implement reduction of unary expressions.
16406
16407         * ecore.cs: Split out the expression core handling here.
16408
16409         (Expression.Reduce): New method used to perform constant folding
16410         and CSE.  This is needed to support constant-expressions. 
16411
16412         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16413         targets, and optimize for !x.
16414
16415 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16416
16417         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16418         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16419         set custom atttributes.
16420
16421         * literal.cs (Literal::GetValue): New abstract method to return the actual
16422         value of the literal, cast as an object.
16423
16424         (*Literal): Implement GetValue method.
16425
16426         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16427         expressions to the arraylist but objects of type Argument.
16428
16429         * class.cs (TypeContainer::Emit): Emit our attributes too.
16430
16431         (Method::Emit, Constructor::Emit): Ditto.
16432
16433         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16434         to be ignoring earlier.
16435
16436 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16437
16438         * attribute.cs (AttributeSection::Define): Implement to do the business
16439         of constructing a CustomAttributeBuilder.
16440
16441         (Attribute): New trivial class. Increases readability of code.  
16442
16443         * cs-parser.jay : Update accordingly.
16444
16445         (positional_argument_list, named_argument_list, named_argument): New rules
16446
16447         (attribute_arguments): Use the above so that we are more correct.
16448
16449 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16450
16451         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16452         to perform all checks for a method with a params parameter.
16453
16454         (Invocation::OverloadResolve): Update to use the above method and therefore
16455         cope correctly with params method invocations.
16456
16457         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16458         params too.
16459
16460         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16461         constructors in our parent too because we can't afford to miss out on 
16462         protected ones ;-)
16463
16464         * attribute.cs (AttributeSection): New name for the class Attribute
16465
16466         Other trivial changes to improve readability.
16467
16468         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16469         use the new class names.
16470
16471 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16472
16473         * class.cs (Method::Define): Complete definition for params types too
16474
16475         (Indexer::Define): Ditto.
16476
16477         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16478         Cope everywhere with a request for info about the array parameter.
16479
16480 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16481
16482         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16483
16484         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16485         local_variable_type to extract the string corresponding to the type.
16486
16487         (local_variable_type): Fixup the action to use the new helper method.
16488
16489         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16490         go.
16491
16492         * expression.cs : Clean out code which uses the above.
16493
16494 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16495
16496         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16497         and bale out if necessary by returning a false.
16498
16499         (RegisterProperty): Ditto.
16500
16501         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16502         and print out appropriate error messages.
16503
16504         * interface.cs (everywhere): Ditto.
16505
16506         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16507         location to constructor.
16508
16509         * class.cs (Property, Event, Indexer): Update accordingly.
16510
16511         * ../errors/cs111.cs : Added.
16512
16513         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16514         of a method, as laid down by the spec.
16515
16516         (Invocation::OverloadResolve): Use the above method.
16517
16518 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16519
16520         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16521         now take a TypeContainer and a Parameters object.
16522
16523         (ParameterData): Modify return type of ParameterModifier method to be 
16524         Parameter.Modifier and not a string.
16525
16526         (ReflectionParameters, InternalParameters): Update accordingly.
16527
16528         * expression.cs (Argument::GetParameterModifier): Same here.
16529
16530         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16531         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16532         symbol in it at all so maybe this is only for now.
16533
16534 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16535
16536         * support.cs (InternalParameters): Constructor now takes an extra argument 
16537         which is the actual Parameters class.
16538
16539         (ParameterDesc): Update to provide info on ref/out modifiers.
16540
16541         * class.cs (everywhere): Update call to InternalParameters to pass in
16542         the second argument too.
16543
16544         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16545         to return the modifier info [ref/out etc]
16546
16547         (InternalParameters, ReflectionParameters): Implement the above.
16548
16549         * expression.cs (Argument::ParameterModifier): Similar function to return
16550         info about the argument's modifiers.
16551
16552         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16553         too.
16554
16555         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16556         a new SetFormalParameters object which we pass to InternalParameters.
16557
16558 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16559
16560         * expression.cs (NewArray): Merge into the ArrayCreation class.
16561
16562 2001-10-29  Ravi Pratap  <ravi@ximian.com>
16563
16564         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
16565         NewUserdefinedArray into one as there wasn't much of a use in having
16566         two separate ones.
16567
16568         * expression.cs (Argument): Change field's name to ArgType from Type.
16569
16570         (Type): New readonly property which returns the proper type, taking into 
16571         account ref/out modifiers.
16572
16573         (everywhere): Adjust code accordingly for the above.
16574
16575         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16576         whether we are emitting for a ref or out parameter.
16577
16578         * expression.cs (Argument::Emit): Use the above field to set the state.
16579
16580         (LocalVariableReference::Emit): Update to honour the flag and emit the
16581         right stuff.
16582
16583         * parameter.cs (Attributes): Set the correct flags for ref parameters.
16584
16585         * expression.cs (Argument::FullDesc): New function to provide a full desc.
16586
16587         * support.cs (ParameterData): Add method ParameterDesc to the interface.
16588
16589         (ReflectionParameters, InternalParameters): Implement the above method.
16590
16591         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
16592         reporting errors.
16593
16594         (Invocation::FullMethodDesc): Ditto. 
16595
16596 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
16597
16598         * cs-parser.jay: Add extra production for the second form of array
16599         creation. 
16600
16601         * expression.cs (ArrayCreation): Update to reflect the above
16602         change. 
16603
16604         * Small changes to prepare for Array initialization.
16605
16606 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * typemanager.cs (ImplementsInterface): interface might be null;
16609         Deal with this problem;
16610
16611         Also, we do store negative hits on the cache (null values), so use
16612         this instead of calling t.GetInterfaces on the type everytime.
16613
16614 2001-10-28  Ravi Pratap  <ravi@ximian.com>
16615
16616         * typemanager.cs (IsBuiltinType): New method to help determine the same.
16617
16618         * expression.cs (New::DoResolve): Get rid of array creation code and instead
16619         split functionality out into different classes.
16620
16621         (New::FormArrayType): Move into NewBuiltinArray.
16622
16623         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
16624         quite useless.
16625
16626         (NewBuiltinArray): New class to handle creation of built-in arrays.
16627
16628         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
16629         account creation of one-dimensional arrays.
16630
16631         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
16632
16633         (NewUserdefinedArray::DoResolve): Implement.
16634
16635         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
16636
16637         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
16638         we maintain inside the TypeManager. This is necessary to perform lookups on the
16639         module builder.
16640
16641         (LookupType): Update to perform GetType on the module builders too.     
16642
16643         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
16644
16645         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
16646
16647 2001-10-23  Ravi Pratap  <ravi@ximian.com>
16648
16649         * expression.cs (New::DoResolve): Implement guts of array creation.
16650
16651         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
16652
16653 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
16654
16655         * expression.cs: Fix bug I introduced lsat night that broke
16656         Delegates. 
16657
16658         (Expression.Resolve): Report a 246 error (can not resolve name)
16659         if we find a SimpleName in the stream.
16660
16661         (Expression.ResolveLValue): Ditto.
16662
16663         (Expression.ResolveWithSimpleName): This function is a variant of
16664         ResolveName, this one allows SimpleNames to be returned without a
16665         warning.  The only consumer of SimpleNames is MemberAccess
16666
16667 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
16670         might arrive here.  I have my doubts that this is correct.
16671
16672         * statement.cs (Lock): Implement lock statement.
16673
16674         * cs-parser.jay: Small fixes to support `lock' and `using'
16675
16676         * cs-tokenizer.cs: Remove extra space
16677
16678         * driver.cs: New flag --checked, allows to turn on integer math
16679         checking. 
16680
16681         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
16682         Threading.Monitor.Exit 
16683
16684 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
16685
16686         * expression.cs (IndexerAccess::DoResolveLValue): Set the
16687         Expression Class to be IndexerAccess.
16688
16689         Notice that Indexer::DoResolve sets the eclass to Value.
16690
16691 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
16692
16693         * class.cs (TypeContainer::Emit): Emit code for indexers.
16694
16695         * assign.cs (IAssignMethod): New interface implemented by Indexers
16696         and Properties for handling assignment.
16697
16698         (Assign::Emit): Simplify and reuse code. 
16699
16700         * expression.cs (IndexerAccess, PropertyExpr): Implement
16701         IAssignMethod, clean up old code. 
16702
16703 2001-10-22  Ravi Pratap  <ravi@ximian.com>
16704
16705         * typemanager.cs (ImplementsInterface): New method to determine if a type
16706         implements a given interface. Provides a nice cache too.
16707
16708         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
16709         method.
16710
16711         (ConvertReferenceExplicit): Ditto.
16712
16713         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
16714         various methods, with correct names etc.
16715
16716         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
16717         Operator.UnaryNegation.
16718
16719         * cs-parser.jay (operator_declarator): Be a little clever in the case where
16720         we have a unary plus or minus operator.
16721
16722         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
16723         UnaryMinus.
16724
16725         * everywhere : update accordingly.
16726
16727         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
16728         respectively.
16729
16730         * class.cs (Method::Define): For the case where we are implementing a method
16731         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
16732         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
16733
16734 2001-10-21  Ravi Pratap  <ravi@ximian.com>
16735
16736         * interface.cs (FindMembers): Implement to work around S.R.E
16737         lameness.
16738
16739         * typemanager.cs (IsInterfaceType): Implement.
16740
16741         (FindMembers): Update to handle interface types too.
16742
16743         * expression.cs (ImplicitReferenceConversion): Re-write bits which
16744         use IsAssignableFrom as that is not correct - it doesn't work.
16745
16746         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
16747         and accordingly override EmitStatement.
16748
16749         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
16750         using the correct logic :-)
16751
16752 2001-10-19  Ravi Pratap  <ravi@ximian.com>
16753
16754         * ../errors/cs-11.cs : Add to demonstrate error -11 
16755
16756 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
16757
16758         * assign.cs (Assign::Resolve): Resolve right hand side first, and
16759         then pass this as a hint to ResolveLValue.
16760
16761         * expression.cs (FieldExpr): Add Location information
16762
16763         (FieldExpr::LValueResolve): Report assignment to readonly
16764         variable. 
16765
16766         (Expression::ExprClassFromMemberInfo): Pass location information.
16767
16768         (Expression::ResolveLValue): Add new method that resolves an
16769         LValue. 
16770
16771         (Expression::DoResolveLValue): Default invocation calls
16772         DoResolve. 
16773
16774         (Indexers): New class used to keep track of indexers in a given
16775         Type. 
16776
16777         (IStackStore): Renamed from LValue, as it did not really describe
16778         what this did.  Also ResolveLValue is gone from this interface and
16779         now is part of Expression.
16780
16781         (ElementAccess): Depending on the element access type
16782
16783         * typemanager.cs: Add `indexer_name_type' as a Core type
16784         (System.Runtime.CompilerServices.IndexerNameAttribute)
16785
16786         * statement.cs (Goto): Take a location.
16787
16788 2001-10-18  Ravi Pratap  <ravi@ximian.com>
16789
16790         * delegate.cs (Delegate::VerifyDelegate): New method to verify
16791         if two delegates are compatible.
16792
16793         (NewDelegate::DoResolve): Update to take care of the case when
16794         we instantiate a delegate from another delegate.
16795
16796         * typemanager.cs (FindMembers): Don't even try to look up members
16797         of Delegate types for now.
16798
16799 2001-10-18  Ravi Pratap  <ravi@ximian.com>
16800
16801         * delegate.cs (NewDelegate): New class to take care of delegate
16802         instantiation.
16803
16804         * expression.cs (New): Split the delegate related code out into 
16805         the NewDelegate class.
16806
16807         * delegate.cs (DelegateInvocation): New class to handle delegate 
16808         invocation.
16809
16810         * expression.cs (Invocation): Split out delegate related code into
16811         the DelegateInvocation class.
16812
16813 2001-10-17  Ravi Pratap  <ravi@ximian.com>
16814
16815         * expression.cs (New::DoResolve): Implement delegate creation fully
16816         and according to the spec.
16817
16818         (New::DoEmit): Update to handle delegates differently.
16819
16820         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
16821         because of which we were printing out arguments in reverse order !
16822
16823         * delegate.cs (VerifyMethod): Implement to check if the given method
16824         matches the delegate.
16825
16826         (FullDelegateDesc): Implement.
16827
16828         (VerifyApplicability): Implement.
16829
16830         * expression.cs (Invocation::DoResolve): Update to accordingly handle
16831         delegate invocations too.
16832
16833         (Invocation::Emit): Ditto.
16834
16835         * ../errors/cs1593.cs : Added.
16836
16837         * ../errors/cs1594.cs : Added.
16838
16839         * delegate.cs (InstanceExpression, TargetMethod): New properties.
16840
16841 2001-10-16  Ravi Pratap  <ravi@ximian.com>
16842
16843         * typemanager.cs (intptr_type): Core type for System.IntPtr
16844
16845         (InitCoreTypes): Update for the same.
16846
16847         (iasyncresult_type, asynccallback_type): Ditto.
16848
16849         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
16850         correct.
16851
16852         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
16853         too.
16854
16855         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
16856         the builders for the 4 members of a delegate type :-)
16857
16858         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
16859         type.
16860
16861         * expression.cs (New::DoResolve): Implement guts for delegate creation.
16862
16863         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
16864
16865 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
16866
16867         * statement.cs (Break::Emit): Implement.   
16868         (Continue::Emit): Implement.
16869
16870         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16871         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16872         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16873         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
16874         end loop
16875
16876         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
16877         properties that track the label for the current loop (begin of the
16878         loop and end of the loop).
16879
16880 2001-10-15  Ravi Pratap  <ravi@ximian.com>
16881
16882         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
16883         use of emitting anything at all.
16884
16885         * class.cs, rootcontext.cs : Get rid of calls to the same.
16886
16887         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
16888
16889         (Populate): Define the constructor correctly and set the implementation
16890         attributes.
16891
16892         * typemanager.cs (delegate_types): New hashtable to hold delegates that
16893         have been defined.
16894
16895         (AddDelegateType): Implement.
16896
16897         (IsDelegateType): Implement helper method.
16898
16899         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
16900
16901         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
16902         and accordingly handle it.
16903
16904         * delegate.cs (Populate): Take TypeContainer argument.
16905         Implement bits to define the Invoke method. However, I still haven't figured out
16906         how to take care of the native int bit :-(
16907
16908         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
16909         Qualify the name of the delegate, not its return type !
16910
16911         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
16912         conversion.
16913
16914         (StandardConversionExists): Checking for array types turns out to be recursive.
16915
16916         (ConvertReferenceExplicit): Implement array conversion.
16917
16918         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
16919
16920 2001-10-12  Ravi Pratap  <ravi@ximian.com>
16921
16922         * cs-parser.jay (delegate_declaration): Store the fully qualified
16923         name as it is a type declaration.
16924
16925         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
16926         readonly.
16927
16928         (DefineDelegate): Renamed from Define. Does the same thing essentially,
16929         as TypeContainer::DefineType.
16930
16931         (Populate): Method in which all the definition of the various methods (Invoke)
16932         etc is done.
16933
16934         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
16935         see.
16936
16937         (CloseDelegate): Finally creates the delegate.
16938
16939         * class.cs (TypeContainer::DefineType): Update to define delegates.
16940         (Populate, Emit and CloseType): Do the same thing here too.
16941
16942         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
16943         delegates in all these operations.
16944
16945 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
16946
16947         * expression.cs: LocalTemporary: a new expression used to
16948         reference a temporary that has been created.
16949
16950         * assign.cs: Handle PropertyAccess back here, so that we can
16951         provide the proper semantic access to properties.
16952
16953         * expression.cs (Expression::ConvertReferenceExplicit): Implement
16954         a few more explicit conversions. 
16955
16956         * modifiers.cs: `NEW' modifier maps to HideBySig.
16957
16958         * expression.cs (PropertyExpr): Make this into an
16959         ExpressionStatement, and support the EmitStatement code path. 
16960
16961         Perform get/set error checking, clean up the interface.
16962
16963         * assign.cs: recognize PropertyExprs as targets, and if so, turn
16964         them into toplevel access objects.
16965
16966 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
16967
16968         * expression.cs: PropertyExpr::PropertyExpr: use work around the
16969         SRE.
16970
16971         * typemanager.cs: Keep track here of our PropertyBuilders again to
16972         work around lameness in SRE.
16973
16974 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
16975
16976         * expression.cs (LValue::LValueResolve): New method in the
16977         interface, used to perform a second resolution pass for LValues. 
16978
16979         (This::DoResolve): Catch the use of this in static methods.
16980
16981         (This::LValueResolve): Implement.
16982
16983         (This::Store): Remove warning, assigning to `this' in structures
16984         is 
16985
16986         (Invocation::Emit): Deal with invocation of
16987         methods on value types.  We need to pass the address to structure
16988         methods rather than the object itself.  (The equivalent code to
16989         emit "this" for structures leaves the entire structure on the
16990         stack instead of a pointer to it). 
16991
16992         (ParameterReference::DoResolve): Compute the real index for the
16993         argument based on whether the method takes or not a `this' pointer
16994         (ie, the method is static).
16995
16996         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
16997         value types returned from functions when we need to invoke a
16998         method on the sturcture.
16999
17000
17001 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17002
17003         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17004         defining the type in the Modulebuilder or Typebuilder. This is to take
17005         care of nested types which need to be defined on the TypeBuilder using
17006         DefineNestedMethod.
17007
17008         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17009         methods in RootContext, only ported to be part of TypeContainer.
17010
17011         (TypeContainer::GetInterfaceOrClass): Ditto.
17012
17013         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17014
17015         * interface.cs (Interface::DefineInterface): New method. Does exactly
17016         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17017         too.
17018
17019         (Interface::GetInterfaces): Move from RootContext here and port.
17020
17021         (Interface::GetInterfaceByName): Same here.
17022
17023         * rootcontext.cs (ResolveTree): Re-write.
17024
17025         (PopulateTypes): Re-write.
17026
17027         * class.cs (TypeContainer::Populate): Populate nested types too.
17028         (TypeContainer::Emit): Emit nested members too.
17029
17030         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17031         instead just use the name argument passed in as it is already fully
17032         qualified.
17033
17034         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17035         to TypeContainer mapping to see if a type is user-defined.
17036
17037         * class.cs (TypeContainer::CloseType): Implement. 
17038
17039         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17040         the default constructor.
17041
17042         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17043         twice.
17044
17045         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17046
17047         * interface.cs (CloseType): Create the type here.
17048
17049         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17050         the hierarchy.
17051
17052         Remove all the methods which are now in TypeContainer.
17053
17054 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17055
17056         * delegate.cs (Define): Re-write bits to define the delegate
17057         correctly.
17058
17059 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17060
17061         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17062
17063         * expression.cs (ImplicitReferenceConversion): handle null as well
17064         as a source to convert to any reference type.
17065
17066         * statement.cs (Return): Perform any implicit conversions to
17067         expected return type.  
17068
17069         Validate use of return statement.  
17070
17071         * codegen.cs (EmitContext): Pass the expected return type here.
17072
17073         * class.cs (Method, Constructor, Property): Pass expected return
17074         type to EmitContext.
17075
17076 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * expression.cs: Make DoResolve take an EmitContext instead of a
17079         TypeContainer.
17080
17081         Replaced `l' and `location' for `loc', for consistency.
17082
17083         (Error, Warning): Remove unneeded Tc argument.
17084
17085         * assign.cs, literal.cs, constant.cs: Update to new calling
17086         convention. 
17087
17088         * codegen.cs: EmitContext now contains a flag indicating whether
17089         code is being generated in a static method or not.
17090
17091         * cs-parser.jay: DecomposeQI, new function that replaces the old
17092         QualifiedIdentifier.  Now we always decompose the assembled
17093         strings from qualified_identifier productions into a group of
17094         memberaccesses.
17095
17096 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17097
17098         * rootcontext.cs: Deal with field-less struct types correctly now
17099         by passing the size option to Define Type.
17100
17101         * class.cs: Removed hack that created one static field. 
17102
17103 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * statement.cs: Moved most of the code generation here. 
17106
17107 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17108
17109         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17110         seem very right.
17111
17112         (ElementAccess): Remove useless bits for now - keep checks as the spec
17113         says.
17114
17115 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17116
17117         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17118         and start performing checks according to the spec.
17119
17120 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17121
17122         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17123         rank_specifiers instead.
17124
17125         (rank_specifiers): Change the order in which the rank specifiers are stored
17126
17127         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17128
17129         * expression.cs (ElementAccess): Implement the LValue interface too.
17130
17131 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17132
17133         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17134         except that user defined conversions are not included.
17135
17136         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17137         perform the conversion of the return type, if necessary.
17138
17139         (New::DoResolve): Check whether we are creating an array or an object
17140         and accordingly do the needful.
17141
17142         (New::Emit): Same here.
17143
17144         (New::DoResolve): Implement guts of array creation.
17145
17146         (New::FormLookupType): Helper function.
17147
17148 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * codegen.cs: Removed most of the code generation here, and move the
17151         corresponding code generation bits to the statement classes. 
17152
17153         Added support for try/catch/finalize and throw.
17154
17155         * cs-parser.jay: Added support for try/catch/finalize.
17156
17157         * class.cs: Catch static methods having the flags override,
17158         virtual or abstract.
17159
17160         * expression.cs (UserCast): This user cast was not really doing
17161         what it was supposed to do.  Which is to be born in fully resolved
17162         state.  Parts of the resolution were being performed at Emit time! 
17163
17164         Fixed this code.
17165
17166 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * expression.cs: Implicity convert the result from UserCast.
17169
17170 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17171
17172         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17173         prevented it from working correctly. 
17174
17175         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17176         merely ConvertImplicit.
17177
17178 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * typemanager.cs: Make the LookupTypeContainer function static,
17181         and not per-instance.  
17182
17183         * class.cs: Make static FindMembers (the one that takes a Type
17184         argument). 
17185
17186         * codegen.cs: Add EmitForeach here.
17187
17188         * cs-parser.jay: Make foreach a toplevel object instead of the
17189         inline expansion, as we need to perform semantic analysis on it. 
17190
17191 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17192
17193         * expression.cs (Expression::ImplicitUserConversion): Rename to
17194         UserDefinedConversion.
17195
17196         (Expression::UserDefinedConversion): Take an extra argument specifying 
17197         whether we look for explicit user conversions too.
17198
17199         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17200
17201         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17202
17203         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17204         with the appropriate arguments.
17205
17206         * cs-parser.jay (cast_expression): Record location too.
17207
17208         * expression.cs (Cast): Record location info.
17209
17210         (Expression::ConvertExplicit): Take location argument.
17211
17212         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17213         to determine if we are doing explicit conversions.
17214
17215         (UserCast::Emit): Update accordingly.
17216
17217         (Expression::ConvertExplicit): Report an error if everything fails.
17218
17219         * ../errors/cs0030.cs : Add.
17220
17221 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17224         virtual and newslot bits. 
17225
17226         * class.cs (TypeContainer::RegisterRequiredImplementations):
17227         Record methods we need.
17228
17229         (TypeContainer::MakeKey): Helper function to make keys for
17230         MethodBases, since the Methodbase key is useless.
17231
17232         (TypeContainer::Populate): Call RegisterRequiredImplementations
17233         before defining the methods.   
17234
17235         Create a mapping for method_builders_to_methods ahead of time
17236         instead of inside a tight loop.
17237
17238         (::RequireMethods):  Accept an object as the data to set into the
17239         hashtable so we can report interface vs abstract method mismatch.
17240
17241 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17242
17243         * report.cs: Make all of it static.
17244
17245         * rootcontext.cs: Drop object_type and value_type computations, as
17246         we have those in the TypeManager anyways.
17247
17248         Drop report instance variable too, now it is a global.
17249
17250         * driver.cs: Use try/catch on command line handling.
17251
17252         Add --probe option to debug the error reporting system with a test
17253         suite. 
17254
17255         * report.cs: Add support for exiting program when a probe
17256         condition is reached.
17257
17258 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17259
17260         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17261         we do a forcible conversion regardless of type, to check if 
17262         ForceConversion returns a null.
17263
17264         (Binary::error19): Use location to report error.
17265
17266         (Unary::error23): Use location here too.
17267
17268         * ../errors/cs0019.cs : Check in.
17269
17270         * ../errors/cs0023.cs : Check in.
17271
17272         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17273         case of a non-null MethodInfo object with a length of 0 !
17274
17275         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17276         an applicable member - according to the spec :-)
17277         Also fix logic to find members in base types.
17278
17279         (Unary::ResolveOperator): Same here.
17280
17281         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17282         as I was getting thoroughly confused between this and error19 :-)
17283
17284         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17285         (::FindMostEncompassedType): Implement.
17286         (::FindMostEncompassingType): Implement.
17287         (::StandardConversionExists): Implement.
17288
17289         (UserImplicitCast): Re-vamp. We now need info about most specific
17290         source and target types so that we can do the necessary conversions.
17291
17292         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17293         mathematical union with no duplicates.
17294
17295 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17296
17297         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17298         in order from base classes to child classes, so that we can in
17299         child classes look up in our parent for method names and
17300         attributes (required for handling abstract, virtual, new, override
17301         constructs: we need to instrospect our base class, and if we dont
17302         populate the classes in order, the introspection might be
17303         incorrect.  For example, a method could query its parent before
17304         the parent has any methods and would determine that the parent has
17305         no abstract methods (while it could have had them)).
17306
17307         (RootContext::CreateType): Record the order in which we define the
17308         classes.
17309
17310 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17311
17312         * class.cs (TypeContainer::Populate): Also method definitions can
17313         fail now, keep track of this.
17314
17315         (TypeContainer::FindMembers): Implement support for
17316         DeclaredOnly/noDeclaredOnly flag.
17317
17318         (Constructor::Emit) Return the ConstructorBuilder.
17319
17320         (Method::Emit) Return the MethodBuilder. 
17321         Check for abstract or virtual methods to be public.
17322
17323         * rootcontext.cs (RootContext::CreateType): Register all the
17324         abstract methods required for the class to be complete and the
17325         interface methods that must be implemented. 
17326
17327         * cs-parser.jay: Report error 501 (method requires body if it is
17328         not marked abstract or extern).
17329
17330         * expression.cs (TypeOf::Emit): Implement.
17331
17332         * typemanager.cs: runtime_handle_type, new global type.
17333
17334         * class.cs (Property::Emit): Generate code for properties.
17335
17336 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17337
17338         * expression.cs (Unary::ResolveOperator): Find operators on base type
17339         too - we now conform exactly to the spec.
17340
17341         (Binary::ResolveOperator): Same here.
17342
17343         * class.cs (Operator::Define): Fix minor quirk in the tests.
17344
17345         * ../errors/cs0215.cs : Added.
17346
17347         * ../errors/cs0556.cs : Added.
17348
17349         * ../errors/cs0555.cs : Added.
17350
17351 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17352
17353         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17354         single integer which is really efficient
17355
17356 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17357
17358         *  expression.cs (Expression::ImplicitUserConversion): Use location
17359         even in the case when we are examining True operators.
17360  
17361         * class.cs (Operator::Define): Perform extensive checks to conform
17362         with the rules for operator overloading in the spec.
17363
17364         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17365         some of the other conversions mentioned in the spec.
17366
17367         * typemanager.cs (array_type): New static member for the System.Array built-in
17368         type.
17369
17370         (cloneable_interface): For System.ICloneable interface.
17371
17372         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17373         we start resolving the tree and populating types.
17374
17375         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17376  
17377 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * expression.cs (Expression::ExprClassFromMemberInfo,
17380         Expression::Literalize): Create literal expressions from
17381         FieldInfos which are literals.
17382
17383         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17384         type casts, because they were wrong.  The test suite in tests
17385         caught these ones.
17386
17387         (ImplicitNumericConversion): ushort to ulong requires a widening
17388         cast. 
17389
17390         Int32 constant to long requires widening cast as well.
17391
17392         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17393         for integers because the type on the stack is not i4.
17394
17395 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17396
17397         * expression.cs (report118): require location argument. 
17398
17399         * parameter.cs: Do not dereference potential null value.
17400
17401         * class.cs: Catch methods that lack the `new' keyword when
17402         overriding a name.  Report warnings when `new' is used without
17403         anything being there to override.
17404
17405         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17406
17407         * class.cs: Only add constructor to hashtable if it is non-null
17408         (as now constructors can fail on define).
17409
17410         (TypeManager, Class, Struct): Take location arguments.
17411
17412         Catch field instance initialization in structs as errors.
17413
17414         accepting_filter: a new filter for FindMembers that is static so
17415         that we dont create an instance per invocation.
17416
17417         (Constructor::Define): Catch errors where a struct constructor is
17418         parameterless 
17419
17420         * cs-parser.jay: Pass location information for various new
17421         constructs. 
17422
17423         * delegate.cs (Delegate): take a location argument.
17424
17425         * driver.cs: Do not call EmitCode if there were problesm in the
17426         Definition of the types, as many Builders wont be there. 
17427
17428         * decl.cs (Decl::Decl): Require a location argument.
17429
17430         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17431         into integers, and find the most appropiate integer for it.
17432
17433         * literal.cs: Implement ULongLiteral.
17434
17435         * rootcontext.cs: Provide better information about the location of
17436         failure when CreateType fails.
17437
17438 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17439
17440         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17441         as well.
17442
17443         * expression.cs (Binary::CheckShiftArguments): Add missing type
17444         computation.
17445         (Binary::ResolveOperator): Add type to the logical and and logical
17446         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17447         before.
17448
17449         (Binary::DoNumericPromotions): In the case where either argument
17450         is ulong (and most signed types combined with ulong cause an
17451         error) perform implicit integer constant conversions as well.
17452
17453 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17454
17455         * expression.cs (UserImplicitCast): Method should always be
17456         non-null. 
17457         (Invocation::BetterConversion): Simplified test for IntLiteral.
17458
17459         (Expression::ImplicitNumericConversion): Split this routine out.
17460         Put the code that performs implicit constant integer conversions
17461         here. 
17462
17463         (Expression::Resolve): Become a wrapper around DoResolve so we can
17464         check eclass and type being set after resolve.
17465
17466         (Invocation::Badness): Remove this dead function
17467
17468         (Binary::ResolveOperator): Do not compute the expensive argumnets
17469         unless we have a union for it.
17470
17471         (Probe::Emit): Is needs to do an isinst and then
17472         compare against null.
17473
17474         (::CanConvert): Added Location argument.  If the Location argument
17475         is null (Location.Null), then we do not report errors.  This is
17476         used by the `probe' mechanism of the Explicit conversion.  We do
17477         not want to generate an error for something that the user
17478         explicitly requested to be casted.  But the pipeline for an
17479         explicit cast first tests for potential implicit casts.
17480
17481         So for now, if the Location is null, it means `Probe only' to
17482         avoid adding another argument.   Might have to revise this
17483         strategy later.
17484
17485         (ClassCast): New class used to type cast objects into arbitrary
17486         classes (used in Explicit Reference Conversions).
17487
17488         Implement `as' as well.
17489
17490         Reverted all the patches from Ravi below: they were broken:
17491
17492                 * The use of `level' as a mechanism to stop recursive
17493                   invocations is wrong.  That was there just to catch the
17494                   bug with a strack trace but not as a way of addressing
17495                   the problem.
17496
17497                   To fix the problem we have to *understand* what is going
17498                   on and the interactions and come up with a plan, not
17499                   just get things going.
17500
17501                 * The use of the type conversion cache that I proposed
17502                   last night had an open topic: How does this work across
17503                   protection domains.  A user defined conversion might not
17504                   be public in the location where we are applying the
17505                   conversion, a different conversion might be selected
17506                   (ie, private A->B (better) but public B->A (worse),
17507                   inside A, A->B applies, but outside it, B->A will
17508                   apply).
17509
17510                 * On top of that (ie, even if the above is solved),
17511                   conversions in a cache need to be abstract.  Ie, `To
17512                   convert from an Int to a Short use an OpcodeCast', not
17513                   `To convert from an Int to a Short use the OpcodeCast on
17514                   the variable 5' (which is what this patch was doing).
17515
17516 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17517
17518         * expression.cs (Invocation::ConversionExists): Re-write to use
17519         the conversion cache
17520
17521         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17522         cache all conversions done, not just user-defined ones.
17523
17524         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17525         to determine if a conversion exists instead of acutually trying to 
17526         perform the conversion. It's faster too.
17527
17528         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17529         and only then attempt the implicit conversion.
17530
17531 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17532
17533         * expression.cs (ConvertImplicit): Use a cache for conversions
17534         already found. Check level of recursion and bail out if necessary.
17535
17536 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17537
17538         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17539         Export standard methods that we expect for string operations.
17540
17541         * statement.cs (Block::UsageWarning): Track usage of variables and
17542         report the errors for not used variables.
17543
17544         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17545         operator. 
17546
17547 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17548
17549         * codegen.cs: remove unnneded code 
17550
17551         * expression.cs: Removed BuiltinTypeAccess class
17552
17553         Fix the order in which implicit conversions are
17554         done.  
17555
17556         The previous fixed dropped support for boxed conversions (adding a
17557         test to the test suite now)
17558
17559         (UserImplicitCast::CanConvert): Remove test for source being null,
17560         that code is broken.  We should not feed a null to begin with, if
17561         we do, then we should track the bug where the problem originates
17562         and not try to cover it up here.
17563
17564         Return a resolved expression of type UserImplicitCast on success
17565         rather than true/false.  Ravi: this is what I was talking about,
17566         the pattern is to use a static method as a "constructor" for
17567         objects. 
17568
17569         Also, do not create arguments until the very last minute,
17570         otherwise we always create the arguments even for lookups that
17571         will never be performed. 
17572
17573         (UserImplicitCast::Resolve): Eliminate, objects of type
17574         UserImplicitCast are born in a fully resolved state. 
17575
17576         * typemanager.cs (InitCoreTypes): Init also value_type
17577         (System.ValueType). 
17578
17579         * expression.cs (Cast::Resolve): First resolve the child expression.
17580
17581         (LValue): Add new method AddressOf to be used by
17582         the `&' operator.  
17583
17584         Change the argument of Store to take an EmitContext instead of an
17585         ILGenerator, because things like FieldExpr need to be able to call
17586         their children expression to generate the instance code. 
17587
17588         (Expression::Error, Expression::Warning): Sugar functions for
17589         reporting errors.
17590
17591         (Expression::MemberLookup): Accept a TypeContainer instead of a
17592         Report as the first argument.
17593
17594         (Expression::ResolvePrimary): Killed.  I still want to improve
17595         this as currently the code is just not right.
17596
17597         (Expression::ResolveMemberAccess): Simplify, but it is still
17598         wrong. 
17599
17600         (Unary::Resolve): Catch errors in AddressOf operators.
17601
17602         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
17603         index to a byte for the short-version, or the compiler will choose
17604         the wrong Emit call, which generates the wrong data.
17605
17606         (ParameterReference::Emit, ::Store): same.
17607
17608         (FieldExpr::AddressOf): Implement.
17609
17610         * typemanager.cs: TypeManager: made public variable instead of
17611         property.
17612
17613         * driver.cs: document --fatal.
17614
17615         * report.cs (ErrorMessage, WarningMessage): new names for the old
17616         Error and Warning classes.
17617
17618         * cs-parser.jay (member_access): Turn built-in access to types
17619         into a normal simplename
17620
17621 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17622
17623         * expression.cs (Invocation::BetterConversion): Fix to cope
17624         with q being null, since this was introducing a bug.
17625
17626         * expression.cs (ConvertImplicit): Do built-in conversions first.
17627
17628 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17629
17630         * expression.cs (UserImplicitCast::Resolve): Fix bug.
17631
17632 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17633
17634         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
17635         I had introduced long ago (what's new ?).
17636
17637         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
17638         the work of all the checking. 
17639         (ConvertImplicit): Call CanConvert and only then create object if necessary.
17640         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
17641
17642         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
17643         that is the right way. 
17644
17645         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
17646         overloading resolution. Use everywhere instead of cutting and pasting code.
17647
17648         (Binary::ResolveOperator): Use MakeUnionSet.
17649
17650         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
17651         we have to convert to bool types. Not complete yet.
17652
17653 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17654
17655         * typemanager.cs (TypeManager::CSharpName): support ushort.
17656
17657         * expression.cs (Expression::TryImplicitIntConversion): Attempts
17658         to provide an expression that performsn an implicit constant int
17659         conversion (section 6.1.6).
17660         (Expression::ConvertImplicitRequired): Reworked to include
17661         implicit constant expression conversions.
17662
17663         (Expression::ConvertNumericExplicit): Finished.
17664
17665         (Invocation::Emit): If InstanceExpression is null, then it means
17666         that we perform a call on this.
17667
17668 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
17669
17670         * expression.cs (Unary::Emit): Remove some dead code.
17671         (Probe): Implement Resolve and Emit for `is'.
17672         (Expression::ConvertImplicitRequired): Attempt to do constant
17673         expression conversions here.  Maybe should be moved to
17674         ConvertImplicit, but I am not sure.
17675         (Expression::ImplicitLongConstantConversionPossible,
17676         Expression::ImplicitIntConstantConversionPossible): New functions
17677         that tell whether is it possible to apply an implicit constant
17678         expression conversion.
17679
17680         (ConvertNumericExplicit): Started work on explicit numeric
17681         conversions.
17682
17683         * cs-parser.jay: Update operator constants.
17684
17685         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
17686         (Parameters::GetSignature): Hook up VerifyArgs here.
17687         (Parameters::VerifyArgs): Verifies that no two arguments have the
17688         same name. 
17689
17690         * class.cs (Operator): Update the operator names to reflect the
17691         ones that the spec expects (as we are just stringizing the
17692         operator names).
17693
17694         * expression.cs (Unary::ResolveOperator): Fix bug: Use
17695         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
17696         previous usage did only work for our methods.
17697         (Expression::ConvertImplicit): Handle decimal implicit numeric
17698         conversions as well.
17699         (Expression::InternalTypeConstructor): Used to invoke constructors
17700         on internal types for default promotions.
17701
17702         (Unary::Emit): Implement special handling for the pre/post
17703         increment/decrement for overloaded operators, as they need to have
17704         the same semantics as the other operators.
17705
17706         (Binary::ResolveOperator): ditto.
17707         (Invocation::ConversionExists): ditto.
17708         (UserImplicitCast::Resolve): ditto.
17709
17710 2001-09-26  Ravi Pratap  <ravi@ximian.com>
17711
17712         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
17713         operator, return after emitting body. Regression tests pass again !
17714
17715         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
17716         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
17717         (Invocation::OverloadResolve): Ditto.
17718         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
17719
17720         * everywhere : update calls to the above methods accordingly.
17721
17722 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
17723
17724         * assign.cs (Assign): Make it inherit from ExpressionStatement.
17725
17726         * expression.cs (ExpressionStatement): New base class used for
17727         expressions that can appear in statements, so that we can provide
17728         an alternate path to generate expression that do not leave a value
17729         on the stack.
17730
17731         (Expression::Emit, and all the derivatives): We no longer return
17732         whether a value is left on the stack or not.  Every expression
17733         after being emitted leaves a single value on the stack.
17734
17735         * codegen.cs (EmitContext::EmitStatementExpression): Use the
17736         facilties of ExpressionStatement if possible.
17737
17738         * cs-parser.jay: Update statement_expression.
17739
17740 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
17741
17742         * driver.cs: Change the wording of message
17743
17744 2001-09-25  Ravi Pratap  <ravi@ximian.com>
17745
17746         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
17747         the type of the expression to the return type of the method if
17748         we have an overloaded operator match ! The regression tests pass again !
17749         (Unary::ResolveOperator): Ditto.
17750
17751         * expression.cs (Invocation::ConversionExists): Correct the member lookup
17752         to find "op_Implicit", not "implicit" ;-)
17753         (UserImplicitCast): New class to take care of user-defined implicit conversions.
17754         (ConvertImplicit, ForceConversion): Take TypeContainer argument
17755
17756         * everywhere : Correct calls to the above accordingly.
17757
17758         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
17759         (ConvertImplicit): Do user-defined conversion if it exists.
17760
17761 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * assign.cs: track location.
17764         (Resolve): Use implicit conversions on assignment.
17765
17766         * literal.cs: Oops.  Not good, Emit of short access values should
17767         pass (Bytes) or the wrong argument will be selected.
17768
17769         * expression.cs (Unary::Emit): Emit code for -expr.
17770
17771         (Unary::ResolveOperator): Handle `Substract' for non-constants
17772         (substract from zero from the non-constants).
17773         Deal with Doubles as well. 
17774
17775         (Expression::ConvertImplicitRequired): New routine that reports an
17776         error if no implicit conversion exists. 
17777
17778         (Invocation::OverloadResolve): Store the converted implicit
17779         expressions if we make them
17780
17781 2001-09-24  Ravi Pratap  <ravi@ximian.com>
17782
17783         * class.cs (ConstructorInitializer): Take a Location argument.
17784         (ConstructorBaseInitializer): Same here.
17785         (ConstructorThisInitializer): Same here.
17786
17787         * cs-parser.jay : Update all calls accordingly.
17788
17789         * expression.cs (Unary, Binary, New): Take location argument.
17790         Update accordingly everywhere.
17791
17792         * cs-parser.jay : Update all calls to the above to take a location
17793         argument.
17794
17795         * class.cs : Ditto.
17796
17797 2001-09-24  Ravi Pratap  <ravi@ximian.com>
17798
17799         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
17800         (Invocation::BetterConversion): Same here
17801         (Invocation::ConversionExists): Ditto.
17802
17803         (Invocation::ConversionExists): Implement.
17804
17805 2001-09-22  Ravi Pratap  <ravi@ximian.com>
17806
17807         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
17808         Also take an additional TypeContainer argument.
17809
17810         * All over : Pass in TypeContainer as argument to OverloadResolve.
17811
17812         * typemanager.cs (CSharpName): Update to check for the string type and return
17813         that too.
17814
17815         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
17816         a given method.
17817
17818 2001-09-21  Ravi Pratap  <ravi@ximian.com>
17819
17820         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
17821         (Invocation::BetterFunction): Implement.
17822         (Invocation::BetterConversion): Implement.
17823         (Invocation::ConversionExists): Skeleton, no implementation yet.
17824
17825         Okay, things work fine !
17826
17827 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
17828
17829         * typemanager.cs: declare and load enum_type, delegate_type and
17830         void_type. 
17831
17832         * expression.cs (Expression::Emit): Now emit returns a value that
17833         tells whether a value is left on the stack or not.  This strategy
17834         might be reveted tomorrow with a mechanism that would address
17835         multiple assignments.
17836         (Expression::report118): Utility routine to report mismatches on
17837         the ExprClass.
17838
17839         (Unary::Report23): Report impossible type/operator combination
17840         utility function.
17841
17842         (Unary::IsIncrementableNumber): Whether the type can be
17843         incremented or decremented with add.
17844         (Unary::ResolveOperator): Also allow enumerations to be bitwise
17845         complemented. 
17846         (Unary::ResolveOperator): Implement ++, !, ~,
17847
17848         (Invocation::Emit): Deal with new Emit convetion.
17849
17850         * All Expression derivatives: Updated their Emit method to return
17851         whether they leave values on the stack or not.
17852
17853         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
17854         stack for expressions that are statements. 
17855
17856 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
17857
17858         * expression.cs (LValue): New interface.  Must be implemented by
17859         LValue objects.
17860         (LocalVariableReference, ParameterReference, FieldExpr): Implement
17861         LValue interface.
17862
17863         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
17864         interface for generating code, simplifies the code.
17865
17866 2001-09-20  Ravi Pratap  <ravi@ximian.com>
17867
17868         * expression.cs (everywhere): Comment out return statements in ::Resolve
17869         methods to avoid the warnings.
17870
17871 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
17872
17873         * driver.cs (parse): Report error 2001 if we can not open the
17874         source file.
17875
17876         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
17877         not resolve it.
17878
17879         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
17880         object. 
17881
17882         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
17883         otherwise nested blocks end up with the same index.
17884
17885         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
17886
17887         * expression.cs:  Instead of having FIXMEs in the Resolve
17888         functions, throw exceptions so it is obvious that we are facing a
17889         bug. 
17890
17891         * cs-parser.jay (invocation_expression): Pass Location information.
17892
17893         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
17894         Use a basename for those routines because .NET does not like paths
17895         on them. 
17896
17897         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
17898         already defined.
17899
17900 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
17901
17902         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
17903         are loading the correct data types (throws an exception if not).
17904         (TypeManager::InitCoreTypes): Use CoreLookupType
17905
17906         * expression.cs (Unary::ResolveOperator): return the child
17907         expression for expressions which are just +expr.
17908         (Unary::ResolveOperator): Return negative literals for -LITERAL
17909         expressions (otherwise they are Unary {Literal}).
17910         (Invocation::Badness): Take into account `Implicit constant
17911         expression conversions'.
17912
17913         * literal.cs (LongLiteral): Implement long literal class.
17914         (IntLiteral): export the `Value' of the intliteral. 
17915
17916 2001-09-19  Ravi Pratap  <ravi@ximian.com>
17917
17918         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
17919
17920         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
17921         instead of 'Operator'
17922
17923         * expression.cs (Binary::ResolveOperator): Update accordingly.
17924         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
17925         and 'Minus'
17926
17927         * cs-parser.jay (unary_expression): Update to use the new names.
17928
17929         * gen-treedump.cs (GetUnary): Same here.
17930
17931         * expression.cs (Unary::Resolve): Implement.
17932         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
17933         operators are found instead of making noise ;-)
17934         (Unary::ResolveOperator): New method to do precisely the same thing which
17935         Binary::ResolveOperator does for Binary expressions.
17936         (Unary.method, .Arguments): Add.
17937         (Unary::OperName): Implement.   
17938         (Unary::ForceConversion): Copy and Paste !
17939
17940         * class.cs (Operator::Define): Fix a small bug for the case when we have 
17941         a unary operator.
17942
17943         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
17944         for the inbuilt operators. Only overloading works for now ;-)
17945
17946 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
17949         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
17950
17951         * expression.cs (This::Emit): Implement. 
17952         (This::Resolve): Implement.
17953         (TypeOf:Resolve): Implement.
17954         (Expression::ResolveSimpleName): Add an implicit this to instance
17955         field references. 
17956         (MemberAccess::Resolve): Deal with Parameters and Fields. 
17957         Bind instance variable to Field expressions.
17958         (FieldExpr::Instance): New field used to track the expression that
17959         represents the object instance.
17960         (FieldExpr::Resolve): Track potential errors from MemberLookup not
17961         binding 
17962         (FieldExpr::Emit): Implement.
17963
17964         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
17965         the last instruction contains a return opcode to avoid generating
17966         the last `ret' instruction (this generates correct code, and it is
17967         nice to pass the peverify output).
17968
17969         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
17970         initializer for static and instance variables.
17971         (Constructor::Emit): Allow initializer to be null in the case of
17972         static constructors.  Only emit initializer for instance
17973         constructors. 
17974
17975         (TypeContainer::FindMembers): Return a null array if there are no
17976         matches.
17977
17978         Also fix the code for the MemberTypes.Method branch, as it was not
17979         scanning that for operators (or tried to access null variables before).
17980
17981         * assign.cs (Assign::Emit): Handle instance and static fields. 
17982
17983         * TODO: Updated.
17984
17985         * driver.cs: Stop compilation if there are parse errors.
17986
17987         * cs-parser.jay (constructor_declaration): Provide default base
17988         initializer for non-static constructors.
17989         (constructor_declarator): Do not provide a default base
17990         initializers if none was specified.
17991         Catch the fact that constructors should not have parameters.
17992
17993         * class.cs: Do not emit parent class initializers for static
17994         constructors, that should be flagged as an error.
17995
17996 2001-09-18  Ravi Pratap  <ravi@ximian.com>
17997
17998         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
17999         Move back code into TypeContainer::Populate.
18000
18001 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18002
18003         * class.cs (TypeContainer::AddConstructor): Fix the check to
18004         compare against Name, not Basename. 
18005         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18006
18007         * cs-parser.jay : Update accordingly.
18008
18009         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18010         for methods, don't forget to look into the operators too.
18011         (RegisterMethodBuilder): Helper method to take care of this for
18012         methods, constructors and operators.
18013         (Operator::Define): Completely revamp.
18014         (Operator.OperatorMethod, MethodName): New fields.
18015         (TypeContainer::Populate): Move the registering of builders into
18016         RegisterMethodBuilder.
18017         (Operator::Emit): Re-write.
18018
18019         * expression.cs (Binary::Emit): Comment out code path to emit method
18020         invocation stuff for the case when we have a user defined operator. I am
18021         just not able to get it right !
18022
18023 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18024
18025         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18026         argument. 
18027
18028         (Expression::MemberLookup): Provide a version that allows to
18029         specify the MemberTypes and BindingFlags. 
18030
18031         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18032         so it was not fetching variable information from outer blocks.
18033
18034         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18035         Beforefieldinit as it was buggy.
18036
18037         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18038         that Ravi put here.  
18039
18040         * class.cs (Constructor::Emit): Only emit if block is not null.
18041         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18042         deal with this by semantically definining it as if the user had
18043         done it.
18044
18045         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18046         constructors as we now "emit" them at a higher level.
18047
18048         (TypeContainer::DefineDefaultConstructor): Used to define the
18049         default constructors if none was provided.
18050
18051         (ConstructorInitializer): Add methods Resolve and Emit. 
18052
18053         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18054
18055 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18056
18057         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18058         the default constructor builder with our hashtable for methodbuilders
18059         to methodcores.
18060
18061         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18062         and argument_count is 0 in which case we have a match.
18063         (Binary::ResolveOperator): More null checking and miscellaneous coding
18064         style cleanup.
18065
18066 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18067
18068         * rootcontext.cs (IsNameSpace): Compare against null.
18069
18070         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18071
18072         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18073         and Unary::Operator.
18074
18075         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18076         accordingly.
18077
18078         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18079         we have overloaded operators.
18080         (Binary::ResolveOperator): Implement the part which does the operator overload
18081         resolution.
18082
18083         * class.cs (Operator::Emit): Implement.
18084         (TypeContainer::Emit): Emit the operators we have too.
18085
18086         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18087         the case when we have a user-defined operator.
18088
18089 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18090
18091         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18092
18093 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18094
18095         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18096         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18097         (Constructor::Emit): Implement.
18098         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18099         if we have no work to do. 
18100         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18101         Emit method.
18102
18103         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18104         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18105
18106         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18107         of parent.parent.
18108
18109 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18110
18111         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18112         in the source.
18113         (Tree::RecordNamespace): Method to do what the name says ;-)
18114         (Tree::Namespaces): Property to get at the namespaces hashtable.
18115
18116         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18117         keep track.
18118
18119         * rootcontext.cs (IsNamespace): Fixed it :-)
18120
18121 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18122
18123         * class.cs (TypeContainer::FindMembers): Add support for
18124         constructors. 
18125         (MethodCore): New class that encapsulates both the shared aspects
18126         of a Constructor and a Method.  
18127         (Method, Constructor): Factored pieces into MethodCore.
18128
18129         * driver.cs: Added --fatal which makes errors throw exceptions.
18130         Load System assembly as well as part of the standard library.
18131
18132         * report.cs: Allow throwing exceptions on errors for debugging.
18133
18134         * modifiers.cs: Do not use `parent', instead use the real type
18135         container to evaluate permission settings.
18136
18137         * class.cs: Put Ravi's patch back in.  He is right, and we will
18138         have to cope with the
18139
18140 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18141
18142         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18143         FamORAssem, not FamANDAssem.
18144
18145 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18146
18147         * driver.cs: Added --parse option that only parses its input files
18148         and terminates.
18149
18150         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18151         incorrect.  IsTopLevel is not used to tell whether an object is
18152         root_types or not (that can be achieved by testing this ==
18153         root_types).  But to see if this is a top-level *class* (not
18154         necessarly our "toplevel" container). 
18155
18156 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18157
18158         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18159         parent instead of a direct call to GetType.
18160
18161 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18162
18163         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18164         Modifiers.TypeAttr. This should just be a call to that method.
18165
18166         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18167         object so that we can determine if we are top-level or not.
18168
18169         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18170         TypeContainer too.
18171
18172         * enum.cs (Enum::Define): Ditto.
18173
18174         * modifiers.cs (FieldAttr): Re-write.
18175
18176         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18177         (TypeContainer::HaveStaticConstructor): New property to provide access
18178         to precisely that info.
18179
18180         * modifiers.cs (MethodAttr): Re-write.
18181         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18182
18183         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18184         of top-level types as claimed.
18185
18186 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * expression.cs (MemberLookup): Fruitless attempt to lookup
18189         constructors.  Maybe I need to emit default constructors?  That
18190         might be it (currently .NET emits this for me automatically).
18191         (Invocation::OverloadResolve): Cope with Arguments == null.
18192         (Invocation::EmitArguments): new function, shared by the new
18193         constructor and us.
18194         (Invocation::Emit): Handle static and instance methods.  Emit
18195         proper call instruction for virtual or non-virtual invocations.
18196         (New::Emit): Implement.
18197         (New::Resolve): Implement.
18198         (MemberAccess:Resolve): Implement.
18199         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18200         to track instances.
18201         (FieldExpr::Resolve): Set type.
18202
18203         * support.cs: Handle empty arguments.
18204                 
18205         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18206         SimpleLookup): Auxiliary routines to help parse a qualifier
18207         identifier.  
18208
18209         Update qualifier_identifier rule.
18210
18211         * codegen.cs: Removed debugging messages.
18212
18213         * class.cs: Make this a global thing, this acts just as a "key" to
18214         objects that we might have around.
18215
18216         (Populate): Only initialize method_builders_to_methods once.
18217
18218         * expression.cs (PropertyExpr): Initialize type from the
18219         PropertyType. 
18220
18221         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18222         Resolve pattern.  Attempt to implicitly convert value to boolean.
18223         Emit code.
18224
18225         * expression.cs: Set the type for the int32/int32 argument case.
18226         (Binary::ResolveOperator): Set the return type to boolean for
18227         comparission operators
18228
18229         * typemanager.cs: Remove debugging print code.
18230
18231         (Invocation::Resolve): resolve type.
18232
18233         * class.cs: Allocate a MemberInfo of the correct size, as the code
18234         elsewhere depends on the test to reflect the correct contents.
18235
18236         (Method::) Keep track of parameters, due to System.Reflection holes
18237
18238         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18239         mapping here.
18240
18241         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18242         of the exact size and return that.
18243
18244         (Class::LookupMethodByBuilder): New function that maps
18245         MethodBuilders to its methods.  Required to locate the information
18246         on methods because System.Reflection bit us again.
18247
18248         * support.cs: New file, contains an interface ParameterData and
18249         two implementations: ReflectionParameters and InternalParameters
18250         used to access Parameter information.  We will need to grow this
18251         as required.
18252
18253         * expression.cs (Invocation::GetParameterData): implement a cache
18254         and a wrapper around the ParameterData creation for methods. 
18255         (Invocation::OverloadResolve): Use new code.
18256
18257 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18258
18259         * class.cs (TypeContainer::EmitField): Remove and move into 
18260         (Field::Define): here and modify accordingly.
18261         (Field.FieldBuilder): New member.
18262         (TypeContainer::Populate): Update accordingly.
18263         (TypeContainer::FindMembers): Implement.
18264
18265 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * statement.cs: (VariableInfo::VariableType): New field to be
18268         initialized with the full type once it is resolved. 
18269
18270 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18271
18272         * parameter.cs (GetParameterInfo): Use a type cache to compute
18273         things only once, and to reuse this information
18274
18275         * expression.cs (LocalVariableReference::Emit): Implement.
18276         (OpcodeCast::Emit): fix.
18277
18278         (ParameterReference::Resolve): Implement.
18279         (ParameterReference::Emit): Implement.
18280
18281         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18282         that are expressions need to stay as Expressions.
18283
18284         * typemanager.cs (CSharpName): Returns the C# name of a type if
18285         possible. 
18286
18287         * expression.cs (Expression::ConvertImplicit): New function that
18288         implements implicit type conversions.
18289
18290         (Expression::ImplicitReferenceConversion): Implements implicit
18291         reference conversions.
18292
18293         (EmptyCast): New type for transparent casts.
18294
18295         (OpcodeCast): New type for casts of types that are performed with
18296         a sequence of bytecodes.
18297
18298         (BoxedCast): New type used for casting value types into reference
18299         types.  Emits a box opcode.
18300
18301         (Binary::DoNumericPromotions): Implements numeric promotions of
18302         and computation of the Binary::Type.
18303
18304         (Binary::EmitBranchable): Optimization.
18305
18306         (Binary::Emit): Implement code emission for expressions.
18307
18308         * typemanager.cs (TypeManager): Added two new core types: sbyte
18309         and byte.
18310
18311 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18312
18313         * class.cs (TypeContainer::FindMembers): Method which does exactly
18314         what Type.FindMembers does, only we don't have to use reflection. No
18315         implementation yet.
18316
18317         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18318         typecontainer objects as we need to get at them.
18319         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18320
18321         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18322         typecontainer object.
18323
18324         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18325         of just a Report object.
18326
18327 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18328
18329         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18330         "remove_"
18331         (TypeContainer::Populate): Now define the delegates of the type too.
18332         (TypeContainer.Delegates): Property to access the list of delegates defined
18333         in the type.
18334
18335         * delegates.cs (Delegate::Define): Implement partially.
18336
18337         * modifiers.cs (TypeAttr): Handle more flags.
18338
18339 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18340
18341         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18342         and not <=
18343         (Operator::Define): Re-write logic to get types by using the LookupType method
18344         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18345         (Indexer::Define): Ditto.
18346         (Event::Define): Ditto.
18347         (Property::Define): Ditto.
18348
18349 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18350
18351         * class.cs (TypeContainer::Populate): Now define operators too. 
18352         (TypeContainer.Operators): New property to access the list of operators
18353         in a type.
18354         (Operator.OperatorMethodBuilder): New member to hold the method builder
18355         for the operator we are defining.
18356         (Operator::Define): Implement.
18357
18358 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18359
18360         * class.cs (Event::Define): Make the prefixes of the accessor methods
18361         addOn_ and removeOn_ 
18362
18363         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18364         of the location being passed in too. Ideally, this should go later since all
18365         error reporting should be done through the Report object.
18366
18367         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18368         (Populate): Iterate thru the indexers we have and define them too.
18369         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18370         for the get and set accessors.
18371         (Indexer::Define): Implement.
18372
18373 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18376         my previous implementation, did not work.
18377
18378         * typemanager.cs: Add a couple of missing types (the longs).
18379
18380         * literal.cs: Use TypeManager.bool_type instead of getting it.
18381
18382         * expression.cs (EventExpr): New kind of expressions.
18383         (Expressio::ExprClassFromMemberInfo): finish
18384
18385 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18386
18387         * assign.cs: Emit stores to static fields differently.
18388
18389 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18390
18391         * Merge in changes and adjust code to tackle conflicts. Backed out my
18392         code in Assign::Resolve ;-) 
18393
18394 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18395
18396         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18397         instead Report.Error and also pass in the location.
18398         (CSharpParser::Lexer): New readonly property to return the reference
18399         to the Tokenizer object.
18400         (declare_local_variables): Use Report.Error with location instead of plain 
18401         old error.
18402         (CheckDef): Ditto.
18403
18404         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18405         (Operator.CheckBinaryOperator): Ditto.
18406
18407         * cs-parser.jay (operator_declarator): Update accordingly.
18408
18409         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18410         (CheckBinaryOperator): Same here.
18411
18412         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18413         on the name without any prefixes of namespace names etc. This is because we
18414         already might have something already fully qualified like 
18415         'System.Console.WriteLine'
18416
18417         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18418
18419 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18420
18421         * cs-tokenizer.cs (location): Return a string which also contains
18422         the file name.
18423
18424         * expression.cs (ElementAccess): New class for expressions of the
18425         type 'element access.'
18426         (BaseAccess): New class for expressions of the type 'base access.'
18427         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18428         respectively.
18429
18430         * cs-parser.jay (element_access): Implement action.
18431         (base_access): Implement actions.
18432         (checked_expression, unchecked_expression): Implement.
18433
18434         * cs-parser.jay (local_variable_type): Correct and implement.
18435         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18436
18437         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18438
18439         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18440         name and the specifiers.
18441
18442         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18443
18444         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18445         making them all public ;-)
18446
18447         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18448         class anyways.
18449
18450 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18453         PropertyExprs.
18454         (FieldExpr, PropertyExprs): New resolved expressions.
18455         (SimpleName::MemberStaticCheck): Perform static checks for access
18456         to non-static fields on static methods. Maybe this should be
18457         generalized for MemberAccesses. 
18458         (SimpleName::ResolveSimpleName): More work on simple name
18459         resolution. 
18460
18461         * cs-parser.jay (primary_expression/qualified_identifier): track
18462         the parameter index.
18463
18464         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18465         (EmitContext::EmitBoolExpression): Chain to expression generation
18466         instead of temporary hack.
18467         (::EmitStatementExpression): Put generic expression code generation.
18468
18469         * assign.cs (Assign::Emit): Implement variable assignments to
18470         local variables, parameters and fields.
18471
18472 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * statement.cs (Block::GetVariableInfo): New method, returns the
18475         VariableInfo for a variable name in a block.
18476         (Block::GetVariableType): Implement in terms of GetVariableInfo
18477
18478         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18479         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18480
18481 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18482
18483         * cs-parser.jay (operator_declaration): Continue on my quest : update
18484         to take attributes argument.
18485         (event_declaration): Ditto.
18486         (enum_declaration): Ditto.
18487         (indexer_declaration): Ditto.
18488
18489         * class.cs (Operator::Operator): Update constructor accordingly.
18490         (Event::Event): Ditto.
18491
18492         * delegate.cs (Delegate::Delegate): Same here.
18493
18494         * enum.cs (Enum::Enum): Same here.
18495
18496 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18497
18498         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18499
18500         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18501
18502         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18503         being passed around as an arraylist.
18504         (Attributes::AddAttribute): Method to add attribute sections.
18505
18506         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18507         (struct_declaration): Update accordingly.
18508         (constant_declaration): Update.
18509         (field_declaration): Update.
18510         (method_header): Update.
18511         (fixed_parameter): Update.
18512         (parameter_array): Ditto.
18513         (property_declaration): Ditto.
18514         (destructor_declaration): Ditto.
18515
18516         * class.cs (Struct::Struct): Update constructors accordingly.
18517         (Class::Class): Ditto.
18518         (Field::Field): Ditto.
18519         (Method::Method): Ditto.
18520         (Property::Property): Ditto.
18521         (TypeContainer::OptAttribute): update property's return type.
18522
18523         * interface.cs (Interface.opt_attributes): New member.
18524         (Interface::Interface): Update to take the extra Attributes argument.
18525
18526         * parameter.cs (Parameter::Parameter): Ditto.
18527
18528         * constant.cs (Constant::Constant): Ditto.
18529
18530         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18531         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18532         the attributes as a parameter.
18533         (InterfaceProperty): Update constructor call.
18534         (InterfaceEvent): Ditto.
18535         (InterfaceMethod): Ditto.
18536         (InterfaceIndexer): Ditto.
18537
18538         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18539         pass the attributes too.
18540         (interface_event_declaration): Ditto.
18541         (interface_property_declaration): Ditto.
18542         (interface_method_declaration): Ditto.
18543         (interface_declaration): Ditto.
18544
18545 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * class.cs (Method::Define): Track the "static Main" definition to
18548         create an entry point. 
18549
18550         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18551         EntryPoint if we find it. 
18552
18553         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18554         (EmitContext::ig): Make this variable public.
18555
18556         * driver.cs: Make the default output file be the first file name
18557         with the .exe extension.  
18558
18559         Detect empty compilations
18560
18561         Handle various kinds of output targets.  Handle --target and
18562         rename -t to --dumper.
18563
18564         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18565         methods inherited from Expression return now an Expression.  This
18566         will is used during the tree rewriting as we resolve them during
18567         semantic analysis.
18568
18569         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18570         the spec.  Missing entirely is the information about
18571         accessability of elements of it.
18572
18573         (Expression::ExprClassFromMemberInfo): New constructor for
18574         Expressions that creates a fully initialized Expression based on
18575         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18576         a Type.
18577
18578         (Invocation::Resolve): Begin implementing resolution of invocations.
18579
18580         * literal.cs (StringLiteral):  Implement Emit.
18581
18582 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18583
18584         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18585         member.
18586
18587 2001-09-04  Ravi Pratap  <ravi@ximian.com>
18588
18589         * cs-parser.jay (attribute_arguments): Implement actions.
18590         (attribute): Fix bug in production. Implement action.
18591         (attribute_list): Implement.
18592         (attribute_target): Implement.
18593         (attribute_target_specifier, opt_target_specifier): Implement
18594         (CheckAttributeTarget): New method to check if the attribute target
18595         is valid.
18596         (attribute_section): Implement.
18597         (opt_attributes): Implement.
18598
18599         * attribute.cs : New file to handle attributes.
18600         (Attribute): Class to hold attribute info.
18601
18602         * cs-parser.jay (opt_attribute_target_specifier): Remove production
18603         (attribute_section): Modify production to use 2 different rules to 
18604         achieve the same thing. 1 s/r conflict down !
18605         Clean out commented, useless, non-reducing dimension_separator rules.
18606
18607         * class.cs (TypeContainer.attributes): New member to hold list
18608         of attributes for a type.
18609         (Struct::Struct): Modify to take one more argument, the attribute list.
18610         (Class::Class): Ditto.
18611         (Field::Field): Ditto.
18612         (Method::Method): Ditto.
18613         (Property::Property): Ditto.
18614
18615         * cs-parser.jay (struct_declaration): Update constructor call to
18616         pass in the attributes too.
18617         (class_declaration): Ditto.
18618         (constant_declaration): Ditto.
18619         (field_declaration): Ditto.
18620         (method_header): Ditto.
18621         (fixed_parameter): Ditto.
18622         (parameter_array): Ditto.
18623         (property_declaration): Ditto.
18624
18625         * constant.cs (Constant::Constant): Update constructor similarly.
18626         Use System.Collections.
18627
18628         * parameter.cs (Parameter::Parameter): Update as above.
18629
18630 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18631
18632         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
18633         (TypeContainer.delegates): New member to hold list of delegates.
18634
18635         * cs-parser.jay (delegate_declaration): Implement the action correctly 
18636         this time as I seem to be on crack ;-)
18637
18638 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
18639
18640         * rootcontext.cs (RootContext::IsNamespace): new function, used to
18641         tell whether an identifier represents a namespace.
18642
18643         * expression.cs (NamespaceExpr): A namespace expression, used only
18644         temporarly during expression resolution.
18645         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
18646         utility functions to resolve names on expressions.
18647
18648 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * codegen.cs: Add hook for StatementExpressions. 
18651
18652         * class.cs: Fix inverted test for static flag in methods.
18653
18654 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18655
18656         * class.cs (Operator::CheckUnaryOperator): Correct error number used
18657         to make it coincide with MS' number.
18658         (Operator::CheckBinaryOperator): Ditto.
18659
18660         * ../errors/errors.txt : Remove error numbers added earlier.
18661
18662         * ../errors/cs1019.cs : Test case for error # 1019
18663
18664         * ../errros/cs1020.cs : Test case for error # 1020
18665
18666         * cs-parser.jay : Clean out commented cruft.
18667         (dimension_separators, dimension_separator): Comment out. Ostensibly not
18668         used anywhere - non-reducing rule.
18669         (namespace_declarations): Non-reducing rule - comment out.
18670
18671         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
18672         with TypeContainer::AddEnum.
18673
18674         * delegate.cs : New file for delegate handling classes.
18675         (Delegate): Class for declaring delegates.
18676
18677         * makefile : Update.
18678
18679         * cs-parser.jay (delegate_declaration): Implement.
18680
18681 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
18682
18683         * class.cs (Event::Define): Implement.
18684         (Event.EventBuilder): New member.
18685
18686         * class.cs (TypeContainer::Populate): Update to define all enums and events
18687         we have.
18688         (Events): New property for the events arraylist we hold. Shouldn't we move to using
18689         readonly fields for all these cases ?
18690
18691 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
18692
18693         * class.cs (Property): Revamp to use the convention of making fields readonly.
18694         Accordingly modify code elsewhere.
18695
18696         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
18697         the Define method of the Property class.
18698
18699         * class.cs : Clean up applied patch and update references to variables etc. Fix 
18700         trivial bug.
18701         (TypeContainer::Populate): Update to define all the properties we have. Also
18702         define all enumerations.
18703
18704         * enum.cs (Define): Implement.
18705
18706 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
18707
18708         * cs-parser.jay (overloadable_operator): The semantic value is an
18709         enum of the Operator class.
18710         (operator_declarator): Implement actions.
18711         (operator_declaration): Implement.
18712
18713         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
18714         validity of definitions.
18715         (Operator::CheckBinaryOperator): Static method to check for binary operators
18716         (TypeContainer::AddOperator): New method to add an operator to a type.
18717
18718         * cs-parser.jay (indexer_declaration): Added line to actually call the
18719         AddIndexer method so it gets added ;-)
18720
18721         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
18722         already taken care of by the MS compiler ?  
18723
18724 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
18725
18726         * class.cs (Operator): New class for operator declarations.
18727         (Operator::OpType): Enum for the various operators.
18728
18729 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
18730
18731         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
18732         ostensibly handle this in semantic analysis.
18733
18734         * cs-parser.jay (general_catch_clause): Comment out
18735         (specific_catch_clauses, specific_catch_clause): Ditto.
18736         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
18737         (catch_args, opt_catch_args): New productions.
18738         (catch_clause): Rewrite to use the new productions above
18739         (catch_clauses): Modify accordingly.
18740         (opt_catch_clauses): New production to use in try_statement
18741         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
18742         and re-write the code in the actions to extract the specific and
18743         general catch clauses by being a little smart ;-)
18744
18745         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
18746         Hooray, try and catch statements parse fine !
18747
18748 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18749
18750         * statement.cs (Block::GetVariableType): Fix logic to extract the type
18751         string from the hashtable of variables.
18752
18753         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
18754         I end up making that mistake ;-)
18755         (catch_clauses): Fixed gross error which made Key and Value of the 
18756         DictionaryEntry the same : $1 !!
18757
18758 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18759
18760         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
18761
18762         * cs-parser.jay (event_declaration): Correct to remove the semicolon
18763         when the add and remove accessors are specified. 
18764
18765 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18766
18767         * cs-parser.jay (IndexerDeclaration): New helper class to hold
18768         information about indexer_declarator.
18769         (indexer_declarator): Implement actions.
18770         (parsing_indexer): New local boolean used to keep track of whether
18771         we are parsing indexers or properties. This is necessary because 
18772         implicit_parameters come into picture even for the get accessor in the 
18773         case of an indexer.
18774         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
18775
18776         * class.cs (Indexer): New class for indexer declarations.
18777         (TypeContainer::AddIndexer): New method to add an indexer to a type.
18778         (TypeContainer::indexers): New member to hold list of indexers for the
18779         type.
18780
18781 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
18782
18783         * cs-parser.jay (add_accessor_declaration): Implement action.
18784         (remove_accessor_declaration): Implement action.
18785         (event_accessors_declaration): Implement
18786         (variable_declarators): swap statements for first rule - trivial.
18787
18788         * class.cs (Event): New class to hold information about event
18789         declarations.
18790         (TypeContainer::AddEvent): New method to add an event to a type
18791         (TypeContainer::events): New member to hold list of events.
18792
18793         * cs-parser.jay (event_declaration): Implement actions.
18794
18795 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
18796
18797         * cs-parser.jay (dim_separators): Implement. Make it a string
18798         concatenating all the commas together, just as they appear.
18799         (opt_dim_separators): Modify accordingly
18800         (rank_specifiers): Update accordingly. Basically do the same
18801         thing - instead, collect the brackets here.
18802         (opt_rank_sepcifiers): Modify accordingly.
18803         (array_type): Modify to actually return the complete type string
18804         instead of ignoring the rank_specifiers.
18805         (expression_list): Implement to collect the expressions
18806         (variable_initializer): Implement. We make it a list of expressions
18807         essentially so that we can handle the array_initializer case neatly too.
18808         (variable_initializer_list): Implement.
18809         (array_initializer): Make it a list of variable_initializers
18810         (opt_array_initializer): Modify accordingly.
18811
18812         * expression.cs (New::NType): Add enumeration to help us
18813         keep track of whether we have an object/delegate creation
18814         or an array creation.
18815         (New:NewType, New::Rank, New::Indices, New::Initializers): New
18816         members to hold data about array creation.
18817         (New:New): Modify to update NewType
18818         (New:New): New Overloaded contructor for the array creation
18819         case.
18820
18821         * cs-parser.jay (array_creation_expression): Implement to call
18822         the overloaded New constructor.
18823
18824 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
18825
18826         * class.cs (TypeContainer::Constructors): Return member
18827         constructors instead of returning null.
18828
18829 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
18830
18831         * typemanager.cs (InitCoreTypes): Initialize the various core
18832         types after we have populated the type manager with the user
18833         defined types (this distinction will be important later while
18834         compiling corlib.dll)
18835
18836         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
18837         on Expression Classification.  Now all expressions have a method
18838         `Resolve' and a method `Emit'.
18839
18840         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
18841         generation from working.     Also add some temporary debugging
18842         code. 
18843
18844 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
18845
18846         * codegen.cs: Lots of code generation pieces.  This is only the
18847         beginning, will continue tomorrow with more touches of polish.  We
18848         handle the fundamentals of if, while, do, for, return.  Others are
18849         trickier and I need to start working on invocations soon.
18850
18851         * gen-treedump.cs: Bug fix, use s.Increment here instead of
18852         s.InitStatement. 
18853
18854         * codegen.cs (EmitContext): New struct, used during code
18855         emission to keep a context.   Most of the code generation will be
18856         here. 
18857
18858         * cs-parser.jay: Add embedded blocks to the list of statements of
18859         this block.  So code generation proceeds in a top down fashion.
18860
18861 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
18862
18863         * statement.cs: Add support for multiple child blocks.
18864
18865 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
18866
18867         * codegen.cs (EmitCode): New function, will emit the code for a
18868         Block of code given a TypeContainer and its ILGenerator. 
18869
18870         * statement.cs (Block): Standard public readonly optimization.
18871         (Block::Block constructors): Link children. 
18872         (Block::Child): Child Linker.
18873         (Block::EmitVariables): Emits IL variable declarations.
18874
18875         * class.cs: Drop support for MethodGroups here, delay until
18876         Semantic Analysis.
18877         (Method::): Applied the same simplification that I did before, and
18878         move from Properties to public readonly fields.
18879         (Method::ParameterTypes): Returns the parameter types for the
18880         function, and implements a cache that will be useful later when I
18881         do error checking and the semantic analysis on the methods is
18882         performed.
18883         (Constructor::GetCallingConvention): Renamed from CallingConvetion
18884         and made a method, optional argument tells whether this is a class
18885         or a structure to apply the `has-this' bit.
18886         (Method::GetCallingConvention): Implement, returns the calling
18887         convention. 
18888         (Method::Define): Defines the type, a second pass is performed
18889         later to populate the methods.
18890
18891         (Constructor::ParameterTypes): implement a cache similar to the
18892         one on Method::ParameterTypes, useful later when we do semantic
18893         analysis. 
18894
18895         (TypeContainer::EmitMethod):  New method.  Emits methods.
18896
18897         * expression.cs: Removed MethodGroup class from here.
18898
18899         * parameter.cs (Parameters::GetCallingConvention): new method.
18900
18901 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
18902
18903         * class.cs (TypeContainer::Populate): Drop RootContext from the
18904         argument. 
18905
18906         (Constructor::CallingConvention): Returns the calling convention.
18907         (Constructor::ParameterTypes): Returns the constructor parameter
18908         types. 
18909
18910         (TypeContainer::AddConstructor): Keep track of default constructor
18911         and the default static constructor.
18912
18913         (Constructor::) Another class that starts using `public readonly'
18914         instead of properties. 
18915
18916         (Constructor::IsDefault): Whether this is a default constructor. 
18917
18918         (Field::) use readonly public fields instead of properties also.
18919
18920         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
18921         track of static constructors;  If none is used, turn on
18922         BeforeFieldInit in the TypeAttributes. 
18923
18924         * cs-parser.jay (opt_argument_list): now the return can be null
18925         for the cases where there are no arguments. 
18926
18927         (constructor_declarator): If there is no implicit `base' or
18928         `this', then invoke the default parent constructor. 
18929
18930         * modifiers.cs (MethodAttr): New static function maps a set of
18931         modifiers flags into a MethodAttributes enum
18932         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
18933         MethodAttr, TypeAttr to represent the various mappings where the
18934         modifiers are used.
18935         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
18936
18937 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * parameter.cs (GetParameterInfo): Fix bug where there would be no
18940         method arguments.
18941
18942         * interface.cs (PopulateIndexer): Implemented the code generator
18943         for interface indexers.
18944
18945 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * interface.cs (InterfaceMemberBase): Now we track the new status
18948         here.  
18949
18950         (PopulateProperty): Implement property population.  Woohoo!  Got
18951         Methods and Properties going today. 
18952
18953         Removed all the properties for interfaces, and replaced them with
18954         `public readonly' fields. 
18955
18956 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
18957
18958         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
18959         initialize their hashtables/arraylists only when they are needed
18960         instead of doing this always.
18961
18962         * parameter.cs: Handle refs and out parameters.
18963
18964         * cs-parser.jay: Use an ArrayList to construct the arguments
18965         instead of the ParameterCollection, and then cast that to a
18966         Parameter[] array.
18967
18968         * parameter.cs: Drop the use of ParameterCollection and use
18969         instead arrays of Parameters.
18970
18971         (GetParameterInfo): Use the Type, not the Name when resolving
18972         types. 
18973
18974 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
18975
18976         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
18977         and instead use public readonly fields.
18978
18979         * class.cs: Put back walking code for type containers.
18980
18981 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
18982
18983         * class.cs (MakeConstant): Code to define constants.
18984
18985         * rootcontext.cs (LookupType): New function.  Used to locate types 
18986
18987
18988 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
18991         this System.Reflection code is.  Kudos to Microsoft
18992
18993         * typemanager.cs: Implement a type cache and avoid loading all
18994         types at boot time.  Wrap in LookupType the internals.  This made
18995         the compiler so much faster.  Wow.  I rule!
18996
18997         * driver.cs: Make sure we always load mscorlib first (for
18998         debugging purposes, nothing really important).
18999
19000         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19001         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19002
19003         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19004         on namespaces that have been imported using the `using' keyword.
19005
19006         * class.cs (TypeContainer::TypeAttr): Virtualize.
19007         (Class::TypeAttr): Return attributes suitable for this bad boy.
19008         (Struct::TypeAttr): ditto.
19009         Handle nested classes.
19010         (TypeContainer::) Remove all the type visiting code, it is now
19011         replaced with the rootcontext.cs code
19012
19013         * rootcontext.cs (GetClassBases): Added support for structs. 
19014
19015 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19016
19017         * interface.cs, statement.cs, class.cs, parameter.cs,
19018         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19019         Drop use of TypeRefs, and use strings instead.
19020
19021 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19022
19023         * rootcontext.cs: 
19024
19025         * class.cs (Struct::Struct): set the SEALED flags after
19026         checking the modifiers.
19027         (TypeContainer::TypeAttr): new property, returns the
19028         TypeAttributes for a class.  
19029
19030         * cs-parser.jay (type_list): Oops, list production was creating a
19031         new list of base types.
19032
19033         * rootcontext.cs (StdLib): New property.
19034         (GetInterfaceTypeByName): returns an interface by type name, and
19035         encapsulates error handling here.
19036         (GetInterfaces): simplified.
19037         (ResolveTree): Encapsulated all the tree resolution here.
19038         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19039         types. 
19040
19041         * driver.cs: Add support for --nostdlib, to avoid loading the
19042         default assemblies.
19043         (Main): Do not put tree resolution here. 
19044
19045         * rootcontext.cs: Beginning of the class resolution.
19046
19047 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19048
19049         * rootcontext.cs: Provide better error reporting. 
19050
19051         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19052
19053         * rootcontext.cs (CreateInterface): Handle the case where there
19054         are no parent interfaces.
19055
19056         (CloseTypes): Routine to flush types at the end.
19057         (CreateInterface): Track types.
19058         (GetInterfaces): Returns an array of Types from the list of
19059         defined interfaces.
19060
19061         * typemanager.c (AddUserType): Mechanism to track user types (puts
19062         the type on the global type hash, and allows us to close it at the
19063         end). 
19064
19065 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19068         RecordInterface instead.
19069
19070         * cs-parser.jay: Updated to reflect changes above.
19071
19072         * decl.cs (Definition): Keep track of the TypeBuilder type that
19073         represents this type here.  Not sure we will use it in the long
19074         run, but wont hurt for now.
19075
19076         * driver.cs: Smaller changes to accomodate the new code.
19077
19078         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19079         when done. 
19080
19081         * rootcontext.cs (CreateInterface):  New method, used to create
19082         the System.TypeBuilder type for interfaces.
19083         (ResolveInterfaces): new entry point to resolve the interface
19084         hierarchy. 
19085         (CodeGen): Property, used to keep track of the code generator.
19086
19087 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19088
19089         * cs-parser.jay: Add a second production for delegate_declaration
19090         with `VOID'.
19091
19092         (enum_body): Put an opt_comma here instead of putting it on
19093         enum_body or enum_member_declarations so we can handle trailing
19094         commas on enumeration members.  Gets rid of a shift/reduce.
19095
19096         (type_list): Need a COMMA in the middle.
19097
19098         (indexer_declaration): Tell tokenizer to recognize get/set
19099
19100         * Remove old targets.
19101
19102         * Re-add the parser target.
19103
19104 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19105
19106         * cs-parser.jay: Add precendence rules for a number of operators
19107         ot reduce the number of shift/reduce conflicts in the grammar.
19108
19109 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19110
19111         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19112         and put it here.
19113
19114         Get rid of old crufty code.
19115
19116         * rootcontext.cs: Use this to keep track of the parsed
19117         representation and the defined types available to the program. 
19118
19119         * gen-treedump.cs: adjust for new convention.
19120
19121         * type.cs: Split out the type manager, and the assembly builder
19122         from here. 
19123
19124         * typemanager.cs: the type manager will live here now.
19125
19126         * cil-codegen.cs: And the code generator here. 
19127
19128 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19129
19130         * makefile: Fixed up for easy making.
19131
19132 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19133
19134         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19135         the 
19136
19137         (unary_expression): Expand pre_increment_expression and
19138         post_decrement_expression to reduce a shift/reduce.
19139
19140 2001-07-11  Simon Cozens
19141
19142         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19143
19144         Improve allow_keyword_as_indent name.
19145
19146 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19147
19148         * Adjustments for Beta2. 
19149
19150 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19151
19152         * decl.cs: Added `Define' abstract method.
19153         (InTransit): new property, used to catch recursive definitions. 
19154
19155         * interface.cs: Implement `Define'. 
19156
19157         * modifiers.cs: Map Modifiers.constants to
19158         System.Reflection.TypeAttribute flags.
19159
19160         * class.cs: Keep track of types and user-defined types.
19161         (BuilderInit): New method for creating an assembly
19162         (ResolveType): New function to launch the resolution process, only
19163         used by interfaces for now.
19164
19165         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19166         that are inserted into the name space. 
19167
19168 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19169
19170         * ARGH.  I have screwed up my tree so many times due to the use of
19171         rsync rather than using CVS.  Going to fix this at once. 
19172
19173         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19174         load types.
19175
19176 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19177
19178         * Experiment successful: Use System.Type rather that our own
19179         version of Type.  
19180
19181 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19182
19183         * cs-parser.jay: Removed nsAliases from here.
19184
19185         Use new namespaces, handle `using XXX;' 
19186
19187         * namespace.cs: Reimplemented namespace handling, use a recursive
19188         definition of the class.  Now we can keep track of using clauses
19189         and catch invalid using clauses.
19190
19191 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19192
19193         * gen-treedump.cs: Adapted for all the renaming.
19194
19195         * expression.cs (Expression): this class now has a Type property
19196         which returns an expression Type.
19197
19198         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19199         `Type', as this has a different meaning now in the base
19200
19201 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19202
19203         * interface.cs, class.cs: Removed from all the sources the
19204         references to signature computation, as we can not do method
19205         signature computation during the parsing time, as we are not
19206         trying to solve at that point distinguishing:
19207
19208         class X {
19209                 void a (Blah x) {}
19210                 void a (NS.Blah x) {}
19211         }
19212
19213         Which depending on the context might be valid or not, as we do not
19214         know if Blah is the same thing as NS.Blah at that point.
19215
19216         * Redid everything so the code uses TypeRefs now instead of
19217         Types.  TypeRefs are just temporary type placeholders, that need
19218         to be resolved.  They initially have a pointer to a string and the
19219         current scope in which they are used.  This is used later by the
19220         compiler to resolve the reference to an actual Type. 
19221
19222         * DeclSpace is no longer a CIR.Type, and neither are
19223         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19224         are all DeclSpaces, but no Types. 
19225
19226         * type.cs (TypeRefManager): This implements the TypeRef manager,
19227         which keeps track of all the types that need to be resolved after
19228         the parsing has finished. 
19229
19230 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19231
19232         * ARGH.  We are going to have to store `foreach' as a class rather
19233         than resolving it, as we need to verify error 1579 after name
19234         resolution.   *OR* we could keep a flag that says `This request to
19235         IEnumerator comes from a foreach statement' which we can then use
19236         to generate the error.
19237
19238 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19239
19240         * class.cs (TypeContainer.AddMethod): we now add methods to the
19241         MethodGroup instead of the method hashtable.  
19242
19243         * expression.cs: Add MethodGroup abstraction, which gets us one
19244         step closer to the specification in the way we handle method
19245         declarations.  
19246
19247         * cs-parser.jay (primary_expression): qualified_identifier now
19248         tried to match up an identifier to a local variable reference or
19249         to a parameter reference.
19250
19251         current_local_parameters is now a parser global variable that
19252         points to the current parameters for the block, used during name
19253         lookup.
19254
19255         (property_declaration): Now creates an implicit `value' argument to
19256         the set accessor.
19257
19258 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19259
19260         * parameter.cs: Do not use `param' arguments as part of the
19261         signature, per the spec.
19262
19263 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19264
19265         * decl.cs: Base class for classes, structs and interfaces.  This
19266         is the "Declaration Space" 
19267
19268         * cs-parser.jay: Use CheckDef for checking declaration errors
19269         instead of having one on each function.
19270
19271         * class.cs: Factor out some code for handling error handling in
19272         accordance to the "Declarations" section in the "Basic Concepts"
19273         chapter in the ECMA C# spec.
19274
19275         * interface.cs: Make all interface member classes derive from
19276         InterfaceMemberBase.
19277
19278 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19279
19280         * Many things: all interfaces are parsed and generated in
19281         gen-treedump.  Support for member variables, constructors,
19282         destructors, properties, constants is there.
19283
19284         Beginning of the IL backend, but very little done, just there for
19285         testing purposes. 
19286
19287 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19288
19289         * cs-parser.jay: Fix labeled statement.
19290
19291         * cs-tokenizer.cs (escape): Escape " and ' always.
19292         ref_line, ref_name: keep track of the line/filename as instructed
19293         by #line by the compiler.
19294         Parse #line.
19295
19296 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19297
19298         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19299         to match the values in System.CodeDOM.
19300
19301         Divid renamed to Divide.
19302
19303         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19304         statements. 
19305         (Statements.set): remove.
19306
19307         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19308         statements. 
19309
19310         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19311         falseStatements always have valid values. 
19312
19313         * cs-parser.jay: Use System.CodeDOM now.
19314