a44ed9481c0270c6d76ab5fcd8aa369fc899b073
[mono.git] / mcs / mcs / ChangeLog
1 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * doc.cs : delegates must not be referenced with parameters.
4           Fixed bug #71605.
5
6 2005-04-12  Miguel de Icaza  <miguel@novell.com>
7
8         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
9
10 2005-04-11  Marek Safar  <marek.safar@seznam.cz>
11
12         Fix# 74565
13         * class.cs (TypeContainer.CircularDepException) New nested
14         exception class.
15         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
16         (TypeContainer.DefineType): Removed error, reset InTransit before
17         exit.
18         (Class.DefineType): Throw exception when is in Transit.
19         Catch exception and report error.
20         (Struct.DefineType): Throw exception when is in Transit.
21         Catch exception and report error.
22         (Interface.DefineType): Throw exception when is in Transit.
23         Catch exception and report error.
24         
25         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
26         handle nested exception handlers.
27
28         * flowanalysis.cs (InTryWithCatch): New method, search for try with
29         a catch.
30         
31         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
32         InFinally and InCatch storage.
33         
34         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
35         (Catch.Resolve): Set and Restore ec.InCatch.
36         (Try.Resolve): Set and Restore ec.InFinally.
37         (Try.HasCatch): True when try has catch.
38
39 2005-04-10  Miguel de Icaza  <miguel@novell.com>
40
41         * driver.cs (MainDriver): Stop processing if the CLS stage found
42         errors. 
43
44         (CompilerCallableEntryPoint.InvokeCompiler): Always
45         reset after execution;   Take a TextWriter argument for the
46         output.
47
48         * report.cs: Use the error stream instead of hardcoding stderr. 
49
50 2005-04-09  Miguel de Icaza  <miguel@novell.com>
51
52         * class.cs: Reduce code paths to test, too small of an
53         optimization to make it worth the extra testing.  Always perform
54         it. 
55
56 2005-04-08  Raja R Harinath  <rharinath@novell.com>
57
58         Fix #74510.
59         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
60         operators that had errors reported on them.
61
62 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
63
64         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
65         argument types.
66         (Attribute.Resolve): Add named argument type checking.
67         
68         * class.cs (FixedField.Define): Use IsPrimitiveType
69         
70         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
71         
72         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
73         unsafe parameter types.
74         
75         * statement.cs (Using.ResolveExpression): Add better error description.
76         
77         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
78         
79 2005-04-08  Raja R Harinath  <rharinath@novell.com>
80
81         Fix #74484.
82         * attribute.cs (Attribute.GetAttributeUsage): Resolve
83         AttributeUsageAttribute in the emitcontext of the attribute class,
84         not in the emitcontext of the attributable entity it was attached to.
85         * cs-parser.jay: Use 'current_class', not 'current_container',
86         when creating a GlobalAttribute.
87
88 2005-04-08  Alp Toker  <alp@atoker.com>
89
90         * pending.cs: The fix to #58413 failed to compile methods implementing
91         interfaces with/without params modifiers and vice versa, even though
92         params modifiers aren't part of the signature. Make the modifier check
93         less strict as in csc.
94
95 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
96             Anoob V E  <projectmonokochi@rediffmail.com>
97             Harilal P R  <projectmonokochi@rediffmail.com>
98
99         Fix #58413.
100         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
101         modifiers of pending methods.
102         (PendingImplementation.PendingImplementation): Initialize it.
103         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
104         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
105         with ParameterData.  Add check for modifiers.
106         * class.cs (MethodData.Define): Update to changes.
107
108 2005-04-07  Raja R Harinath  <rharinath@novell.com>
109
110         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
111
112 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
113
114         * class.cs (PropertyMethod.Define): Check private accessor in abstract
115         property.
116         
117         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
118         
119         * rootcontext.cs,
120         * typemanager.cs: Registered RequiredAttributeAttribute.
121         
122 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
123
124         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
125         Warning CS0169 is back at level 3.
126         (IMethodData.SetMemberIsUsed): New method.
127         
128         * decl.cs (IsUsed): New value; moved from FieldBase.Status
129         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
130         
131         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
132
133         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
134         contants.
135         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
136         is used.
137         
138         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
139         is used.
140         
141         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
142         to avoid the problems with nested types.
143
144 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
145             Anoob V.E  <projectmonokochi@rediffmail.com>
146             Harilal P.R  <projectmonokochi@rediffmail.com>
147             Raja R Harinath  <rharinath@novell.com>
148
149         Fix #73820.
150         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
151         attribute.
152         * typemanager (GetConstructor): Make public.
153
154 2005-04-05  John Luke  <john.luke@gmail.com>
155             Raja R Harinath  <rharinath@novell.com>
156
157         Fix #62232.
158         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
159         struct too.  Return false quicker in a few cases.
160         (VerifyUnManaged): Use it.
161
162 2005-04-05  Raja R Harinath  <rharinath@novell.com>
163
164         Fix #74041.
165         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
166         not 'unreachable_seen'.
167
168 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
169
170         * attribute.cs (Attribute.GetValue): Removed unused.
171         
172         * codegen.cs (CodeGen.TrimExt): Removed unused.
173         
174         * cs-parser.jay (output): Removed unused.
175         
176         * cs-tokenizer.cs (hex_digits): Removed unused.
177         
178         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
179         
180         * expression.cs (Indirection.LoadExprValue): Removed unused.
181         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
182         
183         * iterators.cs (Iterator.param_types): Removed unused.
184         
185         * statement.cs (Goto.block): Removed unused.
186         (ToplevelBlock.did): Removed unused.
187         (Switch.ResolveConstantSwitch): Removed unused.
188
189 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
190
191         * rootcontext.cs: Allow mcs to bootstrap with the compilation
192         resetting thingy.
193
194 2005-04-01  Raja R Harinath  <rharinath@novell.com>
195
196         Fix #74232 and cs0208-3.cs.
197         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
198         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
199         unmanaged type.  Don't use FieldBuilders when 't' is a
200         TypeBuilder.  Use ModFlags and MemberType fields.
201         * class.cs (MemberBase.member_type): Rename from MemberType.
202         (MemberBase.MemberType): New property.  Determines member_type on
203         demand.
204         (MemberBase.DoDefine): Don't initialize MemberType here.
205         (FieldMember.Define): Likewise.
206
207 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
208
209         Fix #74241
210         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
211         Attributes are emitted there.
212         
213 2005-04-01  Raja R Harinath  <rharinath@novell.com>
214
215         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
216         keyword in 'partial enum' too.
217         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
218         is not allowed).
219         Report from Kamil Skalski <nazgul@omega.pl>.
220
221         Fix #74309.
222         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
223         have partial containers too.
224
225         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
226         in block' checks to Block.CheckInvariantMeaningInBlock.
227         * statement.cs (Block.GetKnownVariableInfo): Make private.
228         (Block.IsVariableUsedInChildBlock): Remove.
229         (Block.IsVariableUsedInBlock): Likewise.
230         (Block.CheckInvariantMeaningInBlock): New.  Show location of
231         conflicting declaration.
232         (Block.AddVariable): Make error messages less long-winded and more
233         specific.  Show location of conflicting declaration.
234         * parameter.cs (Parameters.Location): New readonly property.
235
236 2005-03-31  Raja R Harinath  <rharinath@novell.com>
237
238         Clean up semantics of invoking ResolveMemberAccess.
239         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
240         can have an instance, ensure that we pass in a non-TypeExpression
241         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
242         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
243         argument.  Update to changes and simplify.
244         (FieldExpr.Emitinstance): Remove CS0120 check.
245         (PropertyExpr.EmitInstance): Likewise.
246         * expression.cs (Argument.Resolve): Likewise.
247         (Invocation.DoResolve): Update to changes in semantics of
248         InstanceExpression.
249
250 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
251
252         Fix #74241
253         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
254         customization.
255         
256         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
257
258 2005-03-31  Raja R Harinath  <rharinath@novell.com>
259
260         Fix difference in behaviour with commandline invocation.
261         * driver.cs (Driver.Reset): New.
262         (CompilerCallableEntryPoint): Call it.
263
264         * statement.cs (If.Resolve): Avoid spurious "uninitialized
265         variable" warnings if the boolean expression failed to resolve.
266
267 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
268
269         * attribute.cs: Fix the union of several permissions when some of them
270         are unrestricted (so the result isn't an unrestricted permission set).
271         Fix #74036.
272
273 2005-03-30  Raja R Harinath  <rharinath@novell.com>
274
275         * ecore.cs (MemberExpr): New class.  Convert from interface
276         IMemberExpr.
277         (MemberExpr.ResolveMemberAccess): Refactor and move here from
278         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
279         error checks.
280         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
281         (MethodGroupExpr.IsExplicitImpl): Remove.
282         (Expression.GetFieldFromEvent): Remove.
283         (SimpleName.MemberStaticCheck): Remove.
284         (SimpleName.DoSimpleNameResolve): Update to changes.
285         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
286         (MemberAccess.IdenticalNameAndTypeName): Remove.
287         (MemberAccess.error176): Move to MemberExpr.
288         (MemberAccess.DoResolve): Update to changes.
289         (BaseAccess.DoResolve): Likewise.
290
291 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
292
293         C# 2.0 Conditional attribute class implementation
294         
295         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
296         Analyzes class whether it has attribute which has ConditionalAttribute
297         and its condition is not defined.
298         
299         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
300         (Class.IsExcluded): New method. Search for at least one defined
301         condition in ConditionalAttribute of attribute class.
302
303 2005-03-30  Raja R Harinath  <rharinath@novell.com>
304
305         * ecore.cs (PropertyExpr): Derive from Expression, not
306         ExpressionStatement.
307         (PropertyExpr.EmitStatement): Remove.
308
309 2005-03-29  Raja R Harinath  <rharinath@novell.com>
310
311         Fix #74060.
312         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
313         internal field "value__" of an enum be private.  The examples for
314         "value__" that I found on MSDN all used FieldAttributes.Private.
315
316         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
317         Don't mention IL method attribute names.
318
319         Fix #47991.  Remove a TODO.
320         * statement.cs (Block.Toplevel): Make into a field.
321         (Block.Parameters): Move into ToplevelBlock.
322         (Block.known_variables): Rename from child_variable_names.
323         (Block.Block): Remove variants that take Parameters.  Initialize
324         'Toplevel' with the immediately surrounding toplevel block.
325         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
326         LocalInfo parameter.
327         (Block.GetKnownVariableInfo): New.
328         (Block.IsVariableNameUsedInChildBlock): Update.
329         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
330         the block, even though it may not be in scope.
331         (Block.AddVariable): Remove Parameters parameter.  Use
332         Toplevel.Parameters instead.
333         (Block.AddConstant): Remove Parameters parameter.
334         (Block.GetParameterReference): Update to use Toplevel.Parameters.
335         (Block.IsParamaterReference): Likewise.
336         (Block.IsLocalParameter): Likewise.  Simplify a lot.
337         (ToplevelBlock.Parameters): New.  Moved from Block.
338         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
339         initialize Parameters to a non-null value.
340         * cs-parser.jay: Update to changes.
341         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
342         simple names that mean different things in the same block.  Use
343         Block.IsVariableNameUsedInBlock.
344
345 2005-03-28  Raja R Harinath  <rharinath@novell.com>
346
347         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
348         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
349         GetTypeHandle.  It is possible for a reflected type to derive from
350         a TypeBuilder (e.g., int[] derives from the TypeBuilder
351         System.Array during mscorlib compilation).
352         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
353         contain a method_hash, don't create one either.  Don't create a
354         deep copy of the base cache's method_hash.
355         (MemberCache.SetupCache): Rename back from DeepCopy.
356         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
357         already initialized.  If we see an override function, add its
358         underlying base virtual function to the member_hash too.
359
360         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
361
362 2005-03-26  Raja R Harinath  <harinath@acm.org>
363
364         Fix #73038.
365         * assign.cs (Assign.DoResolve): When the RHS of an assignment
366         fails to resolve, ensure that the LHS is still resolved as an
367         lvalue.
368
369 2005-03-25  Raja R Harinath  <harinath@acm.org>
370
371         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
372         ec.ContainerType.
373         (Enum.current_ec): Remove.
374         (Enum.LookupEnumValue): Remove EmitContext argument.
375         Just uses the one created during DefineType.
376         (Enum.FindMembers): Update.
377         * expression.cs (MemberAccess.DoResolve): Update.
378
379 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
380
381         * assign.cs (Assign.DoResolve): Check for CS1717 when
382         source and target are same (uses Equals).
383
384         * expression.cs (LocalVariableReference, ParameterReference,
385         This): Implemented Equals, GetHashCode.
386
387         * statement.cs (Block.GetParameterReference): Removed useless
388         local variable.
389
390 2005-03-22  Raja R Harinath  <rharinath@novell.com>
391
392         Fix cs0128.cs
393         * statement.cs (Block.AddVariable): Ensure that we skip implicit
394         blocks before deciding whether the error is cs0136 or cs0128.
395
396         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
397         (using_alias_directive, using_namespace_directive): Pass
398         MemberName, not an expression to Namespace.UsingAlias and
399         Namespace.Using.
400         (MakeName): Use the MemberName of the namespace.
401         * namespace.cs (Namespace.MemberName): New.
402         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
403         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
404         Likewise.
405         * decl.cs (MemberName.Name): Make readonly.
406         (MemberName.FromDotted): New "constructor".
407         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
408         (MemberCore.Name): Compute from MemberName on demand.
409         (MemberCore.SetMemberName): Provide a way to change the
410         MemberName.
411         (MemberCore.AddToContainer): Don't take a fullname parameter.
412         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
413         fully qualified name of the container to the member name.
414         (TypeContainer.AddToTypeContainer): Use a fully qualified name
415         only if the type is a member of the root container.
416         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
417         MemberName.Left rather than searching for an embedded ".".
418         (PartialContainer.CreatePart): Update to changes in RootContext.
419         (MemberBase.ShortName): Turn into a property.  Use
420         MemberCore.SetMemberName.
421         (MemberBase.ExplicitInterfaceName): Remove.
422         (MemberBase.UpdateMemberName): Remove.
423         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
424         (PropertyBase.SetMemberName): New override.
425         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
426         (Tree.GetDecl): New.
427         (Tree.AllDecls): Rename from Decls.
428         * attribute.cs, enum.cs, report.cs: Update to changes.
429         * driver.cs (MainDriver): Use MemberName.FromDotted on
430         RootContext.MainClass.
431
432 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
433
434         * class.cs (FixedField.Define): Check for CS1664 and more sanity
435         checks.
436
437         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
438
439 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
440
441         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
442         property accessor modifiers.
443
444         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
445         fixed buffer attribute (CS1716).
446         (PropertyMethod.HasCustomAccessModifier): When property accessor
447         has custom modifier.
448
449         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
450         modifiers.
451         (PropertyExpr.DoResolveLValue): Add CS0272.
452
453 2005-03-17  Miguel de Icaza  <miguel@novell.com>
454
455         * convert.cs: When converting to a pointer, use the proper Conv.U
456         or Conv.I depending on the source data type.
457
458         * cs-tokenizer.cs: Make the size for large decimal constants,
459         fixes #72957.
460
461 2005-03-17  Martin Baulig  <martin@ximian.com>
462
463         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
464         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
465
466 2005-03-17  Martin Baulig  <martin@ximian.com>
467
468         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
469         to bool so we can return an error condition.
470         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
471         returned an error.
472
473 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
474
475         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
476         attributes.
477
478 2005-03-16  Raja R Harinath  <rharinath@novell.com>
479
480         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
481         Refactor to avoid traversing the list of assemblies, and to avoid
482         string concatenation.
483         * typemanager.cs (guid_attr_type): Remove.
484         (negative_hits, pointers, references): Remove hashes.
485         (type_hash): New.
486         (GetConstructedType): New.  Uses type_hash to handle constructed
487         types (arrays, references, pointers).
488         (GetReferenceType, GetPointerType): Use it.
489         (GetNestedType): New.  Uses type_hash to handle nested types of
490         reflected types.
491         (LookupType, LookupTypeDirect): Remove.
492         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
493         'types' hash and LookupTypeReflection directly.
494         (params_string, params_object): Use GetConstructedType.
495         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
496         top-level types.
497         (Namespace.Lookup): Use cached_types.
498         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
499         provided by old TypeManager.LookupType.
500         * rootcontext.cs (MakeFQN): Remove.
501         * decl.cs (DeclSpace.MakeFQN): Likewise.
502         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
503         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
504         TypeManager.GetConstructedType.
505         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
506
507 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
508
509         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
510         indexers.
511
512         * cs-parser.jay: Reports CS1527 for any namespace element.
513
514         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
515         Added CS0407.
516
517         * expression.cs (ParameterReference.IsAssigned): Changed error to
518         CS0269.
519         (Error_WrongNumArguments): Moved CS0245 detection here.
520
521         * statement.cs (Return.Resolve): Add CS1622 report.
522
523 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
524
525         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
526
527 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
528
529         * attribute.cs expression.cs: Get rid of some allocations.
530
531 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
532
533         * doc.cs : just eliminate the latest change.
534
535 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
536
537         * doc.cs : commented out the latest change. It breaks xml-030.cs
538
539 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
540
541         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
542           fail. So invoke CreateType() in FindDocumentedType().
543
544 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
545
546         * cs-tokenizer.cs : added IsKeyword().
547         * doc.cs : Detect keyword incorrectly used as identifier.
548           Allow identifiers prefixed by @.
549
550 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
551
552         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
553         It caused exception in namespace resolving (again!).
554         
555         * class.cs (Class.ctor): Removed exit.
556         (PropertyMethod.ctor): ditto.
557         
558         * codegen.cs (Codegen.Reset): Reset static data.
559         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
560         
561         * cs-tokenizer.cs (Cleanup): Removed.
562         
563         * driver.cs (GetSystemDir): Rewrote to one line command.
564         It caused problem with unloaded dynamic modules.
565         (UnixParseOption): Removed Exit.
566         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
567         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
568         Now can be mcs used as library.
569         
570         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
571         empty location.
572         
573         * location.cs (Reset): Reset static data.
574         
575         * namespace.cs (Reset): Reset static data.
576         
577         * report.cs (Report.Reset): Reset static data.
578         
579         * rootcontext.cs (RootContext.Reset): Reset static data.
580         
581         * tree.cs (RootTypes.ctor): Use Location.Null
582         
583         * typemanager.cs (TypeManager.Reset): Reset static data.
584         (CoreLookupType): Removed Exit.
585         (TypeHandle.Reset): Reset static data.
586         
587 2005-03-10  Raja R Harinath  <rharinath@novell.com>
588
589         Fix #73516.
590         * typemanager.cs (ComputeNamespaces): Import namespaces from
591         referenced modules too.
592
593 2005-03-09  Raja R Harinath  <rharinath@novell.com>
594
595         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
596         than '.'.
597
598 2005-03-09  Raja R Harinath  <rharinath@novell.com>
599
600         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
601         enclosing DeclSpace.  This ensures that a name-lookup populates
602         more caches and there are fewer 'TypeExpression's.  Carve out
603         nested type lookup into ...
604         (LookupNestedTypeInHierarchy): ... this.
605
606 2005-03-09  Raja R Harinath  <rharinath@novell.com>
607
608         Clean up a few partial-class semantics.  
609         Fixes test-357.cs and cs1618-2.cs.
610         * cs-parser.jay (struct_declaration): Use 'current_class' as
611         parent of newly-created struct.  Remove call to Register ().
612         Use 'pop_current_class' to complete handing the current struct.
613         (interface_declaration): Likewise.
614         (class_declaration): Likewise.
615         (enum_declaration): Use 'current_class' as parent of newly created
616         enum.
617         (delegate_declaration): Likewise.
618         (pop_current_class): New function.  This is used to handle closing
619         up the 'current_class' and 'current_container', and pointing them
620         to the enclosing class/container.
621         (CSharpParser): Initialize 'current_class' too.
622         * decl.cs (MemberCore): Add check for invariant: a partial
623         container is not a parsed entity, and thus does not enclose any
624         parsed members.
625         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
626         (DeclSpace.BaseTypeExpr): Use it.
627         (DeclSpace.LookupType): Add check for invariant.
628         * class.cs (TypeContainer): Add check for invariant: a nested
629         class should have the same NamespaceEntry as its enclosing class.
630         (TypeContainer.EmitFieldInitializers): Make virtual.
631         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
632         MemberCore.
633         (TypeContainer.Register): Remove.
634         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
635         null.  Use TypeResolveEmitContext for resolving base types and
636         interfaces.  Move initialization of Parts.TypeBuilder here from
637         ...
638         (TypeContainer.DefineNestedTypes): ... here.
639         (PartialContainer): Take a Namespace not a NamespaceEntry.
640         (PartialContainer.Create): Don't use Register.  Call the
641         appropriate Add... function directly.
642         (ClassPart): Take both the PartialContainer and the enclosing
643         class as constructor arguments.
644         (ClassPart.EmitFieldInitializers): Override.
645         (ClassPart.PartFindNestedTypes): Remove.
646         (FieldBase.GetInitializerExpression): Resolve the initializer
647         expression in the emit context of the enclosing class.
648         * tree.cs (RootTypes): Remove Register ().
649         
650 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
651
652         * cs-parser.jay: Removed CS0134.
653         
654         * driver.cs: Removed CS1901.
655         
656         * expression.cs (SizeOf.DoResolve): Don't report CS0233
657         for predefined types.
658
659 2005-03-07  Duncan Mak  <duncan@novell.com>
660
661         * codegen.cs (Save):  Catch UnauthorizedAccessException as
662         well. Fixes bug #73454.
663
664 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
665
666         * cs-tokenizer.cs (xtoken): Add CS1035.
667         
668         * class.cs (MethodData.Define): Add CS0683.
669         (FieldMember.ctor): Add CS0681.
670
671 2005-03-07  Raja R Harinath  <rharinath@novell.com>
672
673         * ecore.cs (SimpleName.DoResolve): Rename from
674         SimpleName.DoResolveAllowStatic.
675         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
676         Pass 'intermediate' flag to MemberStaticCheck.
677         (SimpleName.MemberStaticCheck): Skip "static check" only in case
678         of "intermediate" lookups via MemberAccess.
679         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
680         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
681
682 2005-03-07  Raja R Harinath  <rharinath@novell.com>
683
684         Fix #73394.
685         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
686         slipped in because of variable names that are identical to a
687         builtin type's BCL equivalent ('string String;', 'int Int32;').
688         (PropertyExpr.EmitInstance): Likewise.
689
690 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
691
692         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
693         
694         * report.cs (warning_ignore_table): Made public.
695
696 2005-03-04  Raja R Harinath  <rharinath@novell.com>
697
698         Fix #73282.
699         * class.cs (MethodData.Emit): Pass 'container' to
700         container.GetObsoleteAttribute instead of 'container.Parent'.
701
702 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
703
704         * cs-parser.jay: Add 1534 error test.
705
706         * iterators.cs (Yield.CheckContext): Add error 1629.
707         (Iterator.ctor): Save unsafe modifier.
708         (MoveNextMethod.DoEmit): Restore unsafe context.
709
710         * namespace.cs (UsingAlias): Better error message.
711
712 2005-03-03  Dan Winship  <danw@novell.com>
713
714         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
715         the warning message [#73219]
716
717 2005-03-03  Raja R Harinath  <rharinath@novell.com>
718
719         Fix compile with MCS 1.0.0.0.
720         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
721         w_restore to not depend on string constant folding.
722
723 2005-03-03  Raja R Harinath  <rharinath@novell.com>
724
725         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
726         CS0246 check to users who passed 'silent = false'.
727         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
728         check.
729         (SimpleName.SimpleNameResolve): Update.
730         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
731         (MemberAccess.IdenticalNameAndTypeName): Update.
732         * doc.cs (FindDocumentedTypeNonArray): Update.
733
734 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
735
736         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
737         * parameters.cs (ComputeAndDefineParameters): Remove.
738         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
739         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
740         Use GetParameterInfo.
741
742 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
743
744         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
745
746 2005-03-02  Raja R Harinath  <rharinath@novell.com>
747
748         Unify DeclSpace.LookupType and DeclSpace.FindType.
749         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
750         is in charge of defining nested types on demand.
751         (DeclSpace.LookupType): Use it when the current_type is a
752         TypeBuilder.  Use LookupTypeDirect for reflected types.
753         (DeclSpace.FindType): Remove.
754         (DeclSpace.LookupInterfaceOrClass): Likewise.
755         (DeclSpace.DefineTypeAndParents): Likewise.
756         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
757         DeclSpace.LookupType.
758         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
759         * typemanager.cs (LookupType): Simplify.
760         (AddUserType): Remove type from negative_hits.
761         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
762         * class.cs (TypeContainer.FindMembers): Move handling of nested
763         types ...
764         (TypeContainer.FindMembers_NestedTypes): ... here.
765         (TypeContainer.FindNestedType): Implement override.
766         (ClassPart.FindNestedType): Delegate to PartialContainer.
767         (ClassPart.PartFindNestedType): Looks up the nested types of the
768         part alone.
769
770 2005-03-02  Martin Baulig  <martin@ximian.com>
771
772         * class.cs (TypeContainer.DoDefineMembers): We also need a default
773         static constructor in static classes.
774
775 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
776
777         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
778         sizeParamIndex is not specified.
779
780 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
781
782         Fix #73117
783         * report.cs (WarningMessage.IsEnabled): Missing null check.
784
785 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
786
787         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
788         in the fields and not in the properties.
789
790 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
791
792         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
793         fields as well.
794
795 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
796
797         * attribute.cs: Small refactoring (improved robustness).
798         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
799         (ValidateGuid): Removed.
800         (Resolve): Removed referenced to above mentioned.
801         (GetAttributeUsage): Made private and changed to work without
802         class assistance.
803         (GetIndexerAttributeValue): Don't crash.
804         (GetConditionalAttributeValue): Ditto.
805         (GetClsCompliantAttributeValue): Ditto.
806         (ExtractSecurityPermissionSet): All attributes exceptions are
807         error 648.
808         (GetPropertyValue): New helper.
809         (GetMethodImplOptions): New method.
810         (DefinePInvokeMethod): Reuse common code. Implemented handling of
811         some missing properties.
812         
813         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
814         (Method.ApplyAttributeBuilder): Updated.
815         
816         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
817         exception.
818
819 2005-02-28  Raja R Harinath  <rharinath@novell.com>
820
821         Fix #73052.
822         * report.cs (Report.SymbolRelatedToPreviousError): Handle
823         non-simple types (array, pointer, reference).
824
825 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
826
827         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
828
829         * class.cs (MethodCore.IsDuplicateImplementation): Special error
830         for operators.
831         (Method.CheckBase): Catch wrong destructor here.
832         (MethodData.Define): Add errors 550, 668.
833
834         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
835
836         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
837
838         * pending.cs (VerifyPendingMethods): Add error 551.
839
840         * typemanager.cs (CSharpName): Next error report helper.
841
842 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
843
844         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
845         attributes. Removed useless attribute double check.
846         It saves almost 2MBs for corlib.
847
848 2005-02-25  Raja R Harinath  <rharinath@novell.com>
849
850         Fix #72924.
851         * statement.cs (ExpressionStatement.Resolve): Make robust to being
852         called twice in case of error.
853
854 2005-02-23  Chris Toshok  <toshok@ximian.com>
855
856         Fix compiler portions of #72827.
857         * statement.cs (Block.Emit): call Begin/EndScope on the
858         EmitContext instead of the ILGenerator.
859
860         * codegen.cs (EmitContext.BeginScope): new method, call
861         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
862         we have one.)
863         (EmitContext.BeginScope): same, but EndScope and CloseScope
864
865         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
866         offset and call the superclass's OpenScope(int) with it.
867         (SymbolWriter.CloseScope): get the current il
868         offset and call superclass's CloseScope(int) with it.
869
870 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
871
872         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
873         CS1677 for out and ref as well.
874
875         * class.cs (Method.Define): Add error CS1599 detection.
876         
877         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
878         
879         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
880         
881         * delegate.cs (Delegate.Define): Add error CS1599 detection.
882         
883         * support.cs.cs (ModifierDesc): New helper method.
884
885 2005-02-23  Raja R Harinath  <rharinath@novell.com>
886             Abin Thomas  <projectmonokochi@rediffmail.com>
887             Anoob V E  <projectmonokochi@rediffmail.com>
888             Harilal P R  <projectmonokochi@rediffmail.com>
889
890         Fix #57851, #72718.
891         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
892         MemberLookup (used for error reporting) actually returns a result.
893         Fix error report number (122, not 112).
894
895 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
896             Anoob V E  <projectmonokochi@rediffmail.com>
897             Harilal P R  <projectmonokochi@rediffmail.com>
898
899         Fix #71134.
900         * pending.cs (PendingImplementation.GetAbstractMethods):
901         Find NonPublic members too.
902
903 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
904
905         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
906         Fixed error 217.
907         
908         * class.cs (MethodCore.CheckMethodAgainstBase):
909         Add error 239 report.
910
911 2005-02-21  Raja R Harinath  <rharinath@novell.com>
912
913         Fix #68955.
914         * expression.cs (Invocation.IsApplicable): Make public.
915         (Invocation.IsParamsMethodApplicable): Likewise.
916         * delegate.cs (Delegate.VerifyApplicability): Don't use
917         Invocation.VerifyArgumentCompat for parameter applicability
918         testing.  Use Invocation.IsApplicable and
919         Invocation.IsParamsMethodApplicable.
920
921 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
922
923         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
924         
925         * class.cs (Operator.Define): Add error 217 report.
926         
927 2005-02-21  Raja R Harinath  <rharinath@novell.com>
928
929         * namespace.cs (UsingEntry.Resolve): Undo change below.
930
931 2005-02-21  Raja R Harinath  <rharinath@novell.com>
932
933         Fix #72756.
934         * ecore.cs (Expression.MemberLookupFailed): Add argument to
935         disable the error message when the extended MemberLookup also
936         fails.
937         (Expression.MemberLookupFinal): Update.
938         (SimpleName.DoSimpleNameResolve): Update.
939         * expression.cs (MemberAccess.ResolveNamespaceOrType):
940         Don't use MemberLookupFinal.
941         (New.DoResolve): Update.
942         (BaseAccess.CommonResolve): Update.
943
944 2005-02-21  Raja R Harinath  <rharinath@novell.com>
945
946         Fix #72732.
947         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
948         occured previously, don't resolve again.
949
950 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
951
952         Fix #69949
953         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
954         argument. Call ResolveAttributeUsage for unresolved.
955         when types doesn't match ctor arguments.
956         
957         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
958         for nested attribute classes.
959         (Class.attribute_usage): Removed.
960         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
961         for attribute class.
962         
963         * ecore.cs (IsAttribute): Removed.
964         
965         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
966         
967         * rootcontext.cs (RegisterAttribute): Removed, attributes are
968         now normal types.
969         (attribute_types): Removed.
970         (EmitCode): Global attributes are emited as the latest.
971
972 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
973
974         * class.cs (EmitFieldInitializers): Don't emit field initializer
975         for default values when optimilization is on.
976         
977         * constant.cs (Constant.IsDefaultValue): New property.
978         
979         * driver.cs: Add /optimize handling.
980         
981         * constant.cs,
982         * ecore.cs,
983         * literal.cs: Implement new IsDefaultValue property.
984         
985         * rootcontext.cs (Optimize): New field, holds /optimize option.
986
987 2005-02-18  Raja R Harinath  <rharinath@novell.com>
988
989         Fix crasher in re-opened #72347.
990         * namespace.cs (Namespace.Lookup): Return null if
991         DeclSpace.DefineType returns null.
992
993         Fix #72678.
994         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
995
996 2005-02-18  Raja R Harinath  <rharinath@novell.com>
997
998         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
999         now returns null if it cannot resolve to an lvalue.
1000         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1001         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1002         returned null.  Remove check for SimpleName.
1003         (EventExpr.DoResolveLValue): New.
1004         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1005         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
1006         error from ...
1007         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
1008         avoid CS0131 error.
1009         (Unary.ResolveOperator): Move CS0211 check ...
1010         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
1011         CS0131 error.
1012         (Unary.DoResolveLValue): Simplify.
1013         (AddressOf.DoResolveLValue): New.
1014         (ArrayAccess.DoResolveLValue): New.
1015
1016 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
1017
1018         * attribute.cs (Attribute.Resolve): Add arguments casting for
1019         when types doesn't match ctor arguments.
1020
1021 2005-02-16  Raja R Harinath  <rharinath@novell.com>
1022
1023         Fix parts of #63202.
1024         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1025         lookup of operator in base type.  Ensure that all checks happen
1026         when the operator resolves to an "op_..." method.
1027
1028 2005-02-15  Raja R Harinath  <rharinath@novell.com>
1029
1030         Fix #71992.
1031         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1032         'ignore_cs0104' parameter.  Pass it to ...
1033         (NamespaceEntry.Lookup): ... this.
1034         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1035         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1036         (TypeLookupExpression.DoResolveAsTypeStep): Update.
1037         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1038         Update.  Request that cs0104 errors be ignored.
1039         (ComposedCast.ResolveAsTypeStep): Update.
1040
1041 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1042
1043         Fix #59209.
1044         * expression.cs (Invocation.BetterFunction): Remove support for
1045         comparing virtual functions and their overrides.
1046         (Invocation.IsOverride): New.
1047         (Invocation.OverloadResolve): Don't consider 'override' functions
1048         during candidate selection.  Store them in a lookaside list.
1049         If the selected method is a 'virtual' function, use the list to
1050         find any overrides that are closer to the LHS type.
1051
1052 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
1053
1054         * expression.cs (New.DoResolve): Add complex core type reduction.
1055         (New.Constantify): Converts complex core type syntax like 'new int ()'
1056         to simple constant.
1057         
1058 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1059
1060         * decl.cs (EntryType.EntryType): New constructor to create an
1061         updated copy of a cache entry.
1062         (MemberCache.AddMethods): Use it.
1063         (MemberCache.ClearDeclaredOnly): Remove.
1064         (MemberCache.MemberCache): Update.
1065
1066 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1067
1068         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1069         variable.  This one is represents the actual low-level declaration
1070         of the method, as opposed to the semantic level `IsStatic'.   
1071
1072         An anonymous method which is hosted into a static method might be
1073         actually an instance method.  IsStatic would reflect the
1074         container, while MethodIsStatic represents the actual code
1075         generated.
1076
1077         * expression.cs (ParameterReference): Use the new MethodIsStatic
1078         instead of IsStatic.
1079
1080         * anonymous.cs (AnonymousMethod.Compatible): Pass the
1081         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1082         set on the current EmitContext. 
1083
1084         * expression.cs (Cast): Overload DoResolveLValue so we can pass
1085         resolve our casted expression as an LValue.  This triggers the
1086         proper LValue processing that is later required by Assign.
1087
1088         This fixes 72347.
1089
1090         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1091
1092 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
1093
1094         C# 2.0 Fixed buffer implementation
1095
1096         * anonymous.cs: Update after RegisterHelperClass renaming.
1097
1098         * attribute.cs (AttributeTester.fixed_buffer_cache):
1099         Cache of external fixed buffers.
1100         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
1101         implementation if field is fixed buffer else null.
1102
1103         * class.cs
1104         (TypeContainer.AddField): Accept FieldMember instead of Field.
1105         (FieldBase.IsFieldClsCompliant): Extracted code from
1106         VerifyClsCompliance descendant customization.
1107         (FixedField): New class handles fixed buffer fields.
1108         (FixedFieldExternal): Keeps information about imported fixed
1109         buffer.
1110         (IFixedField): Make access to internal or external fixed buffer
1111         same.
1112
1113         * cs-parser.jay: Add fixed buffer parsing.
1114
1115         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
1116         buffer.
1117
1118         * expression.cs (Indirection): Extended implementation to accept
1119         fixed buffer field.
1120         (PointerArithmetic.Emit): Get element from fixed buffer as well.
1121         (ElementAccess.MakePointerAccess): Get type as parameter.
1122         (DoResolve): Add fixed buffer field expression conversion.
1123         (DoResolveLValue): Ditto.
1124         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
1125         (ArrayPtr): Derives from FixedBufferPtr.
1126         (ArrayPtr.Emit): Add extra emit for array elements.
1127
1128         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
1129
1130         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
1131         for compiler generated types.
1132         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
1133
1134         * statement.cs (Fixed): Refactored to be easier add fixed buffer
1135         and consume less memory.
1136         (Fixed.Resolve): Add fixed buffer case.
1137
1138         * typemanager.cs (compiler_generated_attr_ctor,
1139         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
1140         (HasElementType): Add our own implementation to work on every
1141         runtime.
1142
1143 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1144
1145         * anonymous.cs (CaptureContext): Track whether `this' has been
1146         referenced.   
1147
1148         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
1149         only captured `this' if it was implicitly done (instance
1150         methods/variables were used). 
1151
1152         * codegen.cs (EmitContext.CaptureThis): New method to flag that
1153         `this' must be captured.
1154
1155 2005-01-30  Miguel de Icaza  <miguel@novell.com>
1156  
1157         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
1158         is null it means that there has been no need to capture anything,
1159         so we just create a sibling.
1160
1161         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
1162
1163         Just a partial fix.  The other half is fairly elusive.
1164         
1165 2005-02-10  Raja R Harinath  <rharinath@novell.com>
1166
1167         Fix #52586, cs0121-4.cs.
1168         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
1169         and return a hashtable.
1170         (MemberCache.ClearDeclaredOnly): New.
1171         (MemberCache.MemberCache): Update to change.  Make a deep copy of
1172         the method_hash of a base type too.
1173         (MemberCache.AddMethods): Adapt to having a deep copy of the base
1174         type methods.  Overwrite entries with the same MethodHandle so
1175         that the ReflectedType is correct.  The process leaves in base
1176         virtual functions and their overrides as distinct entries.
1177         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
1178         matters since it was boxed in a ArrayList before.
1179         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
1180         modifier.
1181         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
1182         case of a virtual function and its override (choose the overload
1183         as better).
1184         (Invocation.OverloadResolve): Avoid 'override' members during
1185         'applicable_type' calculation.
1186
1187 2005-02-09  Raja R Harinath  <rharinath@novell.com>
1188
1189         Combine two near-redundant caches.
1190         * typemanager.cs (method_params): Rename from method_internal_params.
1191         (TypeManager.GetParameterData): New.  Replace
1192         Invocation.GetParameterData.
1193         (TypeManager.LookupParametersByBuilder): Remove.
1194         * expression.cs (Invocation.method_parameter_cache): Remove.
1195         (Invocation.GetParameterData): Remove.
1196         Update to changes.
1197         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
1198         Update to changes.
1199
1200 2005-02-08  Raja R Harinath  <rharinath@novell.com>
1201
1202         Fix #72015.
1203         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
1204         TypeManager.multicast_delegate_type is null, resolve it by looking
1205         up "System.MulticastDelegate".
1206         * rootcontext.cs (RootContext.ResolveCore): Simplify.
1207
1208 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
1209             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
1210             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
1211
1212         Fix cs0164.cs.
1213         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
1214         (LabeledStatement.AddReference): New.  Set 'referenced'.
1215         (Goto.Resolve): Use it.
1216
1217 2005-02-05  John Luke  <john.luke@gmail.com>
1218
1219         * driver.cs: remove duplicate -doc line in Usage ()
1220
1221 2005-02-04  Raja R Harinath  <rharinath@novell.com>
1222
1223         * location.cs (Location.AddFile): Fix CS2002 error report.
1224
1225 2005-02-02  Martin Baulig  <martin@ximian.com>
1226
1227         * delegate.cs (Delegate.DefineType): Report an internal error if
1228         TypeManager.multicast_delegate_type is null.  See bug #72015 for
1229         details.        
1230
1231 2005-02-02  Raja R Harinath  <rharinath@novell.com>
1232
1233         Fix a crasher in a variant of #31984.
1234         * const.cs (Constant.CheckBase): New override that defers the
1235         new-or-override check in case the base type hasn't been populated
1236         yet.
1237         (Constant.Define): Ensure the new-or-override check is performed.
1238
1239 2005-02-01  Duncan Mak  <duncan@ximian.com>
1240
1241         * const.cs (LookupConstantValue): Check that `ce' is not null
1242         before calling GetValue ().
1243
1244 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1245
1246         Fix test-334.cs (#69519).
1247         * cs-parser.jay (using_alias_directive): Pass in an expression to
1248         NamespaceEntry.UsingAlias.
1249         (using_namespace_directive): Pass in an expression to
1250         NamespaceEntry.Using.
1251         (namespace_name): Don't flatten to a string.
1252         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
1253         (NamespaceEntry.AliasEntry.Resolve): Lookup using
1254         ResolveAsTypeStep.
1255         (NamespaceEntry.UsingEntry): Likewise.
1256         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
1257         changes.
1258         (NamespaceEntry.LookupForUsing): Remove.
1259         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
1260         names.
1261         (NamespaceEntry.Lookup): Remove support for dotted names.
1262
1263 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1264
1265         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
1266         split into two.
1267         (NamespaceEntry.ImplicitParent): Compute on demand.
1268         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
1269         parallels the current.
1270         (NamespaceEntry.LookupForUsing): Use it.
1271         (NamespaceEntry.Lookup): If the current namespace-entry is
1272         implicit, don't search aliases and using tables.
1273
1274 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1275
1276         Fix #31984.
1277         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
1278         BaseCache here.
1279         (TypeContainer.BaseCache): Compute on demand.
1280         (TypeContainer.FindMembers): Define constants and types if they're
1281         not already created.
1282         (FieldMember.Define): Move resetting of ec.InUnsafe before error
1283         check.
1284         * const.cs (Constant.Define): Make idempotent.
1285
1286 2005-01-29  Miguel de Icaza  <miguel@novell.com>
1287
1288         * pending.cs: Produce better code (no nops produced by using Ldarg
1289         + value).
1290         
1291         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
1292         i - 1' it should be arg + 1.
1293
1294         Fixes bug #71819.
1295
1296 2005-01-28  Raja R Harinath  <rharinath@novell.com>
1297
1298         * attribute.cs (Attribute.CheckAttributeType): Make private
1299         non-virtual.
1300         (Attribute.ResolveType): Make virtual.
1301         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
1302         handling of RootContext.Tree.Types.
1303
1304 2005-01-27  Raja R Harinath  <rharinath@novell.com>
1305
1306         Update attribute-handling to use the SimpleName/MemberAccess
1307         mechanisms.
1308         * cs-parser.jay (attribute): Pass in an expression to the
1309         constructors of Attribute and GlobalAttribute.
1310         * attribute.cs (Attribute): Take an expression for the name.
1311         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
1312         passed in attribute name expression.
1313         (Attribute.CheckAttributeType): Use it.
1314         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
1315         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
1316         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
1317         argument to prevent error messages if the lookup fails.
1318
1319 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
1320
1321         * expression.cs (Indirection): Implemented IVariable interface
1322         to support indirection in AddressOf operator.
1323         (PointerArithmetic.Emit): Add optimalization for case where
1324         result can be precomputed.
1325
1326 2005-01-26  Martin Baulig  <martin@ximian.com>
1327
1328         * class.cs (TypeContainer.AttributeTargets): Return the correct
1329         AttributeTargets depending on our `Kind' instead of throwing an
1330         exception; fixes #71632.
1331
1332 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
1333
1334         Fix #71257
1335         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
1336         constant members.
1337
1338 2005-01-25  Raja R Harinath  <rharinath@novell.com>
1339
1340         Fix #71602.
1341         * expression.cs (MemberAccess.DoResolve): Don't complain with
1342         cs0572 when the LHS of a member access has identical name and type
1343         name.
1344
1345 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
1346
1347         Fix #71651, #71675
1348         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
1349         CreatePermission.
1350         Create custom PermissionSet only for PermissionSetAttribute.
1351
1352 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
1353
1354         Fix #71649
1355         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
1356         delegates in static class.
1357
1358 2005-01-24  Martin Baulig  <martin@ximian.com>
1359
1360         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1361         merging an implicit block, just use its reachability.
1362
1363         * statement.cs (Block.Resolve): Make the unreachable code check
1364         work wrt. implicit blocks; see test-337 from #63842.
1365
1366 2005-01-21  Alp Toker  <alp@atoker.com>
1367  
1368         * cs-parser.jay: destructor_declaration's container is PartialContainer
1369         not Class when partial types are used, so use Kind prop instead of
1370         'is'.
1371         
1372 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
1373
1374         * cs-parser.jay: Improve error reporting when an interface
1375         declares new types.
1376
1377 2005-01-20  Dick Porter  <dick@ximian.com>
1378
1379         * support.cs: SeekableStreamReader fix from Sandor Dobos
1380         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
1381         chars are read.  Fixes bug 70369.
1382
1383 2005-01-20  Raja R Harinath  <rharinath@novell.com>
1384
1385         * cs-parser.jay (catch_clause): Simplify current_block handling
1386         somewhat.
1387
1388 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
1389
1390         * convert.cs (ImplicitStandardConversionExists): Synchronize the
1391         code with ImplicitStandardConversion to handle the implicit
1392         conversion of method groups into valid delegate invocations. 
1393
1394         The problem is that in parameter handling we were using this code
1395         path.  Fixes bug #64698
1396
1397 2005-01-19  Raja R Harinath  <rharinath@novell.com>
1398
1399         * cs-parser.jay: Fix several infelicities.
1400         - Avoid assigning to the parser value stack.  Code like 
1401           '$3 = null' is unclean.  Synthesize a value for the code block
1402           instead. 
1403         - Avoid using oob_stack for storing location information.  Use ...
1404         (_mark_): ... this.  New (empty) rule.  Saves the current location
1405         in $$.
1406         (foreach_statement): Avoid using oob_stack for current_block
1407         handling.  Use technique used in for_statement and
1408         using_statement.  Synthesize a value for the code block to store
1409         additional intermediate information.
1410
1411 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
1412
1413         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
1414         of a different type is only allowed to private fields of a
1415         containing type, not on fields of a base class.
1416
1417         See test-174.cs and error cs0122-9.cs
1418
1419 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1420
1421         Fix test-335.cs (bug #58126).
1422         * cs-parser.jay (argument): Split out non-expression parts of the
1423         rule into 'non_simple_argument'.
1424         (invocation_expression): Support parenthesized invocations with
1425         multiple arguments, and with single non-simple arguments.
1426
1427 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1428
1429         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
1430         places.
1431
1432 2005-01-12  Raja R Harinath  <rharinath@novell.com>
1433
1434         Fix cs0038-1.cs, cs1640-6.cs.
1435         * ecore.cs (Expression.Resolve): Remove special-case for
1436         SimpleName in error-handling.
1437         (Expression.almostMatchedMembers): Relax access permission to
1438         protected.
1439         (Expression.MemberLookupFailed): Handle duplicates in
1440         almostMatchedMembers list.
1441         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
1442         * expression.cs (New.DoResolve): Report CS1540 for more cases.
1443         * typemanager.cs (GetFullNameSignature): Use the MethodBase
1444         overload if the passed in MemberInfo is a MethodBase.
1445
1446 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
1447
1448         Fix #70749
1449         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
1450         for non-CAS & merge permission sets properly.
1451
1452 2005-01-11  Raja R Harinath  <rharinath@novell.com>
1453
1454         Improve standard-compliance of simple name and member access 
1455         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
1456         * ecore.cs (FullNamedExpression): New abstract base class 
1457         for Namespaces and TypeExpressions.
1458         (ResolveFlags.SimpleName): Remove.
1459         (SimpleName): Remove support for dotted names.
1460         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
1461         DeclSpace.FindType and DeclSpace.LookupType.
1462         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
1463         (Expression.ExprClassName): Make member function.
1464         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
1465         a namespace.  Remove creation of dotted "SimpleName"s.
1466         (MemberAccess.DoResolve): Likewise.
1467         * decl.cs (DeclSpace.Cache): Make private.
1468         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
1469         (DeclSpace.FindType): Update.
1470         (DeclSpace.LookupType): Move here from RootContext.  Return a 
1471         FullNamedExpression.
1472         * namespace.cs (Namespace): Derive from FullNamedExpression
1473         so that it can be part of expression resolution.
1474         (Namespace.Lookup): Return an FullNamedExpression.
1475         (NamespaceEntry.LookupAlias): Lookup aliases only in current
1476         namespace.
1477         * rootcontext.cs (NamespaceLookup): Remove.
1478         (LookupType): Move to DeclSpace.
1479         * attribute.cs (CheckAttributeType): Update.
1480         * doc.cs (FindDocumentedType): Remove allowAlias argument.
1481         (FindDocumentedTypeNonArray): Likewise.
1482
1483 2005-01-11  Raja R Harinath  <rharinath@novell.com>
1484
1485         Fix cs0509.cs, cs1632.cs.
1486         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
1487         is the same as IsInterface.
1488         (TypeContainer.GetClassBases): Likewise.
1489         * statement.cs (LabeledStatement.ig): New field.
1490         (LabeledStatement.LabelTarget): Save ILGenerator which created the
1491         label.
1492         (LabeledStatement.DoEmit): Check that the label was created with
1493         the same ILGenerator.
1494
1495 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1496
1497         Fix #71058
1498         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
1499         accessors to its properties.
1500
1501         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
1502         from accessors to property.
1503         
1504 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1505
1506         Fix #70722
1507         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
1508         only for overrides.
1509         
1510 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
1511
1512         * attribute.cs: Check for null and empty strings.  
1513
1514         I have lost another battle to Paolo.
1515
1516 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
1517
1518         Fix #70942
1519         * class.cs (PropertyMethod): Set Parent field in ctors.
1520         (SetMethod.InternalParameters): Add unsafe switch hack.
1521         Override MarkForDuplicationCheck where it is appropriate.
1522
1523         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
1524         It says whether container allows members with the same name.
1525         Base default is no.
1526         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
1527         Removed is_method parameter.
1528
1529 2005-01-06  Duncan Mak  <duncan@ximian.com>
1530
1531         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
1532         because the previous change led to incorrect reporting of CS1032
1533         ("Cannot define/undefine preprocessor symbols after first token in
1534         file"). Instead of using `tokens_seen' as the only flag that
1535         triggers CS1040, introduce `comments_seen'. This new flag is used
1536         to signify having seen comments on the current line, so it is
1537         unset after a newline.
1538
1539 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1540
1541         * doc.cs : When searching for a type, find nested type too.
1542           This fixes bug #71040.
1543
1544 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1545
1546         * doc.cs :
1547           - Warn missing member comment on those classes which also does not
1548             have doc comments. Fixed bug #71041.
1549           - Don't warn missing doc comment on default constructor.
1550             Fixed bug #71042.
1551
1552 2005-01-06  Duncan Mak  <duncan@ximian.com>
1553
1554         * cs-tokenizer.cs (xtoken): After handling traditional C-style
1555         comments, set `tokens_seen' to true. This allows us to detect
1556         misplaced preprocessor directives (i.e. not at the beginning of
1557         the a line, nor after whitespaces). In that case, report error
1558         CS1040. This fixes bug #56460.
1559
1560         * cs-parser.jay (interface_member_declaration): Add checks for
1561         IsExplicitImpl, and report CS0541 error if an interface member is
1562         defined as an explicit interface declaration.
1563
1564 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
1565
1566         Fix #70817
1567         * class.cs (PropertyMethod): Set Parent field in ctors.
1568         (SetMethod.InternalParameters): Add unsafe switch hack.
1569         
1570         * decl.cs (MemberCore.Parent): Cannot be readonly.
1571
1572 2005-01-06  Raja R Harinath  <rharinath@novell.com>
1573
1574         * decl.cs (DeclSpace.ResolveType): Remove.
1575         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
1576         Merge in code from ...
1577         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
1578         * class.cs, enum.cs: Update to changes.
1579
1580 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
1581
1582         * anonymous.cs: Ensure that we init the scope of our parent if it
1583         has not been initialized yet.
1584
1585 2004-12-30  Duncan Mak  <duncan@ximian.com>
1586
1587         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
1588         if field.FieldBuilder is null. Fixes #70758.
1589
1590         * convert.cs: Fixed some typos and updated some of the comments.
1591         (ImplicitStandardConversionExists):
1592         (TryImplicitIntConversion): If `target_type' is an interface and
1593         the type of `ic' implements this interface, return true or a new
1594         BoxedCast instead of null. This fixes #70468.
1595
1596 2004-12-29  Duncan Mak  <duncan@ximian.com>
1597
1598         * expression.cs (Argument.Emit): Check that Expr is
1599         IMemoryLocation before casting to it, and report CS1510 otherwise.
1600
1601         This fixes #70402.
1602
1603 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
1604
1605         * statement.cs (Block.ThisVariable): remove the recursion here, to
1606         make the --profile more sane.
1607
1608 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
1609
1610         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
1611         assembly, by JB Evain.
1612
1613 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1614
1615         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
1616           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
1617         "parent" refers to enclosing type/class.  "base" refers to superclass.
1618
1619 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1620
1621         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1622         Ensure that we only have GlobalAttributes.
1623         * attribute.cs (Attribute.Emit): Make non-virtual.
1624         (GlobalAttribute.Emit): Remove.
1625         (Attribute.Resolve): Make virtual.
1626         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
1627         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
1628         the argument. Don't create one.
1629         (Attribute.GetObsoleteAttribute): Likewise.
1630         (Attribute.GetClsCompliantAttributeValue): Likewise.
1631         * class.cs, decl.cs: Update to changes.
1632
1633 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
1634
1635         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
1636         
1637         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
1638         
1639         * statement.cs (Foreach.Resolve): Add error 186 report.
1640
1641 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
1642
1643         * expression.cs (Conditional.DoResolve): Add warning 429.
1644         
1645         * statement.cs (If.Resolve): Add warning 665.
1646
1647 2004-12-16  Raja R Harinath  <rharinath@novell.com>
1648
1649         New invariant: RootContext.Tree.Types.NamespaceEntry == null
1650         except when in the parser, and in GlobalAttribute.
1651         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
1652         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
1653         RootContext.Tree.Types.NamespaceEntry once work is done.
1654         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
1655         and resets RootContext.Tree.Types.NamespaceEntry.
1656
1657 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
1658
1659         * cs-parser.jay: Don't create a block for every variable.
1660
1661 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
1662
1663         * location.cs: Provide extra information.
1664
1665         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
1666         variables from the captured environment, it is the ldarg_0.
1667
1668 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1669
1670         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
1671         find a conclusion.
1672         
1673         * class.cs: Changed warning level for 169 to avoid developer
1674         displeasure from warning flooding. It will be changed back when they
1675         fix most of current BCL warnings.
1676         
1677         * RootContext.cs: Pushed default WarningLevel to 3.
1678         
1679         * statement.cs: Removed unused variable.
1680
1681 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1682
1683         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
1684         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
1685         Add error 502 report.
1686         (StaticClass.DefineType): Add error 441 report.
1687         (Class.AllowedModifiersProp): New virtual property as temporary
1688         extension to AllowedModifiers.
1689         (Class.DefineType): Add error 418 report. Moved ModFlags check here
1690         to share implementation with StaticClass and don't call virtual
1691         methods from ctor.
1692         
1693         * driver.cs (MainDriver): Add error 1558 test.
1694
1695         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1696         report. Moved error 36 test here.
1697
1698         * statement.cs (Throw.Resolve): Add error 724 report.
1699
1700         * typemanager.cs: Add out_attribute_type core type.
1701         
1702 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
1703
1704         * class.cs (TypeContainer.VerifyClsCompliance): Add error
1705         3018 report.
1706         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1707
1708         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1709         3017 report.
1710         
1711         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1712
1713         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
1714         Add error 3023 report.
1715         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1716
1717         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1718         implementation.
1719
1720 2004-12-12  John Luke  <john.luke@gmail.com>
1721
1722         * driver.cs (AddArgs): take -- into account when
1723         adding arguments, fixes bug 65710 
1724
1725 2004-12-12  Martin Baulig  <martin@ximian.com>
1726
1727         * expression.cs (Unary.TryReduceNegative): Added support for
1728         SByteConstant and ByteConstant.
1729         (Unary.Reduce): Check error values from TryReduceNegative().
1730
1731 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1732
1733         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1734         and report exception as error 182.
1735
1736 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1737
1738         * driver.cs (Main): Fix message when there are warnings.
1739
1740 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1741
1742         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1743
1744 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1745
1746         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1747         Reduced number of warnings.
1748         
1749         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1750
1751 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1752
1753         * driver.cs: Removed message.
1754
1755         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1756
1757 2004-12-08    <vargaz@freemail.hu>
1758
1759         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1760
1761 2004-12-08  Martin Baulig  <martin@ximian.com>
1762
1763         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1764         instead of a CS3002 for properties and indexer.
1765
1766 2004-12-08  Martin Baulig  <martin@ximian.com>
1767
1768         * decl.cs (MemberName.ToString): Make this work again.
1769
1770 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1771
1772         * attribute.cs (Resolve): Add error 591 detection.
1773
1774         * class.cs (FieldMember.Define): Add error 1547 detection.
1775         (Indexer.Define): Add error 620 detection.
1776         (Operator.Define): Add error 590 detection.
1777
1778         * ecore.cs: Missing argument for error 79.
1779
1780         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1781         detection.
1782
1783 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1784
1785         Fix #70106
1786         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1787         only.
1788
1789 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1790
1791         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1792           Some operator comments were suppressed.
1793         * doc.cs : Implicit/explicit operator name in doc comments are like
1794           "op_Explicit(type)~returnType", so added suffix handling.
1795
1796 2004-12-07  Martin Baulig  <martin@ximian.com>
1797
1798         * decl.cs
1799         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1800         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1801         (DeclSpace.ec): New protected field; store the EmitContext here.
1802         (DeclSpace.EmitContext): New public property; moved here from
1803         `TypeContainer'.
1804         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1805         EmitContext.
1806
1807         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1808         (Enum.Emit): Don't create a new EmitContext.
1809
1810         * delegate.cs (Delegate.DefineType): Always create the
1811         EmitContext.
1812
1813         * iterators.cs (Iterators.DefineIterator): Create a new
1814         EmitContext and store it in `ec'.
1815
1816 2004-08-24  Martin Baulig  <martin@ximian.com>
1817
1818         * typemanager.cs
1819         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
1820         this for accessibility checks.
1821         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
1822         IsNestedFamilyAccessible.
1823         (TypeManager.IsSubclassOf): New method, do what the name actually
1824         says.   
1825
1826 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1827
1828         Fix crash on cs0657-17.cs.
1829         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1830         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1831         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1832         the case where the NamespaceEntry gets overwritten.
1833
1834 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1835
1836         Fixed #69195, #56821
1837         * ecore.cs (ResolveBoolean): Tiny refactoring.
1838
1839         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1840         of right expression resolving when left is false constant and
1841         operator is LogicalAnd OR true constant and operator is LogicalOr.
1842
1843         * statement.cs (ResolveUnreachable): Always reports warning.
1844
1845 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1846
1847         * class.cs: Distinguish between 1721 and 1722 (just a little help
1848         for the programmer).
1849
1850 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1851
1852         * delegate.cs: Only allow this on new versions of the language. 
1853
1854 2004-12-02  Duncan Mak  <duncan@ximian.com>
1855
1856         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1857         Expression class.
1858         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1859         here as a static method. Take an additional bool out parameter
1860         `must_do_cs1540_check' for signaling to InstanceResolve.
1861         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1862         member field from PropertyExpr class and made it an argument of
1863         the method instead.
1864         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1865         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1866         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1867         and `remove_accessor' as well as InstanceResolve: report CS0122
1868         where applicable.
1869
1870         Fixes #70129.
1871
1872 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1873
1874         Fix test-327.cs, test-328.cs, and put in early infrastructure
1875         for eventually fixing #52697.
1876         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1877         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1878         from other methods.
1879         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1880         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1881         (VerifyUsing, error246): Update.
1882         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1883         'NamespaceEntry.LookupNamespaceOrType'.
1884
1885 2004-12-03  Martin Baulig  <martin@ximian.com>
1886
1887         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1888         method as our child, call AnonymousMethod.Compatible() on it.
1889
1890 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1891
1892         Disable XML documentation support in 'basic' profile.
1893         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
1894         Redirect XmlElement to System.Object.
1895         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
1896         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
1897         * mcs.exe.sources: Add doc-bootstrap.cs.
1898         * doc-bootstrap.cs: New file.  Contains empty stub implementation
1899         of doc.cs.
1900
1901 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1902
1903         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1904           comments are allowed.
1905
1906 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1907
1908         * delegate.cs: Add checks for subtypes in paramaters and return values
1909         in VerifyMethod () to add support for Covariance/Contravariance
1910         in delegates.
1911         
1912 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1913
1914         * report.cs: Remove extra closing parenthesis.
1915
1916         * convert.cs (Error_CannotImplicitConversion): If the name of the
1917         types are the same, provide some extra information.
1918
1919         * class.cs (FieldBase): Use an unused bit field from the field to
1920         encode the `has_offset' property from the FieldMember.  This saves
1921         a couple of Ks on bootstrap compilation.
1922
1923         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1924         method as our child, return the AnonymousMethod resolved
1925         expression.
1926
1927         * expression.cs (New.DoResolve): Allow return values from
1928         NewDelegate to also include AnonymousMethods.
1929
1930         Fixes #70150.
1931
1932 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1933
1934         Fix bug #70102
1935         * attribute.cs (Resolve): Improved implementation of params
1936         attribute arguments.
1937
1938         * support.cs (ParameterData): Add HasParams to be faster.
1939
1940 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1941
1942         all things are for /doc support:
1943
1944         * doc.cs: new file that supports XML documentation generation.
1945         * mcs.exe.sources: added doc.cs.
1946         * driver.cs:
1947           Handle /doc command line option.
1948           Report error 2006 instead of 5 for missing file name for /doc.
1949           Generate XML documentation when required, after type resolution.
1950         * cs-tokenizer.cs:
1951           Added support for picking up documentation (/// and /** ... */),
1952           including a new XmlCommentState enumeration.
1953         * cs-parser.jay:
1954           Added lines to fill Documentation element for field, constant,
1955           property, indexer, method, constructor, destructor, operator, event
1956           and class, struct, interface, delegate, enum.
1957           Added lines to warn incorrect comment.
1958         * rootcontext.cs :
1959           Added Documentation field (passed only when /doc was specified).
1960         * decl.cs:
1961           Added DocComment, DocCommentHeader, GenerateDocComment() and
1962           OnGenerateDocComment() and some supporting private members for
1963           /doc feature to MemberCore.
1964         * class.cs:
1965           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1966         * delegate.cs:
1967           Added overriden DocCommentHeader.
1968         * enum.cs:
1969           Added overriden DocCommentHeader and GenerateDocComment().
1970
1971 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1972
1973         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1974         unwrapping the enumeration values, chain to
1975         DoConstantNumericPromotions again, so we can promote things to the
1976         fundamental types (takes care of enums that are bytes, sbytes).
1977
1978         Fixes bug #62054.
1979
1980 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1981
1982         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1983         Fix long-standing bug in type-lookup.  Use FindType instead of
1984         LookupType when ec.ResolvingTypeTree.
1985         (Attribute.ResolveType, Attribute.Resolve)
1986         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1987         Update to changes.
1988         (Attributes.Search): Remove internal version.  Update.
1989         (Attributes.SearchMulti): Update.
1990         (Attributes.GetClsCompliantAttribute): Remove.
1991         (Attributes.GetIndexerNameAttribute): Remove.
1992         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1993         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1994         * class.cs (Indexer.Define): Likewise.
1995
1996 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1997
1998         Fix bug #68790
1999         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
2000         MarshallByReference members access.
2001
2002         * expression.cs: Use CheckMarshallByRefAccess;
2003         Better error CS0197 message.
2004
2005         * report.cs: Print whole related error message.
2006
2007 2004-11-30  Raja R Harinath  <rharinath@novell.com>
2008
2009         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
2010         the current directory to help debugging.
2011
2012 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2013
2014         * class (GetClassBases): Better error 60 report.
2015         (EventProperty): Disabled warning 67 detection.
2016
2017 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2018
2019         Fix bug #60324
2020         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
2021
2022         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
2023         precise values.
2024
2025 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2026
2027         Fix bug #49488
2028         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
2029
2030         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
2031
2032 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
2033
2034         * attribute.cs (Attribute.Resolve): Refine error reporting and
2035         report a cs0117 if the identifier does not exist, to distinguish
2036         from 0617 which is a miss-use of the actual identifier.
2037
2038         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
2039         between cs0070 and cs0079.
2040
2041         * class.cs (MemberBase.DoDefine): When reporting a wrong
2042         accessibility level, we use MethodCore to compare instead of
2043         Method (this was a regression in some refactoring effort).
2044
2045         So now we correctly report cs0056 again.
2046
2047         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
2048         testing the target_type (which was known to be object_type) and
2049         not the source type (which is anonymous_method).
2050
2051         Fixed reporting of error cs1660.
2052
2053         * expression.cs (UserCast.Source): Expose the underlying cast.
2054
2055         * statement.cs (Switch.SwitchGoverningType): Sort the list of
2056         allowed types to find a match to int32 first (most common).
2057
2058         In addition, it ignores any ImplicitUserConversions that did an
2059         internal implicit conversion (as the switch statement allows only
2060         one integral conversion to exist).
2061
2062         * class.cs (PartialContainer.Create): rename `name' to
2063         `member_name' for clarity.  Then replace the string calls with a
2064         call to MemberName.GetPartialName, as now using
2065         MemberName.ToString is an error (this is due to the side effects
2066         it had, that were fixed in the past).
2067
2068         This will restore the error reporting on a number of partial class
2069         errors that were missusing this (and getting an exception as a
2070         results, which is now just a plain textual warning, because
2071         yyparse debug output would crash otherwise).
2072
2073 2004-11-26  Raja R Harinath  <rharinath@novell.com>
2074
2075         * Makefile (PROGRAM_INSTALL_DIR): Remove.
2076
2077 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2078
2079         * rootcontext.cs (LookupType): Make sure to cache lookups that
2080         don't give us a negative result. This saves about 5% of corlib
2081         compilation time.
2082
2083 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2084
2085         * report.cs (AbstractMessage.Print): messages are sent to stderr
2086
2087         * class.cs (TypeContainer.GetClassBases): It is an error to have a
2088         non-interface in the list of interfaces (at this point, either
2089         parent was properly set, or a base class is being listed in the
2090         interfaces section).
2091
2092         This flags error 1722, and resolves the crash from bug 69259.
2093
2094 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2095
2096         * statement.cs (Using.EmitExpressionFinally): make this work right
2097         for valuetypes. Fixes 69926.
2098
2099 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2100
2101         * const.cs (Const.ChangeType): Cope with the "0 literal can be
2102         converted to an enum" here, before we try to change the underlying
2103         type.  This code exists, but it is a different code path than the
2104         one used while encoding constants.
2105
2106         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
2107         old bug: when converting from the null literal to a pointer,
2108         return an EmptyCast, not the NullLiteral.
2109
2110         This fixes #69921, the recent null_type changes probably made this
2111         bug more prominent.
2112
2113         (ImplicitReferenceConversionExists): In addition, resynchronized
2114         the code here, so it matches the same code in
2115         ImplicitReferenceConversionExists for the `from any class-type S
2116         to any interface-type T'.
2117         
2118
2119 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
2120
2121         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
2122
2123 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
2124
2125         * cs-parser.jay: Use verbosity accordingly. 
2126
2127 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2128
2129         * expression.cs (Unary.ResolveOperator): Do not report warning;
2130         AddressOf reads from variable.
2131         
2132         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
2133
2134 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2135
2136         Fix bug #69462
2137
2138         * attribute.cs (Attributable): Removed CheckTargets.
2139         (Attributes.Emit): Explicit attribute targets are tested here.
2140
2141         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
2142         not enabled for interfaces.
2143
2144         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
2145         (GetAssemblyName): Ouch next bug there.
2146
2147 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2148
2149         * expression.cs: Error 275 added.
2150         
2151 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
2152
2153         Fix bug #69177 (Implemented decimal constant support)
2154
2155         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
2156         (BinaryFold): Add DecimalConstant.
2157
2158         * const.cs (Define): Decimal constant 
2159         (is not constant.
2160         (ChangeType): Add decimal type handling.
2161         (LookupConstantValue): Don't set value for decimal type but
2162         emit DecimalConstantAttribute. Needed for constant optimization.
2163
2164         * constant.cs (ToDecimal): New method.
2165         (ConvertToDecimal): New method.
2166         (IntConstant): Implemented ConvertToDecimal.
2167         (DecimalConstant.Emit): Emit optimized version for decimals in
2168         int range.
2169
2170         * expression.cs (ResolveOperator): Changed order of constant
2171         reduction to work correctly with native types which have
2172         overloaded operators.
2173         (ResolveMemberAccess): Extract constant value from attribute
2174         for decimal type.
2175
2176         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
2177
2178         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
2179         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
2180         (ChangeType): Decimal is special.
2181         (TypeToCoreType): Add decimal type.
2182
2183 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2184
2185         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
2186         decimal types.
2187
2188 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2189
2190         * class.cs (EventField.ApplyAttributeBuilder): Fix error
2191         test cs1667-5.cs.
2192
2193 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2194
2195         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
2196
2197         * pending.cs (PendingImplementation): Grab only interfaces.
2198
2199 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2200
2201         * statement.cs (ForeachHelperMethods): Add location member and
2202         error 202 detection.
2203
2204 2004-11-19  Raja R Harinath  <rharinath@novell.com>
2205
2206         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
2207         automatically handled by executable.make.
2208         (PROGRAM): Make profile-specific.
2209
2210 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
2211
2212         * expression.cs (DoResolveBase): Fixed wrong warning for out
2213         variables.
2214
2215 2004-11-18  Martin Baulig  <martin@ximian.com>
2216
2217         Merged latest changes into gmcs.  Please keep this comment in
2218         here, it makes it easier for me to see what changed in MCS since
2219         the last time I merged.
2220
2221 2004-11-17  Raja R Harinath  <rharinath@novell.com>
2222
2223         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
2224         (TypeHandle.GetMemberCache): New.
2225         (TypeHandle.TypeHandle): Update.
2226         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
2227         (TypeManager.LookupParentInterfacesCache):
2228         Rename from LookupInterfaceCache.  Optimize slightly.
2229         (TypeManager.MemberLookup_FindMembers): Update.
2230         * decl.cs (MemberCache.MemberCache): Set Container to null in the
2231         multi-type variant.
2232         (AddCacheContents): Rename from AddHashtable.
2233         * class.cs (TypeContainer.parent_container): Remove.
2234         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
2235         (TypeContainer.DoDefineMembers): Don't initialize it.
2236         Update to name changes.
2237         
2238 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
2239
2240         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
2241         that factors the code to check access modifiers on override.  
2242
2243         (PropertyBase): Use the code here.
2244
2245         Patch from Lluis S'anchez, fixes bug #69361.
2246
2247 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
2248
2249         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
2250         routine that is used to report the use of a captured variable
2251         whose address has been taken.
2252
2253         There are two checks: one when variables are being captured and
2254         the other check is when the address of a variable is taken. 
2255         
2256         (because an anonymous methods might be resolved before *or* after
2257         the address has been taken) and 
2258
2259         * expression.cs (Conditional.DoResolve): Remove the special
2260         casing that Martin added to trueExpr and falseExpr being both
2261         NullLiteral.  We get the right behavior now just by introducing
2262         the null_type into the compiler. 
2263
2264         * convert.cs (ExplicitConversion): Change the code to use
2265         null_type instead of testing `expr is NullLiteral'.
2266         (ImplicitConversionStandard): use null_type too.
2267         (ImplicitReferenceConversionExists): use null_type too.
2268         (ImplicitReferenceConversion): use null_type too.
2269
2270         * literal.cs: The type of `NullLiteral' is now null_type instead
2271         of object_type. 
2272         (Resolve): Set the type here.
2273
2274         * typemanager.cs: Introduce null_type.
2275
2276 2004-11-17  Martin Baulig  <martin@ximian.com>
2277
2278         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
2279         direction, like FindMembers() does.  Fixes #69546, testcase is in
2280         test-315.cs.    
2281
2282 2004-11-16  Martin Baulig  <martin@ximian.com>
2283
2284         This is based on a patch from Marek Safar, see bug #69082.
2285         Fixes bugs #63705 and #67130.
2286
2287         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
2288         method; create a MemberCache for an interface type and cache the
2289         result.
2290
2291         * decl.cs (IMemberContainer.ParentContainer): Removed.
2292         (IMemberContainer.ParentCache): New property.
2293         (MemberCache.SetupCacheForInterface): Removed.
2294         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
2295         to create a cache for an interface's "parent".
2296
2297         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
2298         interfaces too.
2299
2300 2004-11-16  Martin Baulig  <martin@ximian.com>
2301
2302         Merged back from gmcs; these changes already went into gmcs a
2303         couple of weeks ago.
2304
2305         * typemanager.cs
2306         (TypeManager.AddUserType): Removed the `ifaces' argument.
2307         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
2308         `TypeExpr []'.
2309         (TypeManager.AddUserInterface): Removed.
2310         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
2311         `TypeExpr []'.
2312         (TypeManager.GetInterfaces): Likewise.
2313         (TypeManager.GetExplicitInterfaces): Likewise.
2314
2315         * ecore.cs (TypeExpr.GetInterfaces): Removed.
2316
2317         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
2318         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
2319
2320 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
2321
2322         * statement.cs: Avoid adding bools to a hashtable.
2323
2324 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
2325
2326         * expression.cs (Invocation.OverloadResolve): Flag error if we are
2327         calling an unsafe method from a safe location.
2328
2329 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
2330
2331         Fix #69167
2332         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
2333
2334 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
2335
2336         * namespace.cs (VerifyUsing): use GetPartialName instead of
2337         ToString. 
2338
2339 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
2340
2341         * statement.cs (Return.Resolve): Fix regression in typo: if
2342         `in_exc', we have to request a NeedReturnLabel, this was a typo
2343         introduced in the anonymous method check-in.  Fixes #69131.
2344
2345         * Indexers were using the ShortName when defining themselves,
2346         causing a regression in the compiler bootstrap when applying the
2347         patch from 2004-11-02 (first part), now they use their full name
2348         and the bug is gone.
2349
2350 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
2351
2352         * driver.cs: Strip the path from the names of embedded resources. Fixes
2353         #68519.
2354
2355 2004-11-04  Raja R Harinath  <rharinath@novell.com>
2356
2357         Fix error message regression: cs0104-2.cs.
2358         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
2359         (AliasEntry.Resolve): Update.
2360         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
2361         'silent' flag.
2362         (RootContext.LookupType): Update.
2363
2364 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
2365
2366         * cs-parser.jay: Add support for handling accessor modifiers
2367         * class: Add support port accessor modifiers and error checking,
2368         define PropertyMethod.Define as virtual (not abstract anymore)
2369         * ecore.cs: Add checking for proeprties access with access modifiers
2370         * iterators.cs: Modify Accessor constructor call based in the modified
2371         constructor
2372 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
2373
2374         * expression.cs (StringConcat): Handle being called twice,
2375         as when we have a concat in a field init with more than two
2376         ctors in the class
2377
2378 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
2379
2380         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
2381         special case explicit implementations, we should always produce
2382         the .property or .event declaration.
2383         
2384         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
2385         since it will not return correct data if people use this
2386         unresolved in the presence of using statements (see test-313).
2387
2388         * class.cs (MethodData.Define): If we are an explicit interface
2389         implementation, set the method name to the full name of the
2390         interface plus the name of the method.  
2391
2392         Notice that using the method.MethodName.GetFullName() does not
2393         work, as it will only contain the name as declared on the source
2394         file (it can be a shorthand in the presence of using statements)
2395         and not the fully qualifed type name, for example:
2396
2397         using System;
2398
2399         class D : ICloneable {
2400                 object ICloneable.Clone ()  {
2401                 }
2402         }
2403
2404         Would produce a method called `ICloneable.Clone' instead of
2405         `System.ICloneable.Clone'.
2406
2407         * namespace.cs (Alias.Resolve): Use GetPartialName.
2408         
2409 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2410
2411         * cs-parser.jay: Add error 1055 report.
2412
2413 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
2414
2415         * assign.cs (Assign.DoResolve): Only do the transform of
2416         assignment into a New if the types are compatible, if not, fall
2417         through and let the implicit code deal with the errors and with
2418         the necessary conversions. 
2419
2420 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2421
2422         * cs-parser.jay: Add error 1031 report.
2423
2424         * cs-tokenizer.cs: Add location for error 1038.
2425
2426 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2427
2428         * cs-parser.jay: Add error 1016 report.
2429
2430 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2431
2432         * cs-parser.jay: Add errors 1575,1611 report.
2433
2434 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2435
2436         * cs-parser.jay: Add error 1001 report.
2437
2438 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2439
2440         Fix #68850
2441         * attribute.cs (GetMarshal): Add method argument for
2442         caller identification.
2443
2444         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
2445         agument for GetMarshal and RuntimeMissingSupport.
2446
2447 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2448
2449         * attribute.cs (ExtractSecurityPermissionSet): Removed
2450         TypeManager.code_access_permission_type.
2451
2452         * typemanager.cs: Removed TypeManager.code_access_permission_type.
2453
2454 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
2455
2456         * expression.cs (LocalVariableReference.DoResolveLValue): Check
2457         for obsolete use of a variable here.   Fixes regression on errors
2458         cs0619-25 and cs0619-26.
2459
2460 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
2461
2462         Fix #62358, implemented security attribute encoding.
2463
2464         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
2465         Tests permitted SecurityAction for assembly or other types.
2466         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
2467         data from SecurityPermissionAttribute to PermisionSet class.
2468
2469         * class.cs (ApplyAttributeBuilder): Added special handling
2470         for System.Security.Permissions.SecurityAttribute based types.
2471
2472         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
2473         special handling for System.Security.Permissions.SecurityAttribute
2474         based types.
2475
2476         * enum.cs (ApplyAttributeBuilder): Added special handling
2477         for System.Security.Permissions.SecurityAttribute based types.
2478
2479         * parameter.cs (ApplyAttributeBuilder): Added special handling
2480         for System.Security.Permissions.SecurityAttribute based types.
2481
2482         * rootcontext.cs: Next 2 core types.
2483
2484         * typemanager.cs (TypeManager.security_permission_attr_type):
2485         Built in type for the SecurityPermission Attribute.
2486         (code_access_permission_type): Build in type.
2487
2488 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
2489
2490         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
2491         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
2492         all of this information into
2493         EmitContext.EmitCapturedVariableInstance.
2494         
2495         * codegen.cs (EmitCapturedVariableInstance): move here the
2496         funcionality of emitting an ldarg.0 in the presence of a
2497         remapping.   This centralizes the instance emit code.
2498
2499         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
2500         then emit a load of this: it means that we have reached the
2501         topmost ScopeInfo: the one that contains the pointer to the
2502         instance of the class hosting the anonymous method.
2503
2504         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
2505         captures to the topmost CaptureContext.
2506
2507 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
2508
2509         * expression.cs (LocalVariableReference): Move the knowledge about
2510         the iterators into codegen's EmitCapturedVariableInstance.
2511
2512 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
2513
2514         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
2515         all code paths return a value from an anonymous method (it is the
2516         same as the 161 error, but for anonymous methods).
2517
2518 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
2519
2520         The introduction of anonymous methods in the compiler changed
2521         various ways of doing things in the compiler.  The most
2522         significant one is the hard split between the resolution phase
2523         and the emission phases of the compiler.
2524
2525         For instance, routines that referenced local variables no
2526         longer can safely create temporary variables during the
2527         resolution phase: they must do so from the emission phase,
2528         since the variable might have been "captured", hence access to
2529         it can not be done with the local-variable operations from the runtime.
2530         
2531         * statement.cs 
2532
2533         (Block.Flags): New flag `IsTopLevel' to indicate that this block
2534         is a toplevel block.
2535
2536         (ToplevelBlock): A new kind of Block, these are the blocks that
2537         are created by the parser for all toplevel method bodies.  These
2538         include methods, accessors and anonymous methods.
2539
2540         These contain some extra information not found in regular blocks:
2541         A pointer to an optional CaptureContext (for tracking captured
2542         local variables and parameters).  A pointer to the parent
2543         ToplevelBlock.
2544         
2545         (Return.Resolve): Catch missmatches when returning a value from an
2546         anonymous method (error 1662).
2547         Invoke NeedReturnLabel from the Resolve phase instead of the emit
2548         phase.
2549
2550         (Break.Resolve): ditto.
2551
2552         (SwitchLabel): instead of defining the labels during the
2553         resolution phase, we now turned the public ILLabel and ILLabelCode
2554         labels into methods called GetILLabelCode() and GetILLabel() that
2555         only define the label during the Emit phase.
2556
2557         (GotoCase): Track the SwitchLabel instead of the computed label
2558         (its contained therein).  Emit the code by using
2559         SwitchLabel.GetILLabelCode ().
2560
2561         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2562         whether the Local has been captured or not.
2563
2564         (LocalInfo.IsCaptured): New property, used to tell whether the
2565         local has been captured.
2566         
2567         * anonymous.cs: Vastly updated to contain the anonymous method
2568         support.
2569
2570         The main classes here are: CaptureContext which tracks any
2571         captured information for a toplevel block and ScopeInfo used to
2572         track the activation frames for various local variables.   
2573
2574         Each toplevel block has an optional capture context associated
2575         with it.  When a method contains an anonymous method both the
2576         toplevel method and the anonymous method will create a capture
2577         context.   When variables or parameters are captured, they are
2578         recorded on the CaptureContext that owns them, for example:
2579
2580         void Demo () {
2581              int a;
2582              MyDelegate d = delegate {
2583                  a = 1;
2584              }
2585         }
2586
2587         Here `a' will be recorded as captured on the toplevel
2588         CapturedContext, the inner captured context will not have anything
2589         (it will only have data if local variables or parameters from it
2590         are captured in a nested anonymous method.
2591
2592         The ScopeInfo is used to track the activation frames for local
2593         variables, for example:
2594
2595         for (int i = 0; i < 10; i++)
2596                 for (int j = 0; j < 10; j++){
2597                    MyDelegate d = delegate {
2598                         call (i, j);
2599                    }
2600                 }
2601
2602         At runtime this captures a single captured variable `i', but it
2603         captures 10 different versions of the variable `j'.  The variable
2604         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2605         recorded on a child.  
2606
2607         The toplevel ScopeInfo will also track information like the `this'
2608         pointer if instance variables were referenced (this is necessary
2609         as the anonymous method lives inside a nested class in the host
2610         type of the method). 
2611
2612         (AnonymousMethod): Expanded to track the Toplevel, implement
2613         `AnonymousMethod.Compatible' to tell whether an anonymous method
2614         can be converted to a target delegate type. 
2615
2616         The routine now also produces the anonymous method content
2617
2618         (AnonymousDelegate): A helper class that derives from
2619         DelegateCreation, this is used to generate the code necessary to
2620         produce the delegate for the anonymous method that was created. 
2621
2622         * assign.cs: API adjustments for new changes in
2623         Convert.ImplicitStandardConversionExists.
2624
2625         * class.cs: Adjustments to cope with the fact that now toplevel
2626         blocks are of type `ToplevelBlock'. 
2627
2628         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2629         insteda of standard blocks.
2630
2631         Flag errors if params arguments are passed to anonymous methods.
2632
2633         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2634         `CurrentAnonymousMethod' which points to the current Anonymous
2635         Method.  The variable points to the AnonymousMethod class that
2636         holds the code being compiled.  It is set in the new EmitContext
2637         created for the anonymous method.
2638
2639         (EmitContext.Phase): Introduce a variable and an enumeration to
2640         assist in enforcing some rules about when and where we are allowed
2641         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2642         only one that enfonces this right now).
2643
2644         (EmitContext.HaveCaptureInfo): new helper method that returns
2645         whether we have a CapturedContext initialized.
2646
2647         (EmitContext.CaptureVariable): New method used to register that a
2648         LocalInfo must be flagged for capturing. 
2649
2650         (EmitContext.CapturedParameter): New method used to register that a
2651         parameters must be flagged for capturing. 
2652         
2653         (EmitContext.CapturedField): New method used to register that a
2654         field must be flagged for capturing. 
2655
2656         (EmitContext.HaveCapturedVariables,
2657         EmitContext.HaveCapturedFields): Return whether there are captured
2658         variables or fields. 
2659
2660         (EmitContext.EmitMethodHostInstance): This is used to emit the
2661         instance for the anonymous method.  The instance might be null
2662         (static methods), this (for anonymous methods that capture nothing
2663         and happen to live side-by-side with the current method body) or a
2664         more complicated expression if the method has a CaptureContext.
2665
2666         (EmitContext.EmitTopBlock): Routine that drives the emission of
2667         code: it will first resolve the top block, then emit any metadata
2668         and then emit the code.  The split is done so that we can extract
2669         any anonymous methods and flag any captured variables/parameters.
2670         
2671         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2672         during this phase, the ILGenerator should not be used as labels
2673         and local variables declared here might not be accessible to any
2674         code that is part of an anonymous method.  
2675
2676         Exceptions to this include the temporary variables that are
2677         created by some statements internally for holding temporary
2678         variables. 
2679         
2680         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2681         metadata for a cb
2682
2683         (EmitContext.TemporaryReturn): This method is typically called
2684         from the Emit phase, and its the only place where we allow the
2685         ReturnLabel to be defined other than the EmitMeta.  The reason is
2686         that otherwise we would have to duplicate a lot of logic in the
2687         Resolve phases of various methods that today is on the Emit
2688         phase. 
2689
2690         (EmitContext.NeedReturnLabel): This no longer creates the label,
2691         as the ILGenerator is not valid during the resolve phase.
2692
2693         (EmitContext.EmitThis): Extended the knowledge in this class to
2694         work in anonymous methods in addition to iterators. 
2695
2696         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2697         code is necessary on the stack to access the instance to a local
2698         variable (the variable will be accessed as a field).
2699
2700         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2701         EmitContext.EmitAddressOfParameter): Routines to support
2702         parameters (not completed at this point). 
2703         
2704         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2705         will also remove the parameters.
2706
2707         * convert.cs (Convert): Define a `ConstantEC' which points to a
2708         null.  This is just to prefity some code that uses
2709         ImplicitStandardConversion code and do not have an EmitContext
2710         handy.
2711
2712         The idea is to flag explicitly that at that point in time, it is
2713         known that the conversion will not trigger the delegate checking
2714         code in implicit conversions (which requires a valid
2715         EmitContext). 
2716
2717         Everywhere: pass new EmitContext parameter since
2718         ImplicitStandardConversionExists now requires it to check for
2719         anonymous method conversions. 
2720
2721         (Convert.ImplicitStandardConversionExists): If the type of an
2722         expression is the anonymous_method_type, and the type is a
2723         delegate, we invoke the AnonymousMethod.Compatible method to check
2724         whether an implicit conversion is possible. 
2725
2726         (Convert.ImplicitConversionStandard): Only do implicit method
2727         group conversions if the language level is not ISO_1.
2728
2729         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2730         MethodInfo for the Invoke method.  used by Delegate and
2731         AnonymousDelegate.
2732
2733         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2734         method conversions if the target type is a delegate.
2735
2736         Removed extra debugging nops.
2737
2738         (LocalVariableReference): Turn the `local_info' into a public
2739         field. 
2740
2741         Add `prepared' field, the same hack used for FieldExprs to cope
2742         with composed assignments, as Local variables do not necessarily
2743         operate purely on the stack as they used to: they can be captured
2744         fields. 
2745
2746         Add `temp' for a temporary result, like fields.
2747
2748         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2749
2750         It now copes with Local variables that are captured and emits the
2751         proper instance variable to load it from a field in the captured
2752         case. 
2753
2754         (ParameterReference.DoResolveBase): During the resolve phase,
2755         capture parameters if we are in an anonymous method.
2756
2757         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2758         anonymous method, use the EmitContext helper routines to emit the
2759         parameter reference.
2760
2761         * iterators.cs: Set RemapToProxy to true/false during the
2762         EmitDispose class.
2763
2764         * parameters.cs (GetParameterByName): New helper method. 
2765
2766         * typemanager.cs (anonymous_method_type) a new type that
2767         represents an anonyous method.  This is always an internal type,
2768         used as a fencepost to test against the anonymous-methodness of an
2769         expression. 
2770         
2771 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2772
2773         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2774         561 report.
2775         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2776
2777 2004-10-18  Martin Baulig  <martin@ximian.com>
2778
2779         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2780         `Type' directly, but call ResolveType() on it.
2781         (Catch.Resolve): Likewise.
2782         (Foreach.Resolve): Likewise.
2783
2784 2004-10-18  Martin Baulig  <martin@ximian.com>
2785
2786         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2787         `Type' directly, but call ResolveType() on it.
2788         (Probe.DoResolve): Likewise.
2789         (ArrayCreation.LookupType): Likewise.
2790         (TypeOf.DoResolve): Likewise.
2791         (SizeOf.DoResolve): Likewise.
2792
2793 2004-10-18  Martin Baulig  <martin@ximian.com>
2794
2795         * expression.cs (Invocation.BetterFunction): Put back
2796         TypeManager.TypeToCoreType().
2797
2798 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2799
2800         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2801         the ResolveType.
2802
2803 2004-10-18  Martin Baulig  <martin@ximian.com>
2804
2805         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
2806         `Type' directly, but call ResolveType() on it.
2807
2808 2004-10-18  Martin Baulig  <martin@ximian.com>
2809
2810         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2811         `Type' directly, but call ResolveType() on it.
2812         (MemberBase.DoDefine): Likewise.
2813
2814         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2815         `Type' directly, but call ResolveType() on it.
2816         (ComposedCast.DoResolveAsTypeStep): Likewise.
2817
2818         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2819         `Type' directly, but call ResolveType() on it.
2820
2821 2004-10-17  John Luke  <john.luke@gmail.com>
2822
2823         * class.cs (Operator.GetSignatureForError): use CSharpName
2824
2825         * parameter.cs (Parameter.GetSignatureForError): Returns
2826         correct name even if was not defined.
2827
2828 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2829
2830         Fix #65816.
2831         * class.cs (TypeContainer.EmitContext): New property.
2832         (DefineNestedTypes): Create an emitcontext for each part.
2833         (MethodCore.DoDefineParameters): Use container's emitcontext.
2834         Pass type array to InternalParameters.
2835         (MemberBase.DoDefine): Use container's emitcontext.
2836         (FieldMember.Define): Likewise.
2837         (Event.Define): Likewise.
2838         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2839         Pass type array to InternalParameters.
2840         (SetIndexerMethod.GetParameterInfo): Likewise.
2841         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2842         * delegate.cs (Define): Pass emitcontext to
2843         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2844         array to InternalParameters.
2845         * expression.cs (ParameterReference.DoResolveBase): Pass
2846         emitcontext to GetParameterInfo.
2847         (ComposedCast.DoResolveAsTypeStep): Remove check on
2848         ec.ResolvingTypeTree.
2849         * parameter.cs (Parameter.Resolve): Change argument to
2850         EmitContext.  Use ResolveAsTypeTerminal.
2851         (Parameter.GetSignature): Change argument to EmitContext.
2852         (Parameters.ComputeSignature): Likewise.
2853         (Parameters.ComputeParameterTypes): Likewise.
2854         (Parameters.GetParameterInfo): Likewise.
2855         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2856         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2857         * support.cs (InternalParameters..ctor): Remove variant that takes
2858         a DeclSpace.
2859         * typemanager.cs (system_intptr_expr): New.
2860         (InitExpressionTypes): Initialize it.
2861
2862 2004-10-12  Chris Toshok  <toshok@ximian.com>
2863
2864         * cs-parser.jay: fix location for try_statement and catch_clause.
2865
2866 2004-10-11  Martin Baulig  <martin@ximian.com>
2867
2868         * report.cs: Don't make --fatal abort on warnings, we have
2869         -warnaserror for that.
2870
2871 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2872
2873         More DeclSpace.ResolveType avoidance.
2874         * decl.cs (MemberCore.InUnsafe): New property.
2875         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2876         with newly created EmitContext.
2877         (FieldMember.Define): Likewise.
2878         * delegate.cs (Delegate.Define): Likewise.
2879         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2880         only if normal name-lookup fails.
2881         (TypeExpr.DoResolve): Enable error-checking.
2882         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2883         (SizeOf.DoResolve): Likewise.
2884         (ComposedCast.DoResolveAsTypeStep): Likewise.
2885         (StackAlloc.DoResolve): Likewise.
2886         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2887         (Block.Unsafe): New property.
2888         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2889         (Unsafe): Set 'unsafe' flag of contained block.
2890         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2891         (Fixed.Resolve): Likewise.
2892         (Catch.Resolve): Likewise.
2893         (Using.ResolveLocalVariableDecls): Likewise.
2894         (Foreach.Resolve): Likewise.
2895
2896 2004-10-05  John Luke <john.luke@gmail.com>
2897
2898         * cs-parser.jay: add location to error CS0175
2899
2900 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2901
2902         * ecore.cs (Expression.Constantity): Add support for turning null
2903         into a constant.
2904
2905         * const.cs (Const.Define): Allow constants to be reference types
2906         as long as the value is Null.
2907
2908 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2909
2910         * namespace.cs (NamespaceEntry.Using): No matter which warning
2911         level is set, check if this namespace name has already been added.
2912
2913 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2914
2915         * expression.cs: reftype [!=]= null should always use br[true,false].
2916         # 67410
2917
2918 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2919
2920         Fix #67108
2921         * attribute.cs: Enum conversion moved to 
2922         GetAttributeArgumentExpression to be applied to the all
2923         expressions.
2924
2925 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2926
2927         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2928         * class.c (TypeContainer.DefineType): Flag error if
2929         base types aren't accessible due to access permissions.
2930         * decl.cs (DeclSpace.ResolveType): Move logic to
2931         Expression.ResolveAsTypeTerminal.
2932         (DeclSpace.ResolveTypeExpr): Thin layer over
2933         Expression.ResolveAsTypeTerminal.
2934         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2935         Refactor code into NestedAccess.  Use it.
2936         (DeclSpace.NestedAccess): New.
2937         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2938         argument to silence errors.  Check access permissions.
2939         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2940         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2941         (Cast.DoResolve): Likewise.
2942         (New.DoResolve): Likewise.
2943         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2944         (TypeOf.DoResolve): Likewise.
2945
2946         * expression.cs (Invocation.BetterConversion): Return the Type of
2947         the better conversion.  Implement section 14.4.2.3 more faithfully.
2948         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2949         section 14.4.2.2 explicit.
2950         (Invocation.OverloadResolve): Update.
2951         (Invocation): Remove is_base field.
2952         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2953         (Invocation.Emit): Likewise.
2954
2955 2004-09-27  Raja R Harinath  <rharinath@novell.com>
2956
2957         * README: Update to changes.
2958
2959 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2960
2961         * cs-parser.jay: Reverted 642 warning fix.
2962
2963 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2964
2965         Fix bug #66615
2966         * decl.cs (FindMemberWithSameName): Indexer can have more than
2967         1 argument.
2968
2969 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2970
2971         * expression.cs (LocalVariableReference.DoResolveLValue):
2972         Do not report warning 219 for out values.
2973         (EmptyExpression.Null): New member to avoid extra allocations.
2974
2975 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2976
2977         * cs-parser.jay: Fix wrong warning 642 report.
2978
2979         * cs-tokenizer.cs (CheckNextToken): New helper;
2980         Inspect next character if is same as expected.
2981
2982 2004-09-23  Martin Baulig  <martin@ximian.com>
2983
2984         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2985         (Convert.ImplicitReferenceConversionExists): Likewise.
2986
2987 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2988
2989         * class.cs (Operator.Define): Add error 448 and 559 report.
2990
2991 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2992
2993         * class.cs (MemberBase.IsTypePermitted): New protected
2994         method for checking error CS0610.
2995
2996 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2997
2998         * class.cs (TypeContainer.HasExplicitLayout): New property
2999         Returns whether container has StructLayout attribute set Explicit.
3000         (FieldMember): New abstract class for consts and fields.
3001         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
3002         (Field): Reuse FieldMember.
3003
3004         * const.cs (Const): Reuse FieldMember.
3005
3006         * rootcontext.cs: EmitConstants call moved to class.
3007
3008 2004-09-22  Martin Baulig  <martin@ximian.com>
3009
3010         Thanks to Peter Sestoft for this bug report.
3011
3012         * expression.cs (Conditional): If both the `trueExpr' and the
3013         `falseExpr' is a NullLiteral, return a NullLiteral.
3014
3015 2004-09-22  Martin Baulig  <martin@ximian.com>
3016
3017         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
3018         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
3019         for the "get_Current" call.
3020
3021 2004-09-22  Martin Baulig  <martin@ximian.com>
3022
3023         Marek and me just fixed one of our oldest bugs: #28562 :-)
3024
3025         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
3026
3027         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
3028         we're an EnumConstant, just return that.
3029         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
3030         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
3031         to get the value which'll actually be written into the attribute.
3032         However, we have to use GetValue() to access the attribute's value
3033         in the compiler.        
3034
3035 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3036
3037         * constant.cs (Constant.IsNegative): New abstract property
3038         IsNegative.
3039
3040         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
3041         (StackAlloc.DoResolve): Reused IsNegative.
3042
3043 2004-09-21  Martin Baulig  <martin@ximian.com>
3044
3045         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
3046         if we're used in an iterator, we may be called from different
3047         methods.
3048
3049         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
3050         we actually have an exception block.
3051
3052 2004-09-20  John Luke <jluke@cfl.rr.com>
3053
3054         * class.cs, cs-parser.jay: Improve the error report for 1520:
3055         report the actual line where the error happens, not where the
3056         class was declared.
3057
3058         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
3059         Pass location information that was available elsewhere.
3060
3061 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
3062
3063         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
3064         runtime to delay sign assemblies.
3065
3066 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
3067
3068         * cs-parser.jay: Do not report the stack trace, this is barely
3069         used nowadays.
3070
3071 2004-08-22  John Luke  <john.luke@gmail.com>
3072  
3073         * driver.cs : check that a resource id is not already used
3074         before adding it, report CS1508 if it is, bug #63637
3075
3076 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
3077
3078         * ecore.cs: Removed dead code.
3079
3080 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
3081
3082         * class.cs: Do not report warning CS0067 on the interfaces.
3083
3084 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3085
3086         * cs-parser.jay: Add error 504 report.
3087
3088 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3089
3090         * rootcontext.cs: WarningLevel is 4 by default now.
3091
3092         * statement.cs (Fixed.Resolve): Do not null
3093         VariableInfo.
3094
3095 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3096
3097         Fixed bug #55780
3098         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
3099         deep search when property is not virtual.
3100         (PropertyExpr.ResolveAccessors): Make one call for both
3101         accessors.
3102
3103 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3104
3105         Fixed bug #65766
3106         * statement.cs: Error 152 report constains also location.
3107
3108 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3109
3110         Fixed bug #65766
3111         * const.cs: Explicitly set constant as static.
3112
3113 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3114
3115         Fixed bug #64226
3116         * cs-parser.jay: Add error 1017 report.
3117
3118 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3119
3120         Fixed bug #59980, #64224
3121         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
3122
3123         * typemanager.cs (IsSpecialMethod): Simplified
3124
3125 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3126
3127         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
3128         condition with better params.
3129
3130 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3131
3132         Fixed bug #65238
3133         * attribute.cs (Resolve): Property has to have both
3134         accessors.
3135
3136 2004-09-14  Martin Baulig  <martin@ximian.com>
3137
3138         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
3139
3140 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3141
3142         Fixed bug #61902
3143         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
3144         called and is obsolete then this member suppress message
3145         when call is inside next [Obsolete] method or type.
3146
3147         * expression.cs: Use TestObsoleteMethodUsage member.
3148
3149 2004-09-14  Martin Baulig  <martin@ximian.com>
3150
3151         * cs-parser.jay: Sync a bit with the GMCS version.
3152
3153 2004-09-14  Martin Baulig  <martin@ximian.com>
3154
3155         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
3156         (CSharpParser.yacc_verbose_flag): New public field.
3157
3158         * genericparser.cs: Removed.
3159
3160 2004-09-14  Raja R Harinath  <rharinath@novell.com>
3161
3162         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
3163
3164 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
3165
3166         * class.cs (MethodCore.CheckBase): Fix bug #65757.
3167
3168 2004-09-10  Martin Baulig  <martin@ximian.com>
3169
3170         Backported my MemberName changes from GMCS into MCS.
3171
3172         - we are now using a special `MemberName' class instead of using
3173         strings; in GMCS, the `MemberName' also contains the type
3174         arguments.
3175
3176         - changed the grammar rules a bit:
3177           * the old `member_name' is now a `namespace_or_type_name':
3178             The rule is that we use `namespace_or_type_name' everywhere
3179             where we expect either a "member name" (GetEnumerator) or a
3180             "member name" with an explicit interface name
3181             (IEnumerable.GetEnumerator).
3182             In GMCS, the explicit interface name may include type arguments
3183             (IEnumerable<T>.GetEnumerator).
3184           * we use `member_name' instead of just `IDENTIFIER' for
3185             "member names":
3186             The rule is that we use `member_name' wherever a member may
3187             have type parameters in GMCS.       
3188
3189         * decl.cs (MemberName): New public class.
3190         (MemberCore.MemberName): New public readonly field.
3191         (MemberCore.ctor): Take a `MemberName' argument, not a string.
3192         (DeclSpace): Likewise.
3193
3194         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
3195         * enum.cs (Enum.ctor): Likewise.
3196
3197         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
3198         MemberName.     
3199         (AliasEntry.ctor): Take a MemberName, not an Expression.
3200         (AliasEntry.UsingAlias): Likewise.
3201
3202         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
3203         (IMethodData.MemberName): Changed type from string to MemberName.
3204         (MemberBase.ExplicitInterfaceName): Likewise.
3205         (AbstractPropertyEventMethod.SetupName): Make this private.
3206         (AbstractPropertyEventMethod.ctor): Added `string prefix'
3207         argument; compute the member name here.
3208         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
3209         on the `member.MemberName' and the `prefix'.
3210
3211         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
3212         not `type_name'.
3213         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
3214         thus, we get a `MemberName' instead of a `string'.  These
3215         declarations may have type parameters in GMCS.
3216         (interface_method_declaration, delegate_declaration): Likewise.
3217         (class_declaration, interface_declaration): Likewise.
3218         (method_header): Use `namespace_or_type_name' instead of
3219         `member_name'.  We may be an explicit interface implementation.
3220         (property_declaration, event_declaration): Likewise.
3221         (member_name): This is now just an `IDENTIFIER', not a
3222         `namespace_or_type_name'.
3223         (type_name, interface_type): Removed.
3224         (namespace_or_type_name): Return a MemberName, not an Expression.
3225         (primary_expression): Use `member_name' instead of `IDENTIFIER';
3226         call GetTypeExpression() on the MemberName to get an expression.
3227         (IndexerDeclaration.interface_type): Changed type from string to
3228         MemberName.
3229         (MakeName): Operate on MemberName's instead of string's.
3230
3231 2004-09-13  Raja R Harinath  <rharinath@novell.com>
3232
3233         Fix bug #55770.
3234         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
3235         (NamespaceEntry.Lookup): Add new argument to flag if we want the
3236         lookup to avoid symbols introduced by 'using'.
3237         * rootcontext.cs (NamespaceLookup): Update.
3238
3239 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
3240
3241         * class.cs (TypeContainer.DoDefineMembers): Do not call
3242         DefineDefaultConstructor for static classes.
3243
3244 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
3245
3246         * attribute.cs (Attribute.Resolve): Add error 653 report.
3247
3248         * class.cs (Class.ApplyAttributeBuilder): Add error 641
3249         report.
3250         (Method.ApplyAttributeBuilder): Add error 685 report.
3251         (Operator.Define): Add error 564 report.
3252
3253         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
3254
3255         * expression.cs (Invocation.DoResolve): Add error
3256         245 and 250 report.
3257
3258         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
3259         error 674 report.
3260
3261 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3262
3263         * class.cs (ConstructorInitializer.Resolve):
3264         Wrong error number (515->516).
3265
3266 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3267
3268         * class.cs (Indexer.Define): Add error 631 report.
3269
3270 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3271
3272         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
3273
3274 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3275
3276         * expression.cs (Probe.DoResolve): Add error CS0241 report.
3277
3278 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
3279
3280         * cs-parser.jay: Added error CS0241 report.
3281
3282 2004-09-10  Raja R Harinath  <rharinath@novell.com>
3283
3284         * cs-parser.jay (fixed_statement): Introduce a scope for the
3285         declaration in the 'fixed' statement.
3286
3287 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3288
3289         * cs-parser.jay: Added CS0230 error report.
3290
3291 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3292
3293         * cs-parser.jay: Added errors CS0231 and CS0257 report.
3294
3295 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3296
3297         * expression.cs (Argument.Resolve): Added error CS0192 and
3298         CS0199 report.
3299
3300 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3301
3302         C# 2.0 #pragma warning feature
3303
3304         * cs-tokenizer.cs (PreProcessPragma): New method; 
3305         Handles #pragma directive.
3306
3307         * report.cs (WarningRegions): New class; Support
3308         class for #pragma warning directive. It tests whether
3309         warning is enabled for a given line.
3310
3311 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
3312
3313         * const.cs: Add more descriptive error report, tahnks to
3314         Sebastien. 
3315
3316 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
3317
3318         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
3319
3320 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
3321
3322         * expression.cs: Apply patch from Ben: Remove dead code from
3323         ArrayCreation, and remove the TurnintoConstant call in const.cs,
3324         as that code just threw an exception anwyays.
3325
3326         * const.cs: Remove the call to the turnintoconstant, for details
3327         see bug: #63144
3328         
3329         * literal.cs: The type of the null-literal is the null type;  So
3330         we use a placeholder type (literal.cs:System.Null, defined here)
3331         for it.
3332
3333         * expression.cs (Conditional.DoResolve): Remove some old code that
3334         is no longer needed, conversions have been fixed.
3335
3336         (ArrayCreationExpression.DoResolve): Return false if we fail to
3337         resolve the inner expression.
3338
3339 2004-09-07  Raja R Harinath  <rharinath@novell.com>
3340
3341         Fix test-290.cs.
3342         * cs-parser.jay (delegate_declaration): Record a delegate
3343         declaration as a type declaration.
3344         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
3345
3346 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
3347
3348         * parameter.cs: Do not crash if the type can not be resolved. 
3349
3350         * expression.cs: Report errors with unsafe pointers, fixes #64896
3351
3352 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3353
3354         * expression.cs: Pointer arith always needs to do a conv.i
3355         if the operand is a long. fix 65320
3356
3357 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3358
3359         Fixed cs0619-37.cs, cs0619-38.cs
3360
3361         * enum.cs (GetObsoleteAttribute): Removed.
3362
3363         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
3364         on Enum member is double staged. The first is tested member
3365         and then enum.
3366
3367 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3368
3369         Fixed #56986, #63631, #65231
3370
3371         * class.cs: (TypeContainer.AddToMemberContainer): New method,
3372         adds member to name container.
3373         (TypeContainer.AddToTypeContainer): New method, adds type to
3374         name container.
3375         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
3376         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
3377         AddOperator): Simplified by reusing AddToMemberContainer.
3378         (TypeContainer.UserDefinedStaticConstructor): Changed to property
3379         instead of field.
3380         (Method.CheckForDuplications): Fixed implementation to test all
3381         possibilities.
3382         (MemberBase): Detection whether member is explicit interface
3383         implementation is now in constructor.
3384         (MemberBase.UpdateMemberName): Handles IndexerName.
3385         (Accessor): Changed to keep also location information.
3386         (AbstractPropertyEventMethod): Is derived from MemberCore.
3387         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
3388         will be emited or not.
3389         (PropertyBase.AreAccessorsDuplicateImplementation):
3390         Tests whether accessors are not in collision with some method.
3391         (Operator): Is derived from MethodCore to simplify common
3392         operations.
3393
3394         * decl.cs (Flags.TestMethodDuplication): Test for duplication
3395         must be performed.
3396         (DeclSpace.AddToContainer): Adds the member to defined_names
3397         table. It tests for duplications and enclosing name conflicts.
3398
3399         * enum.cs (EnumMember): Clean up to reuse the base structures
3400
3401 2004-09-03  Martin Baulig  <martin@ximian.com>
3402
3403         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3404         into TypeContainer, to make partial classes work again.
3405
3406 2004-09-03  Martin Baulig  <martin@ximian.com>
3407
3408         * rootcontext.cs (RootContext.V2): Removed.
3409
3410 2004-03-23  Martin Baulig  <martin@ximian.com>
3411
3412         * expression.cs (Invocation.OverloadResolve): Added `bool
3413         may_fail' argument and use it instead of the Location.IsNull() hack.
3414
3415 2004-09-03  Martin Baulig  <martin@ximian.com>
3416
3417         Merged latest changes into gmcs.  Please keep this comment in
3418         here, it makes it easier for me to see what changed in MCS since
3419         the last time I merged.
3420
3421 2004-09-03  Raja R Harinath  <rharinath@novell.com>
3422
3423         Fix #61128.
3424         * expression.cs (BetterConversion): Don't allow either conversion 
3425         to be null.  Remove redundant implicit conversion test when 'q ==
3426         null' -- when this function is invoked, we already know that the
3427         implicit conversion exists.
3428         (BetterFunction): Assume that 'best' is non-null.  Remove
3429         redundant reimplementation of IsApplicable when 'best' is null.
3430         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
3431         number of arguments.
3432         (IsAncestralType): Extract from OverloadResolve.
3433         (OverloadResolve): Make robust to the MethodGroupExpr being
3434         unsorted.  Implement all the logic of Section 14.5.5.1, and
3435         support overloading of methods from multiple applicable types.
3436         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
3437
3438         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3439         (RealError, Warning): Append type of report to related symbol.
3440
3441 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
3442
3443         * enum.cs: Fixed CLS-Compliance checks for enum members.
3444         Error tests cs3008-8.cs, cs3014-8.cs
3445
3446 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3447
3448         Fixed bug #62342, #63102
3449         * class.cs: ImplementIndexer uses member.IsExplicitImpl
3450         like ImplementMethod.
3451
3452 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3453
3454         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3455         Fixed bug #65170.
3456
3457 2004-09-02  Martin Baulig  <martin@ximian.com>
3458
3459         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3460         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3461         on the MethodBase.
3462
3463 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3464
3465         C# 2.0 Static classes implemented
3466
3467         * class.cs (TypeContainer): instance_constructors,
3468         initialized_fields, initialized_static_fields,
3469         default_constructor, base_inteface_types are protected to be
3470         accessible from StaticClass.
3471         (TypeContainer.DefineDefaultConstructor): New virtual method
3472         for custom default constructor generating
3473         (StaticClass): New class to handle "Static classes" feature.
3474
3475         * cs-parser.jay: Handle static keyword on class like instance
3476         of StaticClass.
3477
3478         * driver.cs: Added "/langversion" command line switch with two
3479         options (iso-1, default).
3480
3481 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3482
3483         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3484
3485 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3486
3487         * delegate.cs: Style.
3488
3489 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3490
3491         * delegate.cs: Add seperate instance expr field for miguel.
3492
3493 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3494
3495         * PointerArithmetic (Resolve): make sure we are not doing
3496         pointer arith on void*. Also, make sure we are resolved
3497         by not setting eclass until resolve.
3498
3499         All callers: Make sure that PointerArithmetic gets resolved.
3500
3501 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3502
3503         * ArrayCreation (LookupType): If the type does not resolve 
3504         to an array, give an error.
3505
3506 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3507
3508         * statement.cs (Try.Resolve): Fixed bug #64222
3509
3510 2004-08-27  Martin Baulig  <martin@ximian.com>
3511
3512         * class.cs
3513         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3514         crash here.     
3515
3516 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3517
3518         * ecore.cs (Constantify): Get underlying type via
3519         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3520         Windows in special cases.
3521
3522 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3523
3524         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3525         for obtaining also private methods.
3526         (GetRemoveMethod): Used GetRemoveMethod (true)
3527         for obtaining also private methods.
3528
3529 2004-08-24  Martin Baulig  <martin@ximian.com>
3530
3531         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3532         MethodAttributes.HideBySig for operators.
3533
3534 2004-08-23  Martin Baulig  <martin@ximian.com>
3535
3536         Back to the old error reporting system :-)
3537
3538         * report.cs (Message): Removed.
3539         (Report.MessageData, ErrorData, WarningData): Removed.
3540         (Report.Error, Warning): Back to the old system.
3541
3542 2004-08-23  Martin Baulig  <martin@ximian.com>
3543
3544         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3545
3546         * class.cs (TypeContainer.ParentContainer): New public virtual
3547         method; replaces the explicit interface implementation.
3548         (ClassPart.ParentContainer): Override.
3549
3550 2004-08-23  Martin Baulig  <martin@ximian.com>
3551
3552         * statement.cs (Switch): Added support for constant switches; see
3553         #59428 or test-285.cs.
3554
3555 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3556
3557         Fixed bug #62740.
3558         * statement.cs (GetEnumeratorFilter): Removed useless
3559         logic because C# specs is strict. GetEnumerator must be
3560         public.
3561
3562 2004-08-22  Martin Baulig  <martin@ximian.com>
3563
3564         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3565         a switch and may break, reset the barrier.  Fixes #59867.
3566
3567 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3568
3569         CLS-Compliance speed up (~5% for corlib)
3570
3571         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3572         New method. Tests container for CLS-Compliant names
3573
3574         * class.cs (TypeContainer.VerifyClsName): New method.
3575         Checks whether container name is CLS Compliant.
3576         (Constructor): Implements IMethodData.
3577
3578         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3579         low-case table for CLS Compliance test.
3580         (MemberCache.VerifyClsParameterConflict): New method.
3581         Checks method parameters for CS3006 error.
3582
3583         * enum.cs (EnumMember): Is derived from MemberCore.
3584         (Enum.VerifyClsName): Optimized for better performance.
3585
3586 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3587
3588         * report.cs: Renamed Error_T to Error and changed all
3589         references.
3590
3591 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3592
3593         * class.cs (TypeContainer.IndexerArrayList): New inner class
3594         container for indexers.
3595         (TypeContainer.DefaultIndexerName): New constant for default
3596         indexer name. Replaced all "Item" with this constant.
3597         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3598
3599         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3600         DefaultMemberAttribute constructor.
3601
3602 2004-08-05  Martin Baulig  <martin@ximian.com>
3603
3604         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3605         Fix bug #59429.
3606
3607 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3608
3609         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3610         multi platforms problem.
3611
3612         * compiler.csproj: Included shared files.
3613
3614 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3615
3616         Fix bug 60333, 55971 in the more general way
3617         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3618         Added arg_type argument for constant conversion.
3619         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3620
3621 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3622
3623         Fix bug #59760
3624         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3625         OperatorArrayList, MethodCoreArrayList for typecontainer
3626         containers. Changed class member types to these new types.
3627         (MethodArrayList.DefineMembers): Added test for CS0659.
3628
3629 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3630
3631         * cfold.cs: Synchronize the folding with the code in expression.cs
3632         Binary.DoNumericPromotions for uint operands.
3633
3634         * attribute.cs: Revert patch from Raja, it introduced a regression
3635         while building Blam-1.2.1 (hard to isolate a test case).
3636
3637 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3638
3639         Fix for #55382
3640         * class.cs:
3641         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3642         name collision.
3643         (MethodCore.parent_method): New member. The method we're overriding
3644         if this is an override method.
3645         (MethodCore.CheckBase): Moved from Method class and made common.
3646         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3647         private.
3648         (MethodCore.CheckForDuplications): New abstract method. For custom
3649         member duplication search in a container
3650         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3651         method and its return type.
3652         (Event.conflict_symbol): New member. Symbol with same name in the
3653         parent class.
3654
3655         * decl.cs:
3656         (MemberCache.FindMemberWithSameName): New method. The method
3657         is looking for conflict with inherited symbols.
3658
3659 2004-08-04  Martin Baulig  <martin@ximian.com>
3660
3661         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3662
3663         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3664
3665 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3666
3667         * report.cs (Message): New enum for better error, warning reference in
3668         the code.
3669         (MessageData): New inner abstract class. It generally handles printing of
3670         error and warning messages.
3671         Removed unused Error, Warning, Message methods.
3672
3673 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3674
3675         Fix for cs0592-8.cs test
3676         * attribute.cs
3677         (Attributable.ValidAttributeTargets): Made public.
3678         (Attribute.ExplicitTarget): New member for explicit target value.
3679         (Attribute.CheckTargets): Now we translate explicit attribute
3680         target to Target here.
3681
3682 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3683
3684         * ecore.cs (MethodGroupExpr): new IsBase property.
3685
3686         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3687
3688         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3689         rather than an instance expr.
3690
3691         (DelegateCreation.Emit): Use the method group rather than
3692         the instance expression. Also, if you have base.Foo as the
3693         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3694
3695         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3696
3697         (NewDelegate.DoResolve): Only check for the existance of Invoke
3698         if the method is going to be needed. Use MethodGroupExpr.
3699
3700         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3701
3702         * expression.cs: For pointer arith., make sure to use
3703         the size of the type, not the size of the pointer to
3704         the type.
3705
3706 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3707
3708         Fix for #60722
3709         * class.cs (Class): Added error CS0502 test.
3710
3711 2004-08-03  John Luke  <jluke@cfl.rr.com>
3712             Raja R Harinath  <rharinath@novell.com>
3713
3714         Fix for #60997.
3715         * attribute.cs (Attribute.complained_before): New flag.
3716         (Attribute.ResolveType, Attribute.Resolve),
3717         (Attribute.DefinePInvokeMethod): Set it.
3718         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3719         
3720 2004-08-03  Martin Baulig  <martin@ximian.com>
3721
3722         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3723         use a user-defined operator; we still need to do numeric
3724         promotions in case one argument is a builtin type and the other
3725         one has an implicit conversion to that type.  Fixes #62322.
3726
3727 2004-08-02  Martin Baulig  <martin@ximian.com>
3728
3729         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3730         (LocalInfo.IsThis): New public property.
3731         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3732
3733 2004-08-01  Martin Baulig  <martin@ximian.com>
3734
3735         * class.cs (TypeContainer.GetClassBases): Don't set the default
3736         here since we may get called from GetPartialBases().
3737         (TypeContainer.DefineType): If GetClassBases() didn't return a
3738         parent, use the default one.
3739
3740 2004-07-30  Duncan Mak  <duncan@ximian.com>
3741
3742         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
3743
3744 2004-07-30  Martin Baulig  <martin@ximian.com>
3745
3746         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3747
3748         * class.cs (SourceMethod): New public class, derive from the
3749         symbol writer's ISourceMethod.
3750         (Method): Use the new symbol writer API.
3751
3752         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3753         as argument and use the new symbol writer.
3754
3755         * location.cs
3756         (SourceFile): Implement the symbol writer's ISourceFile.
3757         (Location.SymbolDocument): Removed.
3758         (Location.SourceFile): New public property.
3759
3760         * symbolwriter.cs: Use the new symbol writer API.
3761
3762 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3763
3764         * Makefile (install-local): Remove.  Functionality moved to
3765         executable.make.
3766
3767 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3768
3769         * Makefile: Install mcs.exe.config file together with mcs.exe.
3770         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3771         correct runtime version.
3772         
3773 2004-07-25  Martin Baulig  <martin@ximian.com>
3774
3775         * class.cs
3776         (TypeContainer.RegisterOrder): Removed, this was unused.
3777         (TypeContainer, interface_order): Removed.
3778         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3779         TypeContainer as argument since we can also be called with a
3780         `PartialContainer' for a partial class/struct/interface.
3781         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3782         of checking whether we're an `Interface' - we could be a
3783         `PartialContainer'.
3784         (PartialContainer.Register): Override; call
3785         AddClass()/AddStruct()/AddInterface() on our parent.
3786
3787         * cs-parser.jay (interface_member_declaration): Add things to the
3788         `current_container', not the `current_class'.
3789
3790         * rootcontext.cs (RegisterOrder): The overloaded version which
3791         takes an `Interface' was unused, removed.
3792
3793         * typemanager.cs (TypeManager.LookupInterface): Return a
3794         `TypeContainer', not an `Interface'.
3795         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3796         contain a `PartialContainer' for an interface, so check it's
3797         `Kind' to figure out what it is.
3798
3799 2004-07-25  Martin Baulig  <martin@ximian.com>
3800
3801         * class.cs (Class.DefaultTypeAttributes): New public constant.
3802         (Struct.DefaultTypeAttributes): Likewise.
3803         (Interface.DefaultTypeAttributes): Likewise.
3804         (PartialContainer.TypeAttr): Override this and add the
3805         DefaultTypeAttributes.
3806
3807 2004-07-25  Martin Baulig  <martin@ximian.com>
3808
3809         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3810         we can just use the `Parent' field instead.
3811
3812 2004-07-25  Martin Baulig  <martin@ximian.com>
3813
3814         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3815
3816 2004-07-25  Martin Baulig  <martin@ximian.com>
3817
3818         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3819         our parts before defining any methods.
3820         (TypeContainer.VerifyImplements): Make this virtual.
3821         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3822         on our PartialContainer.
3823
3824 2004-07-25  Martin Baulig  <martin@ximian.com>
3825
3826         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3827
3828         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3829         argument, we can just use the `Parent' field instead.
3830
3831         * class.cs
3832         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3833         (MemberBase.DoDefine): Likewise.
3834
3835 2004-07-24  Martin Baulig  <martin@ximian.com>
3836
3837         * decl.cs (MemberCore.Parent): New public field.
3838         (DeclSpace.Parent): Moved to MemberCore.
3839
3840         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3841         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3842         parent's .ctor.
3843         (FieldBase, Field, Operator): Likewise.
3844         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3845         (EventField, Event): Likewise.
3846
3847 2004-07-23  Martin Baulig  <martin@ximian.com>
3848
3849         * class.cs (PartialContainer): New public class.
3850         (ClassPart): New public class.
3851         (TypeContainer): Added support for partial classes.
3852         (TypeContainer.GetClassBases): Splitted some of the functionality
3853         out into GetNormalBases() and GetPartialBases().
3854
3855         * cs-tokenizer.cs (Token.PARTIAL): New token.
3856         (Tokenizer.consume_identifier): Added some hacks to recognize
3857         `partial', but only if it's immediately followed by `class',
3858         `struct' or `interface'.
3859
3860         * cs-parser.jay: Added support for partial clases.
3861
3862 2004-07-23  Martin Baulig  <martin@ximian.com>
3863
3864         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3865         a `DeclSpace' and also made it readonly.
3866         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3867         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3868         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3869
3870         * cs-parser.jay: Pass the `current_class', not the
3871         `current_container' (at the moment, this is still the same thing)
3872         to a new Method, Property, Event, Indexer or Constructor.
3873
3874 2004-07-23  Martin Baulig  <martin@ximian.com>
3875
3876         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3877         and removed the `current_interface' one.
3878         (struct_declaration, class_declaration, interface_declaration):
3879         Set `current_class' to the newly created class/struct/interface;
3880         set their `Bases' and call Register() before parsing their body.
3881
3882 2004-07-23  Martin Baulig  <martin@ximian.com>
3883
3884         * class.cs (Kind): New public enum.
3885         (TypeContainer): Made this class abstract.
3886         (TypeContainer.Kind): New public readonly field.
3887         (TypeContainer.CheckDef): New public method; moved here from
3888         cs-parser.jay.
3889         (TypeContainer.Register): New public abstract method.
3890         (TypeContainer.GetPendingImplementations): New public abstract
3891         method.
3892         (TypeContainer.GetClassBases): Removed the `is_class' and
3893         `is_iface' parameters.
3894         (TypeContainer.DefineNestedTypes): Formerly known as
3895         DoDefineType().
3896         (ClassOrStruct): Made this class abstract.
3897
3898         * tree.cs (RootTypes): New public type. 
3899
3900 2004-07-20  Martin Baulig  <martin@ximian.com>
3901
3902         * tree.cs (Tree.RecordNamespace): Removed.
3903         (Tree.Namespaces): Removed.
3904
3905         * rootcontext.cs (RootContext.IsNamespace): Removed.
3906
3907         * cs-parser.jay (namespace_declaration): Just create a new
3908         NamespaceEntry here.
3909
3910 2004-07-20  Martin Baulig  <martin@ximian.com>
3911
3912         * statement.cs (ExceptionStatement): New abstract class.  This is
3913         now used as a base class for everyone who's using `finally'.
3914         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
3915         our local variables before using them.
3916
3917         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
3918         virtual method.  This is used by Yield.Resolve() to "steal" an
3919         outer block's `finally' clauses.
3920         (FlowBranchingException): The .ctor now takes an ExceptionStatement
3921         argument.
3922
3923         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
3924         version which takes an ExceptionStatement.  This version must be
3925         used to create exception branchings.
3926
3927         * iterator.cs
3928         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
3929         (Iterator.EmitMoveNext): Added exception support; protect the
3930         block with a `fault' clause, properly handle 'finally' clauses.
3931         (Iterator.EmitDispose): Run all the `finally' clauses here.
3932
3933 2004-07-20  Martin Baulig  <martin@ximian.com>
3934
3935         * iterator.cs: This is the first of a set of changes in the
3936         iterator code.  Match the spec more closely: if we're an
3937         IEnumerable, then GetEnumerator() must be called.  The first time
3938         GetEnumerator() is called, it returns the current instance; all
3939         subsequent invocations (if any) must create a copy.
3940
3941 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
3942
3943         * expression.cs: Resolve the constant expression before returning
3944         it. 
3945
3946 2004-07-19  Martin Baulig  <martin@ximian.com>
3947
3948         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
3949         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
3950         the return type of the new EmitContext.
3951
3952 2004-07-18  Martin Baulig  <martin@ximian.com>
3953
3954         * class.cs (Property.Define): Fix iterators.
3955
3956         * iterators.cs (Iterator.Define): Moved the
3957         `container.AddInterator (this)' call here from the .ctor; only do
3958         it if we resolved successfully.
3959
3960 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
3961
3962         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
3963         `true' for preprocessing directives that we parse.  The return
3964         value indicates whether we should return to regular tokenizing or
3965         not, not whether it was parsed successfully.
3966
3967         In the past if we were in: #if false ... #line #endif, we would
3968         resume parsing after `#line'.  See bug 61604.
3969
3970         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
3971         building: IsEnumType should return true only for enums, not for
3972         enums or System.Enum itself.  This fixes #61593.
3973
3974         Likely what happened is that corlib was wrong: mcs depended on
3975         this bug in some places.  The bug got fixed, we had to add the
3976         hack, which caused bug 61593.
3977
3978         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
3979         that was a workaround for the older conditions.
3980
3981 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
3982
3983         * assign.cs: IAssignMethod has a new interface, as documented
3984         inline. All assignment code now uses this new api.
3985
3986         * ecore.cs, expression.cs: All classes which implement
3987         IAssignMethod now use the new interface.
3988
3989         * expression.cs (Invocation): add a hack to EmitCall so that
3990         IndexerAccess can be the target of a compound assignment without
3991         evaluating its arguments twice.
3992
3993         * statement.cs: Handle changes in Invocation api.
3994
3995 2004-07-16  Martin Baulig  <martin@ximian.com>
3996
3997         * iterators.cs: Rewrote this.  We're now using one single Proxy
3998         class for both the IEnumerable and the IEnumerator interface and
3999         `Iterator' derives from Class so we can use the high-level API.
4000
4001         * class.cs (TypeContainer.AddIterator): New method.
4002         (TypeContainer.DoDefineType): New protected virtual method, which
4003         is called from DefineType().
4004         (TypeContainer.DoDefineMembers): Call DefineType() and
4005         DefineMembers() on all our iterators.
4006         (TypeContainer.Emit): Call Emit() on all our iterators.
4007         (TypeContainer.CloseType): Call CloseType() on all our iterators.
4008
4009         * codegen.cs (EmitContext.CurrentIterator): New public field.
4010
4011 2004-07-15  Martin Baulig  <martin@ximian.com>
4012
4013         * typemanager.cs
4014         (TypeManager.not_supported_exception_type): New type.   
4015
4016 2004-07-14  Martin Baulig  <martin@ximian.com>
4017
4018         * iterators.cs: Use real error numbers.
4019
4020 2004-07-14  Martin Baulig  <martin@ximian.com>
4021
4022         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
4023         requires this to be a System.Collection.IEnumerable and not a
4024         class implementing that interface.
4025         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
4026
4027 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
4028
4029         * class.cs: Fixed previous fix, it broke some error tests.
4030
4031 2004-07-12  Martin Baulig  <martin@ximian.com>
4032
4033         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
4034         Fixes #61293.
4035
4036 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
4037
4038         * assign.cs (LocalTemporary): Add new argument: is_address,If
4039         `is_address' is true, then the value that we store is the address
4040         to the real value, and not the value itself.
4041         
4042         * ecore.cs (PropertyExpr): use the new local temporary
4043         stuff to allow us to handle X.Y += z (where X is a struct)
4044
4045 2004-07-08  Martin Baulig  <martin@ximian.com>
4046
4047         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
4048         not always return, just like we're doing in Using.Resolve().
4049
4050 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
4051
4052         * cs-parser.jay (fixed_statement): flag this as Pinned.
4053
4054 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
4055
4056         * typemanager.cs (TypeManager): Removed MakePinned method, this
4057         mechanism is replaced with the .NET 2.x compatible mechanism of
4058         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
4059
4060         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
4061         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
4062         `IsFixed' property which has a different meaning.
4063
4064 2004-07-02  Raja R Harinath  <rharinath@novell.com>
4065
4066         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
4067         visible from inside a nested class, not just the names of the
4068         immediately enclosing class.
4069         Fix for bug #60730.
4070
4071 2004-06-24  Raja R Harinath  <rharinath@novell.com>
4072
4073         * expression.cs (BetterConversion): Remove buggy special-case
4074         handling of "implicit constant expression conversions".  At this
4075         point, we already know that the conversion is possible -- we're
4076         only checking to see which is better.
4077
4078 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4079
4080         * cs-parser.jay: Added error CS0210 test.
4081
4082 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4083
4084         * cs-parser.jay: Added error CS0134 test.
4085
4086 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4087
4088         Fix bug #52507
4089         * cs-parser.jay: Added error CS0145 test.
4090
4091 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4092
4093         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
4094
4095 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
4096         
4097         * expression.cs (StackAlloc.Resolve): The argument may not
4098         be a constant; deal with this case.
4099         
4100 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
4101
4102         * attribute.cs (IndexerName_GetIndexerName): Renamed to
4103         GetIndexerAttributeValue.
4104         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
4105
4106         * class.cs (Indexer.Define): Added error tests for CS0415,
4107         CS0609.
4108
4109 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
4110
4111         * attribute.cs (Attribute.Resolve): Keep field code in sync with
4112         property code.
4113
4114 2004-06-23  Martin Baulig  <martin@ximian.com>
4115
4116         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
4117         neither return nor throw, reset the barrier as well.  Fixes #60457.
4118
4119 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
4120
4121         * class.cs : EventAttributes is now set to None by default.
4122           This fixes bug #60459.
4123
4124 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4125
4126         Fix bug #60219
4127         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4128         Don't throw exception but return null (it's sufficient now).
4129
4130 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4131
4132         * typemanager.cs (GetArgumentTypes): Faster implementation.
4133
4134 2004-06-18  Martin Baulig  <martin@ximian.com>
4135
4136         * attribute.cs (Attribute.Resolve): Check whether we're an
4137         EmptyCast which a Constant child.  Fixes #60333.
4138
4139 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
4140
4141         * statement.cs (EmitCollectionForeach): Account for the fact that
4142         not all valuetypes are in areas which we can take the address of.
4143         For these variables, we store to a temporary variable. Also, make
4144         sure that we dont emit a `callvirt' on a valuetype method.
4145
4146 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4147
4148         * expression.cs (StackAlloc.DoReSolve): Added test for
4149         negative parameter (CS0247).
4150
4151 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4152
4153         Fix bug #59792
4154         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
4155
4156 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4157
4158         Fix bug #59781
4159         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
4160         ulong.
4161
4162 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4163
4164         Fix bug #58254 & cs1555.cs, cs1556.cs
4165         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
4166
4167 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4168
4169         * cs-parser.jay: Added error CS1669 test for indexers.
4170
4171 2004-06-11  Martin Baulig  <martin@ximian.com>
4172
4173         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
4174         call this twice: for params and varargs methods.
4175
4176 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4177
4178         * class.cs:
4179         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
4180
4181 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4182
4183         * attribute.cs (Attribute.GetValidTargets): Made public.
4184
4185         * class.cs: 
4186         (AbstractPropertyEventMethod): New class for better code sharing.
4187         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
4188         CS1667 report.
4189         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
4190
4191 2004-06-11  Raja R Harinath  <rharinath@novell.com>
4192
4193         Fix bug #59477.
4194         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
4195         that the call to Resolve is part of a MemberAccess.
4196         (Expression.Resolve): Use it for SimpleName resolution.
4197         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
4198         Add 'intermediate' boolean argument.
4199         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
4200         error message when the SimpleName can be resolved ambiguously
4201         between an expression and a type.
4202         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
4203         public.
4204         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
4205         call on the left-side.
4206
4207 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4208
4209         * class.cs:
4210         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
4211
4212 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4213
4214         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
4215
4216 2004-06-11  Martin Baulig  <martin@ximian.com>
4217
4218         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
4219         varargs methods if applicable.
4220
4221 2004-06-11  Martin Baulig  <martin@ximian.com>
4222
4223         * expression.cs (Invocation.EmitCall): Don't use
4224         `method.CallingConvention == CallingConventions.VarArgs' since the
4225         method could also have `CallingConventions.HasThis'.
4226
4227 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4228
4229         * class.cs (Event.GetSignatureForError): Implemented.
4230         Fixed crash in error test cs3010.cs
4231
4232 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
4233
4234         * cs-tokenizer.cs: Change the way we track __arglist to be
4235         consistent with the other keywords.
4236
4237 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
4238
4239         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
4240         tomorrow.
4241
4242 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
4243
4244         * codegen.cs: Check that all referenced assemblies have a strongname
4245         before strongnaming the compiled assembly. If not report error CS1577.
4246         Fix bug #56563. Patch by Jackson Harper.
4247         * typemanager.cs: Added a method to return all referenced assemblies.
4248         Fix bug #56563. Patch by Jackson Harper.
4249
4250 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
4251
4252         * class.cs:
4253         (Method.ApplyAttributeBuilder): Moved and added conditional
4254         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
4255
4256         * delegate.cs:
4257         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
4258
4259 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
4260
4261         Fixed #59640
4262         * class.cs: (EventField.attribute_targets): Changed default target.
4263
4264 2004-06-08  Martin Baulig  <martin@ximian.com>
4265
4266         * expression.cs (Invocation.EmitCall): Enable varargs methods.
4267
4268 2004-06-08  Martin Baulig  <martin@ximian.com>
4269
4270         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
4271
4272 2004-06-07  Martin Baulig  <martin@ximian.com>
4273
4274         Added support for varargs methods.
4275
4276         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
4277         keyword.
4278
4279         * cs-parser.jay: Added support for `__arglist'.
4280
4281         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
4282
4283         * expression.cs (Argument.AType): Added `ArgList'.
4284         (Invocation): Added support for varargs methods.
4285         (ArglistAccess): New public class.
4286         (Arglist): New public class.
4287
4288         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
4289
4290         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
4291         a method's top-level block if the method has varargs.
4292
4293         * support.cs (ReflectionParameters, InternalParameters): Added
4294         support for varargs methods.    
4295
4296 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
4297
4298         * class.cs: Provide location in indexer error report.
4299
4300         * driver.cs: Use standard names.
4301
4302         * namespace.cs: Catch the use of using after a namespace has been
4303         declared also on using aliases.
4304
4305 2004-06-03  Raja R Harinath  <rharinath@novell.com>
4306
4307         Bug #50820.
4308         * typemanager.cs (closure_private_ok, closure_invocation_type)
4309         (closure_qualifier_type, closure_invocation_assembly)
4310         (FilterWithClosure): Move to ...
4311         (Closure): New internal nested class.
4312         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
4313         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
4314         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
4315         (MemberLookup, MemberLookupFailed): Use it.
4316         * expression.cs (New.DoResolve): Treat the lookup for the
4317         constructor as being qualified by the 'new'ed type.
4318         (Indexers.GetIndexersForTypeOrInterface): Update.
4319
4320 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
4321
4322         * attribute.cs
4323         (GetConditionalAttributeValue): New method. Returns
4324         condition of ConditionalAttribute.
4325         (SearchMulti): New method.  Returns all attributes of type 't'.
4326         Use it when attribute is AllowMultiple = true.
4327         (IsConditionalMethodExcluded): New method.
4328
4329         * class.cs
4330         (Method.IsExcluded): Implemented. Returns true if method has conditional
4331         attribute and the conditions is not defined (method is excluded).
4332         (IMethodData): Extended interface for ConditionalAttribute support.
4333         (PropertyMethod.IsExcluded): Implemented.
4334
4335         * decl.cs
4336         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
4337
4338         * expression.cs
4339         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
4340         on the method.
4341
4342 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4343
4344         * expression.cs (ArrayCreationExpression): Make this just an
4345         `expression'. It can't be a statement, so the code here was
4346         dead.
4347
4348 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
4349
4350         Fixed #59072
4351         * typemanager.cs (GetFullNameSignature): New method for
4352         MethodBase types.
4353
4354 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
4355
4356         Fixed #56452
4357         * class.cs (MemberBase.GetSignatureForError): New virtual method.
4358         Use this method when MethodBuilder is null.
4359         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
4360         Added test for error CS0626 (MONO reports error for this situation).
4361         (IMethodData.GetSignatureForError): Extended interface.
4362
4363 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4364
4365         * attribute.cs
4366         (AttributeTester.GetObsoleteAttribute): Returns instance of
4367         ObsoleteAttribute when type is obsolete.
4368
4369         * class.cs
4370         (TypeContainer.VerifyObsoleteAttribute): Override.
4371         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4372         (MethodCode.VerifyObsoleteAttribute): Override.
4373         (MemberBase.VerifyObsoleteAttribute): Override.
4374
4375         * decl.cs
4376         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4377         and report proper error.
4378
4379         *delegate.cs
4380         Delegate.VerifyObsoleteAttribute): Override.
4381
4382         * ecore.cs
4383         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4384         and report proper error.
4385         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4386
4387         * enum.cs
4388         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4389         and enum member.
4390
4391         * expression.cs
4392         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4393         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4394         Added test for ObsoleteAttribute.
4395
4396         * statement.cs
4397         (Catch): Derived from Statement.
4398
4399 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4400  
4401         Fixed bug #59071 & cs0160.cs
4402  
4403         * statement.cs (Try.Resolve): Check here whether order of catch
4404         clauses matches their dependencies.
4405
4406 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
4407
4408         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
4409         caused a regression: #59343.  Referencing nested classes from an
4410         assembly stopped working.
4411
4412 2004-05-31  Martin Baulig  <martin@ximian.com>
4413
4414         MCS is now frozen for beta 2.
4415
4416 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4417
4418         * convert.cs: add a trivial cache for overload operator resolution.
4419
4420 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4421
4422         * decl.cs: If possible, use lookuptypedirect here. We can only do
4423         this if there is no `.' after the namespace. Avoids using
4424         LookupType, which does lots of slow processing.
4425         (FindNestedType) New method, does what it says :-).
4426         * namespace.cs: use LookupTypeDirect.
4427         * rootcontext.cs: use membercache, if possible.
4428         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4429
4430 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4431
4432         * expression.cs:
4433         According to the spec, 
4434
4435         In a member access of the form E.I, if E is a single identifier,
4436         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4437         field, property, localvariable, or parameter with the same type as
4438         the meaning of E as a type-name (§3.8), then both possible
4439         meanings of E are permitted.
4440
4441         We did not check that E as a simple-name had the same type as E as
4442         a type name.
4443
4444         This trivial check gives us 5-7% on bootstrap time.
4445
4446 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4447
4448         * expression.cs (Invocation.OverloadResolve): Avoid the
4449         use of hashtables and boxing here by allocating on demand.
4450
4451 2004-05-30  Martin Baulig  <martin@ximian.com>
4452
4453         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4454         we're doing a silent lookup.  Don't try to lookup nested types in
4455         TypeManager.object_type (thanks to Ben Maurer).
4456
4457 2004-05-30  Martin Baulig  <martin@ximian.com>
4458
4459         Committing a patch from Ben Maurer.
4460
4461         * rootcontext.cs (RootContext.LookupType): Cache negative results.
4462
4463 2004-05-29  Martin Baulig  <martin@ximian.com>
4464
4465         * class.cs (IMethodData.ShouldIgnore): New method.
4466
4467         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4468         `Location' argument, we don't need it anywhere.  Use
4469         `IMethodData.ShouldIgnore ()' instead of
4470         `MethodData.GetMethodFlags ()'.
4471         (TypeManager.AddMethod): Removed.
4472         (TypeManager.AddMethod2): Renamed to AddMethod.
4473
4474 2004-05-29  Martin Baulig  <martin@ximian.com>
4475
4476         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4477
4478         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4479         converting from a class type S to an interface type and we already
4480         have an object on the stack, don't box it again.  Fixes #52578.
4481
4482 2004-05-29  Martin Baulig  <martin@ximian.com>
4483
4484         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4485         Added support for `params' parameters.  Fixes #59267.
4486
4487 2004-05-29  Martin Baulig  <martin@ximian.com>
4488
4489         * literal.cs (NullPointer): Provide a private .ctor which sets
4490         `type' to TypeManager.object_type.  Fixes #59048.
4491
4492 2004-05-29  Martin Baulig  <martin@ximian.com>
4493
4494         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4495         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4496
4497         * ecore.cs (EventExpr.instance_expr): Make the field private.
4498
4499 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4500
4501         Fixed bug #50080 & cs0214-2.cs
4502         * expression.cs (Cast.DoResolve): Check unsafe context here.
4503         
4504         * statement.cs (Resolve.DoResolve): Likewise.
4505
4506 2004-05-26  Martin Baulig  <martin@ximian.com>
4507
4508         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4509
4510         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4511         (RootContext.LookupType): Pass down the `silent' flag.
4512
4513 2004-05-25  Martin Baulig  <martin@ximian.com>
4514
4515         * expression.cs
4516         (MethodGroupExpr.IdenticalTypeName): New public property.
4517         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4518         expression actually refers to a type.
4519
4520 2004-05-25  Martin Baulig  <martin@ximian.com>
4521
4522         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4523         for #56176 and made it actually work.
4524
4525 2004-05-25  Martin Baulig  <martin@ximian.com>
4526
4527         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4528         (FieldExpr, PropertyExpr): Override and implement
4529         CacheTemporaries.  Fixes #52279.
4530
4531 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4532
4533         * location.cs: In the new compiler listing a file twice is a
4534         warning, not an error.
4535
4536 2004-05-24  Martin Baulig  <martin@ximian.com>
4537
4538         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4539         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4540
4541 2004-05-24  Martin Baulig  <martin@ximian.com>
4542
4543         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4544         walking the `using' list.  Fixes #53921.
4545
4546 2004-05-24  Martin Baulig  <martin@ximian.com>
4547
4548         * const.cs (Const.LookupConstantValue): Added support for
4549         EmptyCast's; fixes #55251.
4550
4551 2004-05-24  Martin Baulig  <martin@ximian.com>
4552
4553         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4554         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4555         which does the CS0135 check.  The reason is that we first need to
4556         check whether the variable actually exists.
4557
4558 2004-05-24  Martin Baulig  <martin@ximian.com>
4559
4560         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4561         than RootContext.LookupType() to find the explicit interface
4562         type.  Fixes #58584.
4563
4564 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4565
4566         * Makefile: Simplify.  Use executable.make.
4567         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4568
4569 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4570
4571         * decl.cs:
4572         * enum.cs:
4573         Use the invariant culture when doing String.Compare for CLS case
4574         sensitivity.
4575         
4576 2004-05-23  Martin Baulig  <martin@ximian.com>
4577
4578         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4579         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4580
4581         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4582         
4583 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4584
4585         * class.cs (MemberBase.Define): Reuse MemberType member for 
4586         resolved type. Other methods can use it too.
4587
4588 2004-05-23  Martin Baulig  <martin@ximian.com>
4589
4590         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4591         the variable also exists in the current block (otherwise, we need
4592         to report a CS0103).  Fixes #58670.
4593
4594 2004-05-23  Martin Baulig  <martin@ximian.com>
4595
4596         * flowanalysis.cs (Reachability.Reachable): Compute this
4597         on-the-fly rather than storing it as a field.
4598
4599 2004-05-23  Martin Baulig  <martin@ximian.com>
4600
4601         * flowanalysis.cs (Reachability.And): Manually compute the
4602         resulting `barrier' from the reachability.      
4603        
4604 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4605
4606         Fix bug #57835
4607         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4608         instance of ObsoleteAttribute when symbol is obsolete.
4609
4610         * class.cs
4611         (IMethodData): Extended interface for ObsoleteAttribute support.
4612
4613 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4614
4615         * attribute.cs: Fix bug #55970
4616
4617 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4618
4619         Fix bug #52705
4620         * attribute.cs
4621         (GetObsoleteAttribute): New method. Creates the instance of
4622         ObsoleteAttribute.
4623         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4624         ObsoleteAttribute when member is obsolete.
4625         (AttributeTester.Report_ObsoleteMessage): Common method for
4626         Obsolete error/warning reporting.
4627
4628         * class.cs
4629         (TypeContainer.base_classs_type): New member for storing parent type.
4630
4631         * decl.cs
4632         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4633         for this MemberCore.
4634
4635 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4636
4637         * attribute.cs, const.cs: Fix bug #58590
4638
4639 2004-05-21  Martin Baulig  <martin@ximian.com>
4640
4641         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4642         out parameters if the end of the method is unreachable.  Fixes
4643         #58098. 
4644
4645 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4646
4647         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4648         Hari was right, why extra method.
4649
4650 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4651
4652         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4653
4654 2004-05-20  Martin Baulig  <martin@ximian.com>
4655
4656         Merged this back from gmcs to keep the differences to a minumum.
4657
4658         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
4659         instead of a Declspace.
4660         (Attribute.ResolveType): Likewise.
4661         (Attributes.Search): Likewise.
4662         (Attributes.Contains): Likewise.
4663         (Attributes.GetClsCompliantAttribute): Likewise.
4664
4665         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
4666         argument.
4667         (MethodData.ApplyAttributes): Take an EmitContext instead of a
4668         DeclSpace.
4669
4670 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4671
4672         Fix bug #58688 (MCS does not report error when the same attribute
4673         is assigned twice)
4674
4675         * attribute.cs (Attribute.Emit): Distinction between null and default.
4676
4677 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4678
4679         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4680         of a top-level attribute without an attribute target.
4681         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4682         Make non-static.
4683         (Attribute.Conditional_GetConditionName), 
4684         (Attribute.Obsolete_GetObsoleteMessage): Update.
4685         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4686         part of ScanForIndexerName.
4687         (Attribute.CanIgnoreInvalidAttribute): New function.
4688         (Attribute.ScanForIndexerName): Move to ...
4689         (Attributes.ScanForIndexerName): ... here.
4690         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4691         (Attributes.Search): New internal variant that can choose not to
4692         complain if types aren't resolved.  The original signature now
4693         complains.
4694         (Attributes.GetClsCompliantAttribute): Use internal variant, with
4695         complaints suppressed.
4696         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4697         only if it not useful.
4698         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4699         top-level for attributes that are shared between the assembly
4700         and a top-level class.
4701         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4702         * class.cs: Update to reflect changes.
4703         (DefineIndexers): Fuse loops.
4704         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4705         a couple more variants of attribute names.
4706
4707 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4708
4709         Fix bug #52585 (Implemented explicit attribute declaration)
4710
4711         * attribute.cs:
4712         (Attributable.ValidAttributeTargets): New abstract method. It gets
4713         list of valid attribute targets for explicit target declaration.
4714         (Attribute.Target): It holds target itself.
4715         (AttributeSection): Removed.
4716         (Attribute.CheckTargets): New method. It checks whether attribute
4717         target is valid for the current element.
4718
4719         * class.cs:
4720         (EventProperty): New class. For events that are declared like
4721         property (with add and remove accessors).
4722         (EventField): New class. For events that are declared like field.
4723         class.cs
4724
4725         * cs-parser.jay: Implemented explicit attribute target declaration.
4726
4727         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4728         Override ValidAttributeTargets.
4729
4730         * parameter.cs:
4731         (ReturnParameter): Class for applying custom attributes on 
4732         the return type.
4733         (ParameterAtribute): New class. Class for applying custom
4734         attributes on the parameter type.
4735
4736 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4737
4738         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4739         definitions. 
4740
4741         (Method): Allow UNSAFE here.
4742
4743         * modifiers.cs: Support unsafe reporting.
4744
4745 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4746
4747         * decl.cs: Fix bug #58478.
4748
4749 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4750
4751         * statement.cs: When checking for unreachable code on an EmptyStatement,
4752         set the location. Fixes bug #58488.
4753
4754 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4755
4756         * driver.cs: Add -pkg handling.
4757
4758         From Gonzalo: UseShelLExecute=false
4759
4760 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4761
4762         * attribute.cs:
4763         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4764         for attribute.
4765         (Attribute.IsClsCompliaceRequired): Moved to base for better
4766         accesibility.
4767         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4768         when attribute is AttributeUsageAttribute.
4769         (Attribute.GetValidTargets): Simplified.
4770         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4771         attribute for this type.
4772         (Attribute.ApplyAttributes): Method renamed to Emit and make
4773         non-static.
4774         (GlobalAttributeSection): New class for special handling of global
4775         attributes (assembly, module).
4776         (AttributeSection.Emit): New method.
4777
4778         * class.cs: Implemented Attributable abstract methods.
4779         (MethodCore.LabelParameters): Moved to Parameter class.
4780         (Accessor): Is back simple class.
4781         (PropertyMethod): Implemented Attributable abstract class.
4782         (DelegateMethod): Implemented Attributable abstract class.
4783         (Event): New constructor for disctintion between normal Event
4784         and Event with accessors.
4785
4786         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4787
4788         * codegen.cs, const.cs, decl.cs, delegate.cs:
4789         (CommonAssemblyModulClass): Implemented Attributable abstract class
4790         and simplified.
4791
4792         * enum.cs: Implement IAttributeSupport interface.
4793         (EnumMember): New class for emum members. Implemented Attributable
4794         abstract class
4795
4796         * parameter.cs:
4797         (ParameterBase): Is abstract.
4798         (ReturnParameter): New class for easier [return:] attribute handling.
4799
4800         * typemanager.cs: Removed builder_to_attr.
4801
4802 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4803
4804         Fix bug #57151.
4805         * attribute.cs (Attribute.GetPositionalValue): New function.
4806         * class.cs (TypeContainer.VerifyMembers): New function.
4807         (TypeContainer.Emit): Use it.
4808         (ClassOrStruct): New base class for Class and Struct.
4809         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4810         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4811         class.
4812         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4813         then each non-static field should have a FieldOffset attribute.
4814         Otherwise, none of the fields should have a FieldOffset attribute.
4815         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4816         and FieldOffset attributes.
4817         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4818         (TypeManager.field_offset_attribute_type): New core types.
4819         (TypeManager.InitCoreTypes): Initialize them.
4820
4821 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4822
4823         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4824         Return correct type.
4825         From bug #58270.
4826
4827 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4828
4829         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4830         be implicitly converted to ulong.
4831         
4832         * expression.cs: The logic for allowing operator &, | and ^ worked
4833         was wrong, it worked before because we did not report an error in
4834         an else branch.  Fixes 57895.
4835
4836         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4837         allow volatile fields to be reference types.
4838
4839 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4840
4841         * driver.cs: Add support for /debug-
4842
4843 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4844
4845         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4846         Add a 'complain' parameter to silence errors.
4847         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4848         silently overlooked type-resolutions.
4849         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4850         to reflect changes.
4851         (Attributes.Search): New function.
4852         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4853         (Attributes.GetAttributeFullName): Remove hack.
4854         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4855         Update to reflect changes.
4856         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4857         Use Attributes.Search instead of nested loops.
4858
4859 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4860
4861         * decl.cs:
4862         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4863         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4864         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4865
4866         * report.cs: (Report.Warning): Renamed to Warning_T because of
4867         parameter collision.
4868
4869 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4870
4871         * expression.cs (MemberAccess.ResolveMemberAccess):
4872         Exit with non-zero status after Report.Error.
4873         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4874         Likewise.
4875         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4876
4877 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4878
4879         * support.cs: Don't hang when the file is empty.
4880
4881 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4882
4883         * support.cs: In SeekableStreamReader, compute the preamble size of the
4884           underlying stream. Position changes should take into account that initial
4885           count of bytes.
4886
4887 2004-05-03  Todd Berman  <tberman@sevenl.net>
4888
4889         * driver.cs: remove unused GetSysVersion function.
4890
4891 2004-05-03  Todd Berman  <tberman@sevenl.net>
4892
4893         * driver.cs: Remove the hack from saturday, as well as the hack
4894         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4895         link_paths to get that bit proper.
4896
4897 2004-05-01  Todd Berman  <tberman@sevenl.net>
4898
4899         * driver.cs: Try a LoadFrom before a Load, this checks the current
4900         path. This is currently a bug in mono that is be fixed, however, this
4901         provides a workaround for now. This will be removed when the bug
4902         is fixed.
4903
4904 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4905
4906         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4907         incomplete key pairs (#57941).
4908
4909 2004-05-01  Todd Berman  <tberman@sevenl.net>
4910
4911         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4912         from the GAC
4913
4914 2004-04-30  Jackson Harper  <jackson@ximian.com>
4915
4916         * codegen.cs: Open keys readonly.
4917         
4918 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4919
4920         * typemanager.cs: don't report cyclic struct layout when a struct
4921         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4922         which has 2 Pango.Rectangle fields.
4923
4924 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4925
4926         * expression.cs: Handle IntPtr comparisons with IL code
4927         rather than a method call.
4928
4929 2004-04-29  Martin Baulig  <martin@ximian.com>
4930
4931         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4932         the list of PropertyInfo's in class hierarchy and find the
4933         accessor.  Fixes #56013.
4934
4935 2004-04-29  Martin Baulig  <martin@ximian.com>
4936
4937         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4938
4939 2004-04-29  Martin Baulig  <martin@ximian.com>
4940
4941         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4942
4943         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4944
4945 2004-04-29  Martin Baulig  <martin@ximian.com>
4946
4947         * class.cs (ConstructorInitializer.Resolve): Check whether the
4948         parent .ctor is accessible.  Fixes #52146.
4949
4950 2004-04-29  Martin Baulig  <martin@ximian.com>
4951
4952         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4953
4954         * statement.cs (Using.EmitLocalVariableDecls): Use
4955         TypeManager.idisposable_type, not typeof (IDisposable).
4956         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4957
4958 2004-04-29  Martin Baulig  <martin@ximian.com>
4959
4960         * class.cs (Event.Define): Don't emit the field and don't set
4961         RTSpecialName and SpecialName for events on interfaces.  Fixes
4962         #57703. 
4963
4964 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4965
4966         Refactor Attribute.ApplyAttributes.
4967         * attribute.cs (Attributable): New base class for objects that can
4968         have Attributes applied on them.
4969         (Attribute): Make AttributeUsage fields public.
4970         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4971         (Attribute.IsInternalCall): New property.
4972         (Attribute.UsageAttr): Convert to a public read-only property.
4973         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4974         (Attribute.ResolveType, Attribute.Resolve)
4975         (Attribute.ScanForIndexerName): Update to reflect changes.
4976         (Attribute.CheckAttributeTarget): Re-format.
4977         (Attribute.ApplyAttributes): Refactor, to various
4978         Attributable.ApplyAttributeBuilder methods.
4979         * decl.cs (MemberCore): Make Attributable.
4980         * class.cs (Accessor): Make Attributable.
4981         (MethodData.ApplyAttributes): Use proper attribute types, not
4982         attribute names.
4983         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4984         (TypeContainer.ApplyAttributeBuilder)
4985         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4986         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4987         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4988         (Operator.ApplyAttributeBuilder): New factored-out methods.
4989         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4990         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4991         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4992         * parameter.cs (ParameterBase): New Attributable base class
4993         that can also represent Return types.
4994         (Parameter): Update to the changes.
4995
4996 2004-04-29  Jackson Harper  <jackson@ximian.com>
4997
4998         * driver.cs: Prefer the corlib system version when looking for
4999         assemblies in the GAC. This is still a hack, but its a better hack
5000         now.
5001         
5002 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
5003
5004         * decl.cs, enum.cs: Improved error 3005 reporting.
5005   
5006         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
5007         (related_symbols): New private member for list of symbols
5008         related to reported error/warning.
5009         
5010         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
5011
5012 2004-04-29  Martin Baulig  <martin@ximian.com>
5013
5014         * ecore.cs (Expression.Constantify): If we're an enum and
5015         TypeManager.TypeToCoreType() doesn't give us another type, use
5016         t.UnderlyingSystemType.  Fixes #56178.  
5017
5018 2004-04-29  Martin Baulig  <martin@ximian.com>
5019
5020         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
5021         interfaces and for each interface, only add members directly
5022         declared in that interface.  Fixes #53255.
5023
5024 2004-04-28  Martin Baulig  <martin@ximian.com>
5025
5026         * expression.cs (ConditionalLogicalOperator): Use a temporary
5027         variable for `left' to avoid that we evaluate it more than once;
5028         bug #52588.
5029
5030 2004-04-28  Martin Baulig  <martin@ximian.com>
5031
5032         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
5033         `void[]' (CS1547).
5034
5035 2004-04-28  Martin Baulig  <martin@ximian.com>
5036
5037         * statement.cs (LocalInfo.Resolve): Check whether the type is not
5038         void (CS1547).
5039
5040         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
5041         whether the type is not void (CS1547).
5042
5043 2004-04-28  Martin Baulig  <martin@ximian.com>
5044
5045         * expression.cs (Unary.DoResolveLValue): Override this and report
5046         CS0131 for anything but Operator.Indirection.
5047
5048 2004-04-28  Martin Baulig  <martin@ximian.com>
5049
5050         Committing a patch from Ben Maurer; see bug #50820.
5051
5052         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5053         check for classes.
5054
5055         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5056         classes.        
5057
5058 2004-04-28  Martin Baulig  <martin@ximian.com>
5059
5060         Committing a patch from Ben Maurer; see bug #50820.
5061
5062         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5063         check for classes.
5064
5065         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5066         classes.        
5067
5068 2004-04-28  Martin Baulig  <martin@ximian.com>
5069
5070         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
5071         (Block.AddLabel): Call DoLookupLabel() to only search in the
5072         current block.
5073
5074 2004-04-28  Martin Baulig  <martin@ximian.com>
5075
5076         * cfold.cs (ConstantFold.BinaryFold): Added special support for
5077         comparing StringConstants and NullLiterals in Equality and Inequality.
5078
5079 2004-04-28  Jackson Harper  <jackson@ximian.com>
5080
5081         * driver.cs: Attempt to load referenced assemblies from the
5082         GAC. This is the quick and dirty version of this method that
5083         doesnt take into account versions and just takes the first
5084         canidate found. Will be good enough for now as we will not have more
5085         then one version installed into the GAC until I update this method.
5086
5087 2004-04-28  Martin Baulig  <martin@ximian.com>
5088
5089         * typemanager.cs (TypeManager.CheckStructCycles): New public
5090         static method to check for cycles in the struct layout.
5091
5092         * rootcontext.cs (RootContext.PopulateTypes): Call
5093         TypeManager.CheckStructCycles() for each TypeContainer.
5094         [Note: We only need to visit each type once.]
5095
5096 2004-04-28  Martin Baulig  <martin@ximian.com>
5097
5098         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
5099
5100         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
5101         success and added `out object value'.  Use a `bool resolved' field
5102         to check whether we've already been called rather than
5103         `ConstantValue != null' since this breaks for NullLiterals.
5104
5105 2004-04-28  Raja R Harinath  <rharinath@novell.com>
5106
5107         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
5108         setting of this flag, since the 'set' method may be non-public.
5109
5110 2004-04-28  Raja R Harinath  <rharinath@novell.com>
5111
5112         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
5113         check on current_vector.Block.
5114
5115 2004-04-27  Martin Baulig  <martin@ximian.com>
5116
5117         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
5118         a field initializer.  Fixes #56459.
5119
5120 2004-04-27  Martin Baulig  <martin@ximian.com>
5121
5122         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
5123         we're not attempting to use an indexer.  Fixes #52154.
5124
5125 2004-04-27  Martin Baulig  <martin@ximian.com>
5126
5127         * statement.cs (Return): Don't create a return label if we don't
5128         need it; reverts my change from January 20th.  Thanks to Ben
5129         Maurer for this.
5130
5131 2004-04-27  Martin Baulig  <martin@ximian.com>
5132
5133         According to the spec, `goto' can only leave a nested scope, but
5134         never enter it.
5135
5136         * statement.cs (Block.LookupLabel): Only lookup in the current
5137         block, don't recurse into parent or child blocks.
5138         (Block.AddLabel): Check in parent and child blocks, report
5139         CS0140/CS0158 if we find a duplicate.
5140         (Block): Removed this indexer for label lookups.
5141         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
5142         this already does the error reporting for us.
5143
5144         * flowanalysis.cs
5145         (FlowBranching.UsageVector.Block): New public variable; may be null.
5146         (FlowBranching.CreateSibling): Added `Block' argument.
5147         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
5148         label for the target of a `goto' and check whether we're not
5149         leaving a `finally'.
5150
5151 2004-04-27  Martin Baulig  <martin@ximian.com>
5152
5153         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5154         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
5155         just for returns).
5156
5157 2004-04-27  Martin Baulig  <martin@ximian.com>
5158
5159         * statement.cs (Block.AddLabel): Also check for implicit blocks
5160         and added a CS0158 check.
5161
5162 2004-04-27  Martin Baulig  <martin@ximian.com>
5163
5164         * flowanalysis.cs (FlowBranchingLoop): New class.
5165         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
5166         UsageVector's instead of an ArrayList.
5167         (FlowBranching.Label): Likewise.
5168         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
5169         (FlowBranching.AddBreakVector): New method.
5170
5171 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
5172
5173         * attribute.cs: Small regression fix: only convert the type if we
5174         the type is different, fixes System.Drawing build.
5175
5176 2004-04-27  Martin Baulig  <martin@ximian.com>
5177
5178         * attribute.cs (Attribute.Resolve): If we have a constant value
5179         for a named field or property, implicity convert it to the correct
5180         type.
5181
5182 2004-04-27  Raja R Harinath  <rharinath@novell.com>
5183
5184         * statement.cs (Block.Block): Implicit blocks share
5185         'child_variable_names' fields with parent blocks.
5186         (Block.AddChildVariableNames): Remove.
5187         (Block.AddVariable): Mark variable as "used by a child block" in
5188         every surrounding block.
5189         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
5190         been used in a child block, complain about violation of "Invariant
5191         meaning in blocks" rule.
5192         * cs-parser.jay (declare_local_variables): Don't use
5193         AddChildVariableNames.
5194         (foreach_statement): Don't create an implicit block: 'foreach'
5195         introduces a scope.
5196
5197 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
5198
5199         * convert.cs (ImplicitNumericConversion): 0 is also positive when
5200         converting from 0L to ulong.  Fixes 57522.
5201
5202 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5203
5204         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
5205         derived class hides via 'new' keyword field from base class (test-242.cs).
5206         TODO: Handle this in the more general way.
5207         
5208         * class.cs (CheckBase): Ditto.
5209
5210 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5211
5212         * decl.cs (caching_flags): New member for storing cached values
5213         as bit flags.
5214         (MemberCore.Flags): New enum where bit flags for caching_flags
5215         are defined.
5216         (MemberCore.cls_compliance): Moved to caching_flags.
5217         (DeclSpace.Created): Moved to caching_flags.
5218
5219         * class.cs: Use caching_flags instead of DeclSpace.Created
5220         
5221 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
5222
5223         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
5224         if we are only a derived class, not a nested class.
5225
5226         * typemanager.cs: Same as above, but do this at the MemberLookup
5227         level (used by field and methods, properties are handled in
5228         PropertyExpr).   Allow for the qualified access if we are a nested
5229         method. 
5230
5231 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
5232
5233         * class.cs: Refactoring.
5234         (IMethodData): New inteface; Holds links to parent members
5235         to avoid member duplication (reduced memory allocation).
5236         (Method): Implemented IMethodData interface.
5237         (PropertyBase): New inner classes for get/set methods.
5238         (PropertyBase.PropertyMethod): Implemented IMethodData interface
5239         (Event): New inner classes for add/remove methods.
5240         (Event.DelegateMethod): Implemented IMethodData interface.
5241
5242         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
5243         EmitContext (related to class.cs refactoring).
5244
5245 2004-04-21  Raja R Harinath  <rharinath@novell.com>
5246
5247         * delegate.cs (Delegate.VerifyApplicability): If the number of
5248         arguments are the same as the number of parameters, first try to
5249         verify applicability ignoring  any 'params' modifier on the last
5250         parameter.
5251         Fixes #56442.
5252
5253 2004-04-16  Raja R Harinath  <rharinath@novell.com>
5254
5255         * class.cs (TypeContainer.AddIndexer): Use
5256         'ExplicitInterfaceName' to determine if interface name was
5257         explicitly specified.  'InterfaceType' is not initialized at this time.
5258         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
5259         Indexers array is already in the required order.  Initialize
5260         'IndexerName' only if there are normal indexers.
5261         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
5262         (TypeContainer.Emit): Emit DefaultMember attribute only if
5263         IndexerName is initialized.
5264         Fixes #56300.
5265
5266 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
5267
5268         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
5269         Fixes #57007
5270
5271 2004-04-15  Raja R Harinath  <rharinath@novell.com>
5272
5273         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
5274         attributes.
5275         Fix for #56456.
5276
5277         * attribute.cs (Attribute.Resolve): Check for duplicate named
5278         attributes.
5279         Fix for #56463.
5280
5281 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
5282
5283         * iterators.cs (MarkYield): track whether we are in an exception,
5284         and generate code accordingly.  Use a temporary value to store the
5285         result for our state.
5286
5287         I had ignored a bit the interaction of try/catch with iterators
5288         since their behavior was not entirely obvious, but now it is
5289         possible to verify that our behavior is the same as MS .NET 2.0
5290
5291         Fixes 54814
5292
5293 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
5294
5295         * iterators.cs: Avoid creating temporaries if there is no work to
5296         do. 
5297
5298         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
5299         Enumerations, use TypeManager.EnumToUnderlying and call
5300         recursively. 
5301
5302         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
5303         bug #57013
5304
5305         (This.Emit): Use EmitContext.EmitThis to emit our
5306         instance variable.
5307
5308         (This.EmitAssign): Ditto.
5309
5310         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
5311         codepaths, we will move all the functionality into
5312         Mono.CSharp.This 
5313
5314         (FieldExpr.EmitAssign): Ditto.
5315
5316         This fixes several hidden bugs that I uncovered while doing a code
5317         review of this today.
5318
5319         * codegen.cs (EmitThis): reworked so the semantics are more clear
5320         and also support value types "this" instances.
5321
5322         * iterators.cs: Changed so that for iterators in value types, we
5323         do not pass the value type as a parameter.  
5324
5325         Initialization of the enumerator helpers is now done in the caller
5326         instead of passing the parameters to the constructors and having
5327         the constructor set the fields.
5328
5329         The fields have now `assembly' visibility instead of private.
5330
5331 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
5332
5333         * expression.cs (Argument.Resolve): Check if fields passed as ref
5334         or out are contained in a MarshalByRefObject.
5335
5336         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
5337         another compiler type.
5338
5339 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5340
5341         * class.cs (Indexer.Define): use the new name checking method.
5342         Also, return false on an error.
5343         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
5344         (is_identifier_[start/part]_character): make static.
5345
5346 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
5347
5348         * expression.cs (Binary.ResolveOperator): Do no append strings
5349         twice: since we can be invoked more than once (array evaluation)
5350         on the same concatenation, take care of this here.  Based on a fix
5351         from Ben (bug #56454)
5352
5353 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5354
5355         * codegen.cs: Fix another case where CS1548 must be reported (when 
5356         delay-sign isn't specified and no private is available #56564). Fix
5357         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
5358         error when MCS is used on the MS runtime and we need to delay-sign 
5359         (which seems unsupported by AssemblyBuilder - see #56621).
5360
5361 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
5362
5363         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
5364         (TypeManager.ComputeNamespaces): Faster implementation for
5365         Microsoft runtime.
5366
5367         * compiler.csproj: Updated AssemblyName to mcs.
5368
5369 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5370
5371         * rootcontext.cs: Add new types to the boot resolution.
5372
5373         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5374         MulticastDelegate is not allowed.
5375
5376         * typemanager.cs: Add new types to lookup: System.TypedReference
5377         and ArgIterator.
5378
5379         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5380         check for TypedReference or ArgIterator, they are not allowed. 
5381
5382         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5383         makes us properly catch 1510 in some conditions (see bug 56016 for
5384         details). 
5385
5386 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5387
5388         * CryptoConvert.cs: update from corlib version
5389         with endian fixes.
5390
5391 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5392
5393         * class.cs (Indexer.Define): Check indexername declaration
5394
5395 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5396
5397         * attribute.cs (IsClsCompliant): Fixed problem with handling
5398         all three states (compliant, not-compliant, undetected).
5399
5400 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5401
5402         * attribute.cs (Attribute): Location is now public.
5403         (Resolve): Store resolved arguments (pos_values) in attribute class.
5404         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5405         (GetClsCompliantAttributeValue): New method that gets
5406         CLSCompliantAttribute value.
5407         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5408         if exists else null.
5409         (AttributeTester): New class for CLS-Compliant verification routines.
5410
5411         * class.cs (Emit): Add CLS-Compliant verification.
5412         (Method.GetSignatureForError): Implemented.
5413         (Constructor.GetSignatureForError): Implemented
5414         (Constructor.HasCompliantArgs): Returns if constructor has
5415         CLS-Compliant arguments.
5416         (Constructor.Emit): Override.
5417         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5418         is needed to test only parameters.
5419         (FieldBase.GetSignatureForError): Implemented.
5420         (TypeContainer): New member for storing base interfaces.
5421         (TypeContainer.FindMembers): Search in base interfaces too.
5422
5423         * codegen.cs (GetClsComplianceAttribute): New method that gets
5424         assembly or module CLSCompliantAttribute value.
5425         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5426         for assembly.
5427         (ModuleClass.Emit): Add error 3012 test.
5428
5429         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5430
5431         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5432         state for all decl types.
5433         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5434         if CLS-Compliant tests are required.
5435         (IsClsCompliaceRequired): New method. Analyze whether code
5436         must be CLS-Compliant.
5437         (IsExposedFromAssembly): New method. Returns true when MemberCore
5438         is exposed from assembly.
5439         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5440         value or gets cached value.
5441         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5442         is explicitly marked with CLSCompliantAttribute.
5443         (IsIdentifierClsCompliant): New abstract method. This method is
5444         used to testing error 3005.
5445         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5446         for identifier and parameters CLS-Compliant testing.
5447         (VerifyClsCompliance): New method. The main virtual method for
5448         CLS-Compliant verifications.
5449         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5450         null. I don't know why is null (too many public members !).
5451         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5452         and get value of first CLSCompliantAttribute that found.
5453
5454         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5455         (VerifyClsCompliance): Override and add extra tests.
5456
5457         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5458         clscheck- disable CLS-Compliant verification event if assembly is has
5459         CLSCompliantAttribute(true).
5460
5461         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5462         ApllyAttribute is now called in emit section as in the other cases.
5463         Possible future Emit integration.
5464         (IsIdentifierClsCompliant): New override.
5465         (VerifyClsCompliance): New override.
5466         (GetEnumeratorName): Returns full enum name.
5467
5468         * parameter.cs (GetSignatureForError): Implemented.
5469
5470         * report.cs (WarningData): New struct for Warning message information.
5471         (LocationOfPreviousError): New method.
5472         (Warning): New method. Reports warning based on the warning table.
5473         (Error_T): New method. Reports error based on the error table.
5474
5475         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5476         verifications are done here.
5477
5478         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5479
5480         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5481         CLSCompliantAttribute.
5482         (all_imported_types): New member holds all imported types from other
5483         assemblies.
5484         (LoadAllImportedTypes): New method fills static table with exported types
5485         from all referenced assemblies.
5486         (Modules): New property returns all assembly modules.
5487
5488 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5489
5490         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5491         throwing a parser error.
5492
5493         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5494         which removes the hardcoded get_/set_ prefixes for properties, as
5495         IL allows for the properties to be named something else.  
5496
5497         Bug #56013
5498
5499         * expression.cs: Do not override operand before we know if it is
5500         non-null.  Fix 56207
5501
5502 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5503
5504         * typemanager.cs: support for pinned variables.
5505
5506 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5507
5508         * decl.cs, typemanager.cs: Avoid using an arraylist
5509         as a buffer if there is only one result set.
5510
5511 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5512
5513         * expression.cs: Make sure you cant call a static method
5514         with an instance expression, bug #56174.
5515
5516 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5517
5518         * class.cs (IsDuplicateImplementation): Improve error reporting to
5519         flag 663 (method only differs in parameter modifier).
5520
5521         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5522         in preprocessor directives.
5523
5524         * location.cs (LookupFile): Allow for the empty path.
5525
5526         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5527         better approach for some of that patch, but its failing with the
5528         CharSet enumeration.  For now try/catch will do.
5529
5530         * typemanager.cs: Do not crash if a struct does not have fields.
5531         Fixes 56150.
5532
5533 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5534
5535         * expression.cs: cs0213, cant fix a fixed expression.
5536         fixes 50231.
5537
5538 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5539
5540         * cs-parser.jay: detect invalid embeded statements gracefully.
5541         bug #51113.
5542
5543 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5544
5545         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5546         As a regex:
5547         s/
5548         the invocation type may not be a subclass of the tye of the item/
5549         The type of the item must be a subclass of the invocation item.
5550         /g
5551
5552         Fixes bug #50820.
5553
5554 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5555
5556         * attribute.cs: Added methods to get a string and a bool from an
5557         attribute. Required to information from AssemblyKeyFileAttribute,
5558         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5559         * codegen.cs: Modified AssemblyName creation to include support for
5560         strongnames. Catch additional exceptions to report them as CS1548.
5561         * compiler.csproj: Updated include CryptoConvert.cs.
5562         * compiler.csproj.user: Removed file - user specific configuration.
5563         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5564         Mono.Security assembly. The original class is maintained and tested in
5565         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5566         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5567         like CSC 8.0 (C# v2) supports.
5568         * Makefile: Added CryptoConvert.cs to mcs sources.
5569         * rootcontext.cs: Added new options for strongnames.
5570
5571 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5572
5573         * driver.cs: For --expect-error, report error code `2'
5574         if the program compiled with no errors, error code `1' if
5575         it compiled with an error other than the one expected.
5576
5577 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5578
5579         * compiler.csproj: Updated for Visual Studio .NET 2003.
5580         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5581         * compiler.sln: Updated for Visual Studio .NET 2003.
5582
5583 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5584
5585         * expression.cs: Fix bug #47234. We basically need to apply the
5586         rule that we prefer the conversion of null to a reference type
5587         when faced with a conversion to 'object' (csc behaviour).
5588
5589 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5590
5591         * statement.cs: Shorter form for foreach, eliminates
5592         a local variable. r=Martin.
5593
5594 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5595
5596         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5597         checks if we can use brtrue/brfalse to test for 0.
5598         * expression.cs: use the above in the test for using brtrue/brfalse.
5599         cleanup code a bit.
5600
5601 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5602
5603         * expression.cs: Rewrite string concat stuff. Benefits:
5604
5605         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5606         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5607         rather than a concat chain.
5608
5609         * typemanager.cs: Add lookups for more concat overloads.
5610
5611 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5612
5613         * expression.cs: Emit shorter il code for array init.
5614
5615         newarr
5616         dup
5617         // set 1
5618
5619         // set 2
5620
5621         newarr
5622         stloc.x
5623
5624         ldloc.x
5625         // set 1
5626
5627         ldloc.x
5628         // set 2
5629
5630 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5631
5632         * statement.cs: Before, two switch blocks would be merged if the
5633         total size of the blocks (end_item - begin_item + 1) was less than
5634         two times the combined sizes of the blocks.
5635
5636         Now, it will only merge if after the merge at least half of the
5637         slots are filled.
5638
5639         fixes 55885.
5640
5641 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5642
5643         * class.cs : csc build fix for GetMethods(). See bug #52503.
5644
5645 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5646
5647         * expression.cs: Make sure fp comparisons work with NaN.
5648         This fixes bug #54303. Mig approved this patch a long
5649         time ago, but we were not able to test b/c the runtime
5650         had a related bug.
5651
5652 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5653
5654         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5655
5656 2004-03-19  Martin Baulig  <martin@ximian.com>
5657
5658         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5659         error here and not in our caller.
5660
5661 2004-03-19  Martin Baulig  <martin@ximian.com>
5662
5663         * interface.cs: Completely killed this file.
5664         (Interface): We're now a TypeContainer and live in class.cs.
5665
5666         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5667         argument; we're now also called for interfaces.
5668         (TypeContainer.DefineMembers): Allow this method being called
5669         multiple times.
5670         (TypeContainer.GetMethods): New public method; formerly known as
5671         Interface.GetMethod().  This is used by PendingImplementation.
5672         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5673         it's now private and non-static.
5674         (Interface): Moved this here; it's now implemented similar to
5675         Class and Struct.
5676         (Method, Property, Event, Indexer): Added `bool is_interface'
5677         argument to their .ctor's.
5678         (MemberBase.IsInterface): New public field.
5679
5680         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5681         instances instead of InterfaceMethod, InterfaceProperty, etc.
5682         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5683         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5684
5685 2004-03-19  Martin Baulig  <martin@ximian.com>
5686
5687         * class.cs (MethodCore.IsDuplicateImplementation): New private
5688         method which does the CS0111 checking.
5689         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5690         Use IsDuplicateImplementation().
5691
5692 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5693
5694         * decl.cs (FindMemberToOverride): New method to find the correct
5695         method or property to override in the base class.
5696         * class.cs
5697             - Make Method/Property use the above method to find the
5698               version in the base class.
5699             - Remove the InheritableMemberSignatureCompare as it is now
5700               dead code.
5701
5702         This patch makes large code bases much faster to compile, as it is
5703         O(n) rather than O(n^2) to do this validation.
5704
5705         Also, it fixes bug 52458 which is that nested classes are not
5706         taken into account when finding the base class member.
5707
5708         Reviewed/Approved by Martin.
5709
5710 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5711
5712         * interface.cs: In all interface classes removed redundant
5713         member initialization.
5714
5715 2004-03-16  Martin Baulig  <martin@ximian.com>
5716
5717         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5718
5719 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5720
5721         * decl.cs (DefineTypeAndParents): New helper method to define a
5722         type's containers before the type itself is defined;  This is a
5723         bug exposed by the recent changes to Windows.Forms when an
5724         implemented interface was defined inside a class that had not been
5725         built yet.   
5726
5727         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5728
5729         (Check): Loop correctly to report errors modifiers
5730         (UNSAFE was not in the loop, since it was the same as TOP).
5731
5732         * interface.cs: Every interface member now takes a ModFlags,
5733         instead of a "is_new" bool, which we set on the base MemberCore. 
5734
5735         Every place where we called "UnsafeOk" in the interface, now we
5736         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5737         the unsafe settings from the member declaration instead of the
5738         container interface. 
5739
5740         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5741
5742         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5743         `set_indexer_name' to the pending bits (one per type).
5744
5745         We fixed a bug today that was picking the wrong method to
5746         override, since for properties the existing InterfaceMethod code
5747         basically ignored the method name.  Now we make sure that the
5748         method name is one of the valid indexer names.
5749
5750 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5751  
5752         * support.cs (SeekableStreamReader): Keep track of stream byte
5753         positions and don't mix them with character offsets to the buffer.
5754
5755         Patch from Gustavo Giráldez
5756
5757 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5758
5759         * interface.cs (InterfaceSetGetBase): Removed double member
5760         initialization, base class does it as well.
5761
5762 2004-03-13  Martin Baulig  <martin@ximian.com>
5763
5764         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5765         when compiling corlib.
5766
5767 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5768
5769         * convert.cs (ExplicitConversion): We were reporting an error on
5770         certain conversions (object_type source to a value type, when the
5771         expression was `null') before we had a chance to pass it through
5772         the user defined conversions.
5773
5774         * driver.cs: Replace / and \ in resource specifications to dots.
5775         Fixes 50752
5776
5777         * class.cs: Add check for duplicate operators.  Fixes 52477
5778
5779 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5780
5781         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5782         that are in the middle of the statements, not only at the end.
5783         Fixes #54987
5784
5785         * class.cs (TypeContainer.AddField): No longer set the
5786         `HaveStaticConstructor' flag, now we call it
5787         `UserDefineStaticConstructor' to diferentiate the slightly
5788         semantic difference.
5789
5790         The situation is that we were not adding BeforeFieldInit (from
5791         Modifiers.TypeAttr) to classes that could have it.
5792         BeforeFieldInit should be set to classes that have no static
5793         constructor. 
5794
5795         See:
5796
5797         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5798
5799         And most importantly Zoltan's comment:
5800
5801         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5802
5803         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5804          before its static fields are used', i.e. initialization does not need
5805          to be triggered by the first access to the type. Setting this flag
5806          helps the JIT to compile better code, since it can run the static
5807          constructor at JIT time, and does not need to generate code to call it
5808          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5809          this flag for lots of classes like String. 
5810          
5811          csc sets this flag if the type does not have an explicit static 
5812          constructor. The reasoning seems to be that if there are only static
5813          initalizers for a type, and no static constructor, then the programmer
5814          does not care when this initialization happens, so beforefieldinit
5815          can be used.
5816          
5817          This bug prevents the AOT compiler from being usable, since it 
5818          generates so many calls to mono_runtime_class_init that the AOT code
5819          is much slower than the JITted code. The JITted code is faster, 
5820          because it does not generate these calls if the vtable is type is
5821          already initialized, which is true in the majority of cases. But the
5822          AOT compiler can't do this."
5823
5824 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5825
5826         * class.cs (MethodData.Emit): Refactor the code so symbolic
5827         information is generated for destructors;  For some reasons we
5828         were taking a code path that did not generate symbolic information
5829         before. 
5830
5831 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5832
5833         * class.cs: Create a Constructor.CheckBase method that
5834         takes care of all validation type code. The method
5835         contains some code that was moved from Define.
5836
5837         It also includes new code that checks for duplicate ctors.
5838         This fixes bug #55148.
5839
5840 2004-03-09  Joshua Tauberer <tauberer@for.net>
5841
5842         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5843         a { ... }-style array creation invokes EmitStaticInitializers
5844         which is not good for reference-type arrays.  String, decimal
5845         and now null constants (NullCast) are not counted toward
5846         static initializers.
5847
5848 2004-03-05  Martin Baulig  <martin@ximian.com>
5849
5850         * location.cs (SourceFile.HasLineDirective): New public field;
5851         specifies whether the file contains or is referenced by a "#line"
5852         directive.
5853         (Location.DefineSymbolDocuments): Ignore source files which
5854         either contain or are referenced by a "#line" directive.        
5855
5856 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5857
5858         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5859         direct access to our parent, so check the method inline there.
5860
5861 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5862
5863         * expression.cs (Invocation.EmitCall): Miguel's last commit
5864         caused a regression. If you had:
5865
5866             T t = null;
5867             t.Foo ();
5868
5869         In Foo the implict this would be null.
5870
5871 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5872
5873         * expression.cs (Invocation.EmitCall): If the method is not
5874         virtual, do not emit a CallVirt to it, use Call.
5875
5876         * typemanager.cs (GetFullNameSignature): Improve the method to
5877         cope with ".ctor" and replace it with the type name.
5878
5879         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5880         as an argument the ConstructorBuilder where it is being defined,
5881         to catch the recursive constructor invocations.
5882
5883 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5884
5885         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5886         routines to check if a type is an enumerable/enumerator allow
5887         classes that implement the IEnumerable or IEnumerator interfaces.
5888
5889         * class.cs (Property, Operator): Implement IIteratorContainer, and
5890         implement SetYields.
5891
5892         (Property.Define): Do the block swapping for get_methods in the
5893         context of iterators.   We need to check if Properties also
5894         include indexers or not.
5895
5896         (Operator): Assign the Block before invoking the
5897         OperatorMethod.Define, so we can trigger the Iterator code
5898         replacement. 
5899
5900         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5901         Property and Operator classes are not created when we parse the
5902         declarator but until we have the block completed, so we use a
5903         singleton SimpleIteratorContainer.Simple to flag whether the
5904         SetYields has been invoked.
5905
5906         We propagate this setting then to the Property or the Operator to
5907         allow the `yield' to function.
5908
5909 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5910
5911         * codegen.cs: Implemented attribute support for modules.
5912         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5913         Assembly/Module functionality.
5914
5915         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5916         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5917         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5918
5919 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5920
5921         * interface.cs (FindMembers): The operation is performed on all base
5922         interfaces and not only on the first. It is required for future CLS Compliance patch.
5923
5924 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5925
5926         * statement.cs, codegen.cs:
5927         This patch deals with patterns such as:
5928
5929         public class List : IEnumerable {
5930
5931                 public MyEnumerator GetEnumerator () {
5932                         return new MyEnumerator(this);
5933                 }
5934
5935                 IEnumerator IEnumerable.GetEnumerator () {
5936                         ...
5937                 }
5938                 
5939                 public struct MyEnumerator : IEnumerator {
5940                         ...
5941                 }
5942         }
5943
5944         Before, there were a few things we did wrong:
5945         1) we would emit callvirt on a struct, which is illegal
5946         2) we emited ldarg when we needed to emit ldarga
5947         3) we would mistakenly call the interface methods on an enumerator
5948         type that derived from IEnumerator and was in another assembly. For example:
5949
5950         public class MyEnumerator : IEnumerator
5951
5952         Would have the interface methods called, even if there were public impls of the
5953         method. In a struct, this lead to invalid IL code.
5954
5955 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5956
5957         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5958           renamed to Emit.
5959
5960         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5961
5962 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5963
5964         * cs-parser.jay: Fix small regression: we were not testing V2
5965         compiler features correctly.
5966
5967         * interface.cs: If the emit context is null, then create one
5968
5969 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5970
5971         * decl.cs (GetSignatureForError): New virtual method to get full name
5972           for error messages.
5973
5974         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5975           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5976
5977         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5978           Duplicated members and code in these classes has been removed.
5979           Better encapsulation in these classes.
5980
5981 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5982
5983         * assign.cs (Assign.DoResolve): When dealing with compound
5984         assignments, there is a new rule in ECMA C# 2.4 (might have been
5985         there before, but it is documented here) that states that in:
5986
5987         a op= b;
5988
5989         If b is of type int, and the `op' is a shift-operator, then the
5990         above is evaluated as:
5991
5992         a = (int) a op b 
5993
5994         * expression.cs (Binary.ResolveOperator): Instead of testing for
5995         int/uint/long/ulong, try to implicitly convert to any of those
5996         types and use that in pointer arithmetic.
5997
5998         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5999         method to print information for from the type, not from the
6000         null-method we were given.
6001
6002 2004-02-01  Duncan Mak  <duncan@ximian.com>
6003
6004         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6005         parsing for cmd, fixes bug #53694.
6006
6007 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6008
6009         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6010         in the member name duplication tests. Property and operator name duplication
6011         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6012
6013 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6014
6015         * interface.cs (PopulateMethod): Fixed crash when interface method
6016         returns not existing type (error test cs0246-3.cs).
6017
6018 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6019
6020         * cs-parser.jay (interface_accessors): Re-write actions to also
6021         store attributes attached to get and set methods. Fix spelling
6022         while at it.
6023
6024         (inteface_property_declaration): Modify accordingly.
6025
6026         (InterfaceAccessorInfo): New helper class to store information to pass
6027         around between rules that use interface_accessors.
6028
6029         * interface.cs (Emit): Apply attributes on the get and set
6030         accessors of properties and indexers too.
6031
6032         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6033         right MethodBuilder when applying attributes to the get and set accessors.
6034
6035 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6036
6037         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6038
6039 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6040
6041         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6042
6043 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6044
6045         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6046         changes that treat `yield' specially when present before `break'
6047         or `return' tokens.
6048
6049         * cs-tokenizer.cs: yield is no longer a keyword.
6050
6051 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6052
6053         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6054         setting for default constructors.
6055         For default constructors are almost every time set wrong Modifier. The
6056         generated IL code has been alright. But inside mcs this values was
6057         wrong and this was reason why several of my CLS Compliance tests
6058         failed.
6059
6060 2004-01-22  Martin Baulig  <martin@ximian.com>
6061
6062         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6063         not a QualifiedIdentifier.  This is what `type_name_expression'
6064         was previously doing.
6065         (type_name_expression): Removed; the code is now in
6066         `namespace_or_type_name'.
6067         (qualified_identifier): Removed, use `namespace_or_type_name'
6068         instead.
6069         (QualifiedIdentifier): Removed this class.      
6070
6071 2004-01-22  Martin Baulig  <martin@ximian.com>
6072
6073         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6074         not a string as alias name.
6075
6076 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6077
6078         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6079         #52730 bug, and instead compute correctly the need to use a
6080         temporary variable when requesting an address based on the
6081         static/instace modified of the field and the constructor.
6082  
6083 2004-01-21  Martin Baulig  <martin@ximian.com>
6084
6085         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6086         class and namespace before looking up aliases.  Fixes #52517.
6087
6088 2004-01-21  Martin Baulig  <martin@ximian.com>
6089
6090         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6091         assinged in a 'try'; fixes exception4.cs.
6092
6093 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6094         * class.cs : Implemented parameter-less constructor for TypeContainer
6095
6096         * decl.cs: Attributes are now stored here. New property OptAttributes
6097
6098         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6099
6100         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6101
6102 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6103
6104         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6105           (CSharpSignature): New method for indexer and property signature.
6106
6107 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6108
6109         * pending.cs (IsVirtualFilter): Faster implementation.
6110
6111 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6112
6113         * typemanager.cs: Avoid inclusion of same assembly more than once.
6114
6115 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6116
6117         * cs-parser.jay: Fixed problem where the last assembly attribute
6118           has been applied also to following declaration (class, struct, etc.)
6119           
6120 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6121
6122         * class.cs: Added error CS0538, CS0539 reporting.
6123         Fixed crash on Microsoft runtime when field type is void.
6124
6125         * cs-parser.jay: Added error CS0537 reporting.
6126
6127         * pending.cs: Added error CS0535 reporting.
6128         Improved error report for errors CS0536, CS0534.
6129
6130 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6131
6132         Merge a few bits from the Anonymous Method MCS tree.
6133
6134         * statement.cs (ToplevelBlock): New class for toplevel methods,
6135         will hold anonymous methods, lifted variables.
6136
6137         * cs-parser.jay: Create toplevel blocks for delegates and for
6138         regular blocks of code. 
6139
6140 2004-01-20  Martin Baulig  <martin@ximian.com>
6141
6142         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6143         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6144         and `NeedExplicitReturn'; added `IsLastStatement'.
6145         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6146         have a `ReturnLabel' or we're not unreachable.
6147
6148         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6149         child's reachability; don't just override ours with it.  Fixes
6150         #58058 (lluis's example).
6151         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6152         InFinally(), InLoop(), InSwitch() and
6153         BreakCrossesTryCatchBoundary() methods.
6154
6155         * statement.cs (Return): Do all error checking in Resolve().
6156         Unless we are the last statement in a top-level block, always
6157         create a return label and jump to it.
6158         (Break, Continue): Do all error checking in Resolve(); also make
6159         sure we aren't leaving a `finally'.
6160         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6161         statement in a top-level block.
6162         (Block.Flags): Added `IsDestructor'.
6163         (Block.IsDestructor): New public property.
6164
6165 2004-01-20  Martin Baulig  <martin@ximian.com>
6166
6167         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6168
6169 2004-01-20  Martin Baulig  <martin@ximian.com>
6170
6171         * statement.cs (Statement.ResolveUnreachable): New public method.
6172         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6173         (Block.Resolve): Resolve unreachable statements.
6174
6175 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6176
6177         * expression.cs: We need to fix the case where we do
6178         not have a temp variable here.
6179
6180         * assign.cs: Only expression compound assignments need
6181         temporary variables.
6182
6183 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6184
6185         * flowanalysis.cs: Reduce memory allocation in a few ways:
6186           - A block with no variables should not allocate a bit
6187             vector for itself.
6188           - A method with no out parameters does not need any tracking
6189             for assignment of the parameters, so we need not allocate
6190             any data for it.
6191           - The arrays:
6192                 public readonly Type[] VariableTypes;
6193                 public readonly string[] VariableNames;
6194             Are redundant. The data is already stored in the variable
6195             map, so we need not allocate another array for it.
6196           - We need to add alot of checks for if (params | locals) == null
6197             due to the first two changes.
6198
6199 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6200
6201         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6202         implement IMemoryLocation, we store a copy on a local variable and
6203         take the address of it.  Patch from Benjamin Jemlich
6204
6205         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6206         to use a special "type_name_expression" rule which reduces the
6207         number of "QualifiedIdentifier" classes created, and instead
6208         directly creates MemberAccess expressions.
6209
6210 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6211
6212         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6213         that fixes #52853.  Null literal assignment to ValueType
6214
6215         * class.cs (MethodData.Emit): Instead of checking the name of the
6216         method to determine if its a destructor, create a new derived
6217         class from Method called Destructor, and test for that.  
6218
6219         * cs-parser.jay: Create a Destructor object instead of a Method.  
6220
6221         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6222
6223         Fixes: 52933
6224
6225 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6226
6227         * expression.cs (Binary.ResolveOperator): Perform an implicit
6228         conversion from MethodGroups to their delegate types on the
6229         Addition operation.
6230
6231         * delegate.cs: Introduce a new class DelegateCreation that is the
6232         base class for `NewDelegate' and `ImplicitDelegateCreation',
6233         factor some code in here.
6234
6235         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6236         conversion from MethodGroups to compatible delegate types. 
6237
6238         * ecore.cs (Expression.Resolve): Do not flag error 654
6239         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6240         we allow conversions from MethodGroups to delegate types now.
6241
6242         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6243         assignments in v2 either.
6244
6245 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6246
6247         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6248         static read-only fields in ctors.
6249
6250         Applied patch from Benjamin Jemlich 
6251
6252         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6253
6254 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6255
6256         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6257         here to return true, as they can be used like this:
6258
6259                 (XXX) int.MEMBER ()
6260
6261         Fixed 49836 and all the other dups
6262
6263 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6264
6265         * driver.cs: Implement /win32res and /win32icon.
6266
6267 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6268
6269         * cs-parser.jay: Add a rule to improve error handling for the
6270         common mistake of placing modifiers after the type.
6271
6272 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * cs-parser.jay (interface_event_declaration): Catch
6275         initialization of events on interfaces, and report cs0068
6276
6277         * cs-parser.jay (interface_event_declaration): Catch
6278         initialization of events. 
6279
6280         * ecore.cs: Better report missing constructors.
6281
6282         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6283         the error reporting done in the wrong place.  Fix.
6284
6285         * expression.cs (Binary.ResolveOperator): Catch the 
6286         operator + (E x, E y) error earlier, and later allow for implicit
6287         conversions in operator +/- (E e, U x) from U to the underlying
6288         type of E.
6289
6290         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6291         52596, if the container class is abstract, the default constructor
6292         is protected otherwise its public (before, we were always public).
6293
6294         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6295         fixed statement.
6296
6297         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6298         Jemlich that fixes bug #52597, MCS was generating invalid code for
6299         idisposable structs.   Thanks to Ben for following up with this
6300         bug as well.
6301
6302 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6303
6304         * driver.cs: Allow assemblies without code to be generated, fixes
6305         52230.
6306
6307 2004-01-07  Nick Drochak <ndrochak@gol.com>
6308
6309         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6310
6311 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6312
6313         * cs-parser.jay: Add rules to improve error reporting if fields or
6314         methods are declared at the namespace level (error 116)
6315
6316         * Add rules to catch event add/remove
6317
6318 2004-01-04  David Sheldon <dave-mono@earth.li>
6319
6320   * expression.cs: Added matching ")" to error message for 
6321   CS0077
6322
6323 2004-01-03 Todd Berman <tberman@gentoo.org>
6324
6325         * ecore.cs, attribute.cs:
6326         Applying fix from #52429.
6327
6328 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6329
6330         * ecore.cs, expression.cs, statement.cs:
6331         Total rewrite of how we handle branching. We
6332         now handle complex boolean expressions with fewer
6333         jumps. As well if (x == 0) no longer emits a ceq.
6334
6335         if (x is Foo) is much faster now, because we generate
6336         better code.
6337
6338         Overall, we get a pretty big improvement on our benchmark
6339         tests. The code we generate is smaller and more readable.
6340
6341         I did a full two-stage bootstrap. The patch was reviewed
6342         by Martin and Miguel.
6343
6344 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6345
6346         * cs-parser.jay: Make primary_expression not take a QI.
6347         we dont need this because the member_access rule covers
6348         us here. So we replace the rule with just IDENTIFIER.
6349
6350         This has two good effects. First, we remove a s/r conflict.
6351         Second, we allocate many fewer QualifiedIdentifier objects.
6352
6353 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6354
6355         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6356         set the correct information via SRE. This prevents
6357         hanging on the MS runtime. Fixes #29374.
6358
6359 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6360
6361         * convert.cs: correctly handle conversions to value types
6362         from Enum and ValueType as unboxing conversions.
6363
6364         Fixes bug #52569. Patch by Benjamin Jemlich.
6365
6366 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6367
6368         * expression.cs (BetterConversion): Prefer int -> uint
6369         over int -> ulong (csc's behaviour). This fixed bug #52046.
6370
6371 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6372
6373         * decl.cs (MemberCache.FindMembers): now returns a
6374         MemberInfo [].
6375
6376         * typemanager.cs: In general, go with with ^^.
6377         (CopyNewMethods): take an IList.
6378         (RealMemberLookup): Only allocate an arraylist
6379         if we copy from two sets of methods.
6380
6381         This change basically does two things:
6382         1) Fewer array lists allocated due to CopyNewMethods.
6383         2) the explicit cast in MemberList costed ALOT.
6384
6385 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6386
6387         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6388         a hashtable to avoid needless string allocations when an identifier is
6389         used more than once (the common case).
6390
6391 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6392
6393         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6394         is broken, it will not return anything. So, we
6395         have to use the information we have in mcs to
6396         do the task.
6397
6398         * typemanager.cs: Add a cache for GetInterfaces,
6399         since this will now be used more often (due to ^^)
6400
6401         (GetExplicitInterfaces) New method that gets the
6402         declared, not effective, interfaces on a type
6403         builder (eg, if you have interface IFoo, interface
6404         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6405         { IBar }.
6406
6407         This patch makes MCS able to bootstrap itself on
6408         Windows again.
6409
6410 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6411
6412         * expression.cs: Remove the Nop's that Miguel put
6413         in by mistake.
6414
6415 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6416
6417         * report.cs, codegen.cs: Give the real stack trace to
6418         the error when an exception is thrown.
6419
6420 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6421
6422         * decl.cs: only allocate hashtables for ifaces if 
6423         it is an iface!
6424
6425 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6426
6427         * expression.cs: fix the error from cs0121-2.cs
6428         (a parent interface has two child interfaces that
6429         have a function with the same name and 0 params
6430         and the function is called through the parent).
6431
6432 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6433
6434         * class.cs, rootcontext.cs, typmanager.cs: do not
6435         leak pointers.
6436
6437 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6438
6439         * codegen.cs: remove stack for the ec flow branching.
6440         It is already a linked list, so no need.
6441
6442 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6443
6444         * Makefile: Allow custom profiler here.
6445
6446 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6447
6448         * typemanager.cs (LookupType):
6449           - Use a static char [], because split takes
6450             a param array for args, so it was allocating
6451             every time.
6452           - Do not store true in a hashtable, it boxes.
6453
6454 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6455
6456         * flowanalysis.cs: bytify common enums.
6457
6458 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6459
6460         * modifiers.cs: Add a new set of flags for the
6461         flags allowed on explicit interface impls.
6462         * cs-parser.jay: catch the use of modifiers in
6463         interfaces correctly.
6464         * class.cs: catch private void IFoo.Blah ().
6465
6466         All related to bug #50572.
6467
6468 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6469
6470         * decl.cs: Rewrite the consistant accessability checking.
6471         Accessability is not linear, it must be implemented in
6472         a tableish way. Fixes #49704.
6473
6474 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6475
6476         * expression.cs: Handle negation in a checked context.
6477         We must use subtraction from zero. Fixes #38674.
6478
6479 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6480
6481         * class.cs: Ignore static void main in DLLs.
6482         * rootcontext.cs: Handle the target type here,
6483         since we are have to access it from class.cs
6484         * driver.cs: account for the above.
6485
6486 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6487
6488         * report.cs: Give line numbers and files if available.
6489
6490 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6491
6492         * driver.cs: Implement /addmodule.
6493
6494         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6495         ModuleBuilders.
6496
6497 2003-12-20  Martin Baulig  <martin@ximian.com>
6498
6499         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6500         (FieldBase.IsAssigned): Removed this field.
6501         (FieldBase.SetAssigned): New public method.
6502         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6503
6504 2003-12-20  Martin Baulig  <martin@ximian.com>
6505
6506         * expression.cs (LocalVariableReference.DoResolve): Don't set
6507         `vi.Used' if we're called from DoResolveLValue().
6508
6509         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6510         returns the usage vector it just merged into the current one -
6511         pass this one to UsageWarning().
6512         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6513         of the `EmitContext', don't call this recursively on our children.
6514
6515 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6516
6517         * driver.cs: Implement /target:module.
6518
6519 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6520
6521         * support.cs (CharArrayHashtable): New helper class.
6522
6523         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6524         char arrays, not strings, so we can avoid creating a string in
6525         consume_identifier if the identifier is a keyword.
6526
6527 2003-12-16  Martin Baulig  <martin@ximian.com>
6528
6529         * statement.cs (LocalInfo.Assigned): Removed this property.
6530         (LocalInfo.Flags): Removed `Assigned'.
6531         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6532         and uses flow analysis.
6533         (Block.UsageWarning): Made this method private.
6534         (Block.Resolve): Call UsageWarning() if appropriate.
6535
6536         * expression.cs (LocalVariableReference.DoResolve): Always set
6537         LocalInfo.Used here.
6538
6539 2003-12-13  Martin Baulig  <martin@ximian.com>
6540
6541         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6542         any value here; we're now using flow analysis to figure out
6543         whether a statement/block returns a value.
6544
6545 2003-12-13  Martin Baulig  <martin@ximian.com>
6546
6547         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6548         working again.
6549         (FlowBranching.MergeFinally): Don't call
6550         `branching.CheckOutParameters()' here, this is called in
6551         MergeTopBlock().
6552         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6553         when adding the `finally' vector.       
6554
6555 2003-12-13  Martin Baulig  <martin@ximian.com>
6556
6557         * flowanalysis.cs
6558         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6559         actually work and also fix #48962.
6560
6561 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6562
6563         * decl.cs: Do not check System.Object for nested types,
6564         since we know it does not have any. Big bang for buck:
6565
6566         BEFORE:
6567            Run 1:   8.35 seconds
6568            Run 2:   8.32 seconds
6569            corlib:  17.99 seconds
6570         AFTER:
6571            Run 1:   8.17 seconds
6572            Run 2:   8.17 seconds
6573            corlib:  17.39 seconds
6574
6575 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6576
6577         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6578         time we are returning 0 members, so we save alot here.
6579
6580 2003-12-11  Martin Baulig  <martin@ximian.com>
6581
6582         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6583         `MergeChild()', also just take the `FlowBranching' as argument;
6584         call Merge() on it and return the result.
6585         (FlowBranching.Merge): We don't need to do anything if we just
6586         have one sibling.
6587
6588 2003-12-11  Martin Baulig  <martin@ximian.com>
6589
6590         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6591         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6592         Maurer for this idea.
6593
6594 2003-12-11  Martin Baulig  <martin@ximian.com>
6595
6596         * flowanalysis.cs (MergeResult): This class is now gone; we now
6597         use the `UsageVector' for this.  The reason for this is that if a
6598         branching just has one sibling, we don't need to "merge" them at
6599         all - that's the next step to do.
6600         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6601         `MergeResult'.
6602
6603 2003-12-11  Martin Baulig  <martin@ximian.com>
6604
6605         Reworked flow analyis and made it more precise and bug-free.  The
6606         most important change is that we're now using a special `Reachability'
6607         class instead of having "magic" meanings of `FlowReturns'.  I'll
6608         do some more cleanups and optimizations and also add some more
6609         documentation this week.
6610
6611         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6612         largely reworked this class.
6613         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6614         the new `Reachability' class instead of having "magic" values here.
6615         (FlowBranching): We're now using an instance of `Reachability'
6616         instead of having separate `Returns', `Breaks' etc. fields.
6617
6618         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6619         based on flow analysis; ignore the return value of block.Emit ().
6620
6621 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6622
6623         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6624         if they are private.
6625
6626 2003-12-09  Martin Baulig  <martin@ximian.com>
6627
6628         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6629         call them directly on the UsageVector.
6630
6631 2003-12-09  Martin Baulig  <martin@ximian.com>
6632
6633         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6634         Changed return type from `FlowReturns' to `Reachability'.
6635
6636 2003-12-09  Martin Baulig  <martin@ximian.com>
6637
6638         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6639         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6640         `Reachable' fields with a single `Reachability' one.
6641
6642 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6643
6644         * class.cs (FindMembers): Remove foreach's.
6645
6646         Bootstrap times:
6647
6648         BEFORE
6649                 Run 1:   8.74 seconds
6650                 Run 2:   8.71 seconds
6651
6652         AFTER
6653                 Run 1:   8.64 seconds
6654                 Run 2:   8.58 seconds
6655
6656
6657 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6658
6659         * cs-parser.jay:
6660         * gen-treedump.cs:
6661         * statement.cs:
6662         This patch does a few things:
6663                 1. EmptyStatement is now a singleton, so it is never reallocated.
6664                 2. All blah is EmptyStatement constructs have been changed to
6665                    blah == EmptyStatement.Value, which is much faster and valid
6666                    now that EmptyStatement is a singleton.
6667                 3. When resolving a block, rather than allocating a new array for
6668                    the non-empty statements, empty statements are replaced with
6669                    EmptyStatement.Value
6670                 4. Some recursive functions have been made non-recursive.
6671         Mainly the performance impact is from (3), however (1) and (2) are needed for
6672         this to work. (4) does not make a big difference in normal situations, however
6673         it makes the profile look saner.
6674
6675         Bootstrap times:
6676
6677         BEFORE
6678         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6679         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6680         Total memory allocated: 56397 KB
6681
6682         AFTER
6683         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6684         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6685         Total memory allocated: 55666 KB
6686
6687 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6688
6689         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6690         than the hashtable in a hashtable version
6691
6692         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6693         we always end up concating a string. This results in a huge perf
6694         loss, because many strings have to be tracked by the GC. In this
6695         patch, we first use a hashtable that works with two keys, so that
6696         the strings do not need to be concat'ed.
6697
6698         Bootstrap times:
6699         BEFORE
6700                 Run 1:   8.74 seconds
6701                 Run 2:   8.71 seconds
6702
6703         AFTER
6704                 Run 1:   8.65 seconds
6705                 Run 2:   8.56 seconds
6706
6707 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6708
6709         * Makefile: Add a new target `do-time' that does a quick and simple
6710         profile, leaving easy to parse output.
6711
6712 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6713
6714         * codegen.cs (Init): Create the dynamic assembly with 
6715         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6716
6717 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6718
6719         * support.cs: Make the PtrHashtable use only one
6720         instance of its comparer.
6721
6722 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6723
6724         * typemanager.cs: Fix lookup of GetNamespaces.
6725
6726 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6727
6728         * expression.cs: Removed redundant line.
6729
6730         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6731         ArrayLists, use for loops with bounds.  
6732
6733         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6734         arraylist.
6735
6736         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6737         arraylists, use for loop with bounds.
6738
6739         The above three changes give us a 0.071 second performance
6740         improvement out of 3.294 seconds down to 3.223.  On my machine
6741         the above changes reduced the memory usage by 1,387 KB during
6742         compiler bootstrap.
6743
6744         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6745         QualifiedIdentifiers.  Before we created a new string through
6746         concatenation, and mostly later on, the result would be
6747         manipulated by DecomposeQI through string manipulation.
6748
6749         This reduced the compiler memory usage for bootstrapping from
6750         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6751         compile times in 0.05 seconds.
6752
6753 2003-11-28  Dick Porter  <dick@ximian.com>
6754
6755         * support.cs: Do string compares with the Invariant culture.
6756
6757         * rootcontext.cs: 
6758         * gen-treedump.cs: 
6759         * expression.cs: 
6760         * driver.cs: 
6761         * decl.cs: 
6762         * codegen.cs: 
6763         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6764         the comparison is done with the Invariant culture.
6765
6766 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6767
6768         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6769         GetEnumerator method.
6770
6771         (ProbeCollectionType): Iterate starting at the most specific type
6772         upwards looking for a GetEnumerator
6773
6774         * expression.cs: Shift count can be up to 31 for int/uint and 63
6775         for long/ulong.
6776
6777 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6778
6779         * statement.cs (Block.LookupLabel): Also look for the label on the
6780         children blocks.  Use a hash table to keep track of visited
6781         nodes. 
6782
6783         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6784         we actually did transform the other operand, otherwise fall back
6785         to the common codepath that casts to long.
6786
6787         * cs-tokenizer.cs: Use the same code pattern as the int case.
6788         Maybe I should do the parsing myself, and avoid depending on the
6789         Parse routines to get this done.
6790
6791 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6792
6793         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6794         which fixes bug 51347.  This time test it.
6795
6796         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6797         attributes for example can not tell the difference between these.
6798         The difference was only a syntax feature of the language. 
6799
6800         * attribute.cs: Apply attributes to delegates.
6801
6802         * delegate.cs: Call the apply attributes method.
6803
6804 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6805
6806         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6807         comparing 0 vs Byte.MinValue, not the value
6808
6809         (ImplicitConversionRequired): When reporting a conversion error,
6810         use error 31 to print out the constant error instead of the
6811         simpler 29.
6812
6813         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6814         which fixes bug 51347.
6815
6816 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6817
6818         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6819         which fixes the -warnaserror command line option.
6820
6821 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6822
6823         * cfold.cs (DoNumericPromotions): During constant folding of
6824         additions on UIntConstant, special case intconstants with
6825         IntConstants like we do on the expression binary operator. 
6826
6827 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6828
6829         * convert.cs (ImplicitReferenceConversion): We were missing a case
6830         (System.Enum are not value types or class types, so we need to
6831         classify them separatedly).
6832
6833         * driver.cs: We do not support error 2007.
6834
6835 2003-11-12 Jackson Harper <jackson@ximian.com>
6836
6837         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6838         system directory. Also use the full file name so users can
6839         libraries names mscorlib-o-tron.dll in a non system dir.
6840
6841 2003-11-10  Martin Baulig  <martin@ximian.com>
6842
6843         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6844         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6845         calling `ResolveType()' on them, directly assign their `Type'.
6846
6847 2003-11-08  Martin Baulig  <martin@ximian.com>
6848
6849         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6850         return value and the `out parent' parameter.
6851         (TypeContainer.DefineType): Moved the CS0644 check into
6852         GetClassBases().  Don't pass the interface types to the
6853         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6854         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6855
6856         * ecore.cs (TypeExpr.IsAttribute): New property.
6857         (TypeExpr.GetInterfaces): New method.
6858
6859         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6860         TypeExpr instead of a Type.
6861         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6862         (Interface.DefineType): Don't pass the interface types to the
6863         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6864         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6865
6866         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6867         instead of a `Type[]'.
6868         (TypeManager.RegisterBuilder): Likewise.
6869         (TypeManager.AddUserInterface): Likewise.
6870         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6871         `Type[]' and also return a `TypeExpr[]'.
6872         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6873
6874 2003-11-08  Martin Baulig  <martin@ximian.com>
6875
6876         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6877         Expression.     
6878
6879 2003-11-08  Martin Baulig  <martin@ximian.com>
6880
6881         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6882         TypeManager.ResolveExpressionTypes().
6883
6884         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6885         instead of an Expression.
6886         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6887         (TypeExpression): New public class; formerly known as `TypeExpr'.
6888
6889         * expression.cs (ComposedCast): Derive from TypeExpr.
6890
6891         * typemanager.cs (TypeManager.system_*_expr): These are now
6892         TypExpr's instead of Expression's.
6893         (TypeManager.ResolveExpressionTypes): New public static function;
6894         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6895         of them.        
6896
6897 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6898
6899         * expression.cs (New.DoResolve): Do not dereference value that
6900         might be a null return.
6901
6902         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6903         sure that the constant value has the right type.  Fixes an
6904         unreported bug, similar to 50425.
6905
6906         * const.cs (Const.LookupConstantValue): Call
6907         ImplicitStandardConversionExists before doing a conversion to
6908         avoid havng the TypeManager.ChangeType do conversions.
6909
6910         Reduced the number of casts used
6911
6912         (Const.ChangeType): New routine to enable reuse of the constant
6913         type changing code from statement.
6914
6915         * typemanager.cs (ChangeType): Move common initialization to
6916         static global variables.
6917
6918         Fixes #50425.
6919
6920         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6921         every value type to go through, even if it was void.  Fix that. 
6922
6923         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6924         character of the define, and the is_identifier_part_character for
6925         the rest of the string.
6926
6927 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6928
6929         * expression.cs (UnaryMutator.EmitCode): When I updated
6930         LocalVariableReference.DoResolve, I overdid it, and dropped an
6931         optimization done on local variable references.
6932
6933 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6934
6935         * ecore.cs: Convert the return from Ldlen into an int.
6936
6937 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6938
6939         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6940         the accessibility, this is a special case for toplevel non-public
6941         classes (internal for instance).
6942
6943 2003-10-20  Nick Drochak <ndrochak@gol.com>
6944
6945         * ecore.cs: Fix typo and build.  Needed another right paren.
6946
6947 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6948
6949         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6950         `internal' case regular and protected, but not allowing protected
6951         to be evaluated later.  Bug 49840
6952
6953 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6954
6955         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6956         to kb.Nlast, and not the kb.nFirst to isolate the switch
6957         statement.
6958
6959         Extract the underlying type, so enumerations of long/ulong are
6960         treated like long/ulong.
6961
6962 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6963
6964         * expression.cs (New): Overload the meaning of RequestedType to
6965         track the possible creation of the NewDelegate type, since
6966         DoResolve is invoked more than once for new constructors on field
6967         initialization.
6968
6969         See bugs: #48800 and #37014
6970
6971         * cs-parser.jay (declare_local_constants): Take an arraylist
6972         instead of a single constant.
6973
6974         (local_constant_declaration): It should take a
6975         constant_declarators, not a constant_declarator.  Fixes 49487
6976
6977         * convert.cs: Fix error report.
6978
6979 2003-10-13 Jackson Harper <jackson@ximian.com>
6980
6981         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6982         bug #49611
6983
6984 2003-10-09  Martin Baulig  <martin@ximian.com>
6985
6986         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6987         to the .ctor.
6988         (MethodCore.DoDefineParameters): Removed the TypeContainer
6989         argument; use the DeclSpace which was passed to the .ctor instead.
6990         (MethodCore.CheckParameter): Take a DeclSpace instead of a
6991         TypeContainer; we only need a DeclSpace here.
6992
6993 2003-10-09  Martin Baulig  <martin@ximian.com>
6994
6995         * class.cs (MethodData): Added additional `DeclSpace ds' argument
6996         to the .ctor.
6997         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6998         EmitContext's .ctor.    
6999
7000 2003-10-09  Martin Baulig  <martin@ximian.com>
7001
7002         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7003         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7004         AsAccessible(), moved them as well.
7005
7006         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7007
7008 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7009
7010         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7011
7012 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7013
7014         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7015         generation for >=, as spotted by Paolo, bug 48679.  
7016         Patch from David Waite.
7017
7018         * cs-tokenizer.cs: Add handling for #pragma.
7019
7020         * cs-parser.jay: Allow for both yield and yield return in the
7021         syntax.  The anti-cobolization of C# fight will go on!
7022
7023         * class.cs (TypeBuilder.DefineType): Catch error condition here
7024         (Parent.DefineType erroring out and returning null).
7025
7026         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7027         coping with enumerations variables, we were mistakenly processing
7028         them as a regular value type instead of built-in types.  Fixes the
7029         bug #48063
7030
7031         * typemanager.cs (IsBuiltinOrEnum): New method.
7032
7033 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7034
7035         * cs-parser.jay: Upgrade: yield now needs the return clause.
7036
7037 2003-09-19  Martin Baulig  <martin@ximian.com>
7038
7039         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7040         `MemberCache parent' argument.  Normally, an interface doesn't
7041         have a parent type except System.Object, but we use this in gmcs
7042         for generic type parameters.
7043
7044 2003-09-18  Martin Baulig  <martin@ximian.com>
7045
7046         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7047         on `type.IsInterface'; don't check whether the type has a parent
7048         to determine whether it's an interface.
7049
7050 2003-09-15  Martin Baulig  <martin@ximian.com>
7051
7052         * class.cs (TypeContainer.DefineType): Added an error flag to
7053         avoid reporting duplicate CS0146's ("class definition is
7054         circular.").
7055
7056         * driver.cs (Driver.MainDriver): Abort if
7057         RootContext.ResolveTree() reported any errors.
7058
7059 2003-09-07  Martin Baulig  <martin@ximian.com>
7060
7061         * report.cs (Error, Warning): Added overloaded versions which take
7062         a `params object[] args' and call String.Format().
7063
7064 2003-09-07  Martin Baulig  <martin@ximian.com>
7065
7066         * decl.cs (DeclSpace..ctor): Don't call
7067         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7068         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7069         (DeclSpace.RecordDecl): New method.
7070
7071         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7072
7073 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7074
7075         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7076         value attributes to be applied to ParameterBuilders.
7077
7078         * class.cs (MethodCore.LabelParameters): Make static and more
7079         generic so that it can be used from other places - like interface
7080         methods, for instance.
7081
7082         * interface.cs (Interface.Emit): Call LabelParameters before
7083         emitting attributes on the InterfaceMethod.
7084
7085 2003-08-26  Martin Baulig  <martin@ximian.com>
7086
7087         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7088         resolving aliases; fixes #47927.
7089
7090 2003-08-26  Martin Baulig  <martin@ximian.com>
7091
7092         * statement.cs (Using.DoResolve): This is internally emitting a
7093         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7094         do not always return.  Fixes #47681.
7095
7096 2003-08-26  Martin Baulig  <martin@ximian.com>
7097
7098         * decl.cs (MemberCore): Moved WarningNotHiding(),
7099         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7100         into MemberBase.
7101         (AdditionResult): Make this nested in DeclSpace.
7102         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7103         argument; call NamespaceEntry.Define() unless we're nested in a
7104         class or struct.
7105
7106         * namespace.cs (Namespace.DefineName): New public function.  This
7107         is called from DeclSpace's .ctor to add 
7108         (Namespace.Lookup): Include DeclSpaces in the lookup.
7109
7110         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7111
7112         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7113
7114 2003-08-25  Martin Baulig  <martin@ximian.com>
7115
7116         * convert.cs (Convert.ExplicitReferenceConversion): When
7117         converting from an interface type to a class, unbox if the target
7118         type is a struct type.  Fixes #47822.
7119
7120 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7121
7122         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7123         #47854.
7124
7125 2003-08-22  Martin Baulig  <martin@ximian.com>
7126
7127         * class.cs (TypeManager.DefineType): When defining a nested type,
7128         call DefineType() on our parent; fixes #47801.
7129
7130 2003-08-22  Martin Baulig  <martin@ximian.com>
7131
7132         * class.cs (MethodData.Define): While checking if a method is an
7133         interface implementation, improve the test a bit more to fix #47654.
7134
7135 2003-08-22  Martin Baulig  <martin@ximian.com>
7136
7137         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7138         correctly; fixes #47722.
7139
7140 2003-08-22  Martin Baulig  <martin@ximian.com>
7141
7142         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7143         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7144
7145         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7146
7147 2003-08-22  Martin Baulig  <martin@ximian.com>
7148
7149         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7150         can only be assigned in static constructors.  Fixes #47161.
7151
7152 2003-08-22  Martin Baulig  <martin@ximian.com>
7153
7154         Rewrote and improved the flow analysis code.
7155
7156         * flowbranching.cs (FlowBranching): Make this class abstract.
7157         (FlowBranching.CreateBranching): New static function to create a
7158         new flow branching.
7159         (FlowBranchingBlock, FlowBranchingException): New classes.
7160         (FlowBranching.UsageVector.Type): New public readonly field.
7161         (FlowBranching.UsageVector.Breaks): Removed the setter.
7162         (FlowBranching.UsageVector.Returns): Removed the setter.
7163         (FlowBranching.UsageVector): Added Break(), Return(),
7164         NeverReachable() and Throw() methods to modify the reachability.
7165         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7166         done by FlowBranching.Merge().
7167         (FlowBranching.UsageVector.MergeChild): New method; merges the
7168         merge result into the current vector.
7169         (FlowBranching.Merge): New abstract method to merge a branching.
7170
7171 2003-08-12  Martin Baulig  <martin@ximian.com>
7172
7173         * expression.cs (Indirection.CacheTemporaries): Create the
7174         LocalTemporary with the pointer type, not its element type.
7175
7176 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7177
7178         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7179         token was a keyword or not.
7180
7181         Add `error' options where an IDENTIFIER was expected;  Provide
7182         CheckToken and CheckIdentifierToken convenience error reporting
7183         functions. 
7184
7185         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7186
7187         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7188         NameSpaceEntry NameSpaceEntry.
7189
7190         (LookupInterfaceOrClass): Avoid creating a full qualified name
7191         from namespace and name: avoid doing lookups when we know the
7192         namespace is non-existant.   Use new Tree.LookupByNamespace which
7193         looks up DeclSpaces based on their namespace, name pair.
7194
7195         * driver.cs: Provide a new `parser verbose' to display the
7196         exception thrown during parsing.  This is turned off by default
7197         now, so the output of a failure from mcs is more graceful.
7198
7199         * namespace.cs: Track all the namespaces defined in a hashtable
7200         for quick lookup.
7201
7202         (IsNamespace): New method
7203
7204 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7205
7206         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7207         we know that we need to concatenate (full typename can never be
7208         null). 
7209
7210         * class.cs: ditto.
7211
7212         * statement.cs: Use a bitfield;  Do not initialize to null things
7213         which are done by the constructor by default.
7214
7215         * cs-parser.jay: bug fix, parameter was 4, not 3.
7216
7217         * expression.cs: Just use the property;
7218
7219         * statement.cs: No need for GetVariableInfo method.
7220
7221 2003-08-08  Martin Baulig  <martin@ximian.com>
7222
7223         * flowanalysis.cs (FlowReturns): This is now nested in the
7224         `FlowBranching' class.
7225         (MyBitVector): Moved this here from statement.cs.
7226         (FlowBranching.SiblingType): New enum type.
7227         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7228
7229 2003-08-07  Martin Baulig  <martin@ximian.com>
7230
7231         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7232         `FlowBranching' class and called `BranchingType'.
7233
7234 2003-08-07  Martin Baulig  <martin@ximian.com>
7235
7236         * flowanalysis.cs: Moved all the control flow analysis code into
7237         its own file.
7238
7239 2003-08-07  Martin Baulig  <martin@ximian.com>
7240
7241         * assign.cs (Assign.DoResolve): `target' must either be an
7242         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7243         #37319.
7244
7245 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7246
7247         * expression.cs (BinaryMethod): This kind of expression is created by the
7248         Binary class if it determines that the operator has to be handled
7249         by a method.
7250
7251         (BinaryDelegate): This kind of expression is created if we are
7252         dealing with a + or - operator on delegates.
7253
7254         (Binary): remove method, argumetns, and DelegateOperator: when
7255         dealing with methods, 
7256
7257         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7258
7259         * statement.cs (Block): use bitfields for the three extra booleans
7260         we had in use.   Remove unused topblock parameter.
7261
7262         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7263
7264         * assign.cs: Drop extra unneeded tests.
7265
7266 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7267
7268         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7269
7270         * statement.cs (Foreach): Use VariableStorage instead of
7271         LocalBuilders.   
7272
7273         * codegen.cs (VariableStorage): New class used by clients that
7274         require a variable stored: locals or fields for variables that
7275         need to live across yield.
7276
7277         Maybe provide a convenience api for EmitThis+EmitLoad?
7278
7279         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7280         these bad boys.
7281
7282 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7283
7284         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7285         RemapParameterLValue): New methods that are used to turn a
7286         precomputed FieldInfo into an expression like this:
7287
7288                 instance.FieldInfo
7289
7290         The idea is to use this instead of making LocalVariableReference
7291         have more than one meaning.
7292
7293         * cs-parser.jay: Add error production to BASE.
7294
7295         * ecore.cs: Deal with TypeManager.GetField returning null, which
7296         is now a valid return value.
7297
7298         (FieldExprNoAddress): New expression for Fields whose address can
7299         not be taken.
7300
7301         * expression.cs (LocalVariableReference): During the resolve
7302         phases, create new expressions if we are in a remapping context.
7303         Remove code that dealt with remapping here.
7304
7305         (ParameterReference): same.
7306
7307         (ProxyInstance): New expression, like the `This' expression, but
7308         it is born fully resolved.  We know what we are doing, so remove
7309         the errors that are targeted to user-provided uses of `this'.
7310
7311         * statement.cs (Foreach): our variable is now stored as an
7312         Expression;  During resolution, follow the protocol, dont just
7313         assume it will return this.
7314
7315 2003-08-06  Martin Baulig  <martin@ximian.com>
7316
7317         * support.cs (SeekableStreamReader.cs): New public class.
7318
7319         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7320         SeekableStreamReader instead of the normal StreamReader.
7321
7322 2003-08-04  Martin Baulig  <martin@ximian.com>
7323
7324         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7325         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7326         deambiguate casts and delegate invocations.
7327         (parenthesized_expression): Use the new tokens to ensure this is
7328         not a cast of method invocation.
7329
7330         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7331         when reading a `)' and Deambiguate_CloseParens () was previously
7332         called.
7333
7334         * expression.cs (ParenthesizedExpression): New class.  This is
7335         just used for the CS0075 test.
7336         (Binary.DoResolve): Check for CS0075.   
7337
7338 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7339
7340         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7341         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7342         reference comparison.
7343
7344         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7345         examine the ReturnType for equality - this is necessary in the
7346         cases of implicit and explicit operators whose signature also
7347         includes the return type.
7348
7349 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7350
7351         * namespace.cs: Cache the result of the namespace computation,
7352         instead of computing it every time.
7353
7354 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7355
7356         * decl.cs: Use a global arraylist that we reuse over invocations
7357         to avoid excesive memory consumption.  Reduces memory usage on an
7358         mcs compile by one meg (45 average).
7359
7360         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7361         private, work around that.
7362
7363 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7364
7365         * literal.cs (IntLiteral): Define Zero and One static literals. 
7366
7367         * cs-parser.jay (integer_literal): use static literals to reduce
7368         memory usage for the most used literals (0, 1 and -1).  211kb
7369         reduced in memory usage.
7370
7371         Replace all calls to `new ArrayList' with `new
7372         ArrayList(4)' which is a good average number for most allocations,
7373         and also requires only 16 bytes of memory for its buffer by
7374         default. 
7375
7376         This reduced MCS memory usage in seven megabytes for the RSS after
7377         bootstrapping.
7378
7379 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7380
7381         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7382         handle params methods the correct way by forming only one
7383         applicable set with params and normal methods in them. Earlier we
7384         were looking at params methods only if we found no normal methods
7385         which was not the correct thing to do.
7386
7387         (Invocation.BetterFunction): Take separate arguments indicating
7388         when candidate and the best method are params methods in their
7389         expanded form.
7390
7391         This fixes bugs #43367 and #46199.
7392
7393         * attribute.cs: Documentation updates.
7394
7395         (CheckAttribute): Rename to CheckAttributeTarget.
7396         (GetValidPlaces): Rename to GetValidTargets.
7397
7398         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7399         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7400
7401         Fixes bug #44468.
7402
7403 2003-07-28  Martin Baulig  <martin@ximian.com>
7404
7405         * class.cs (TypeContainer.DefineMembers): Use the base type's full
7406         name when looking up the base class of a nested class.  Fixes #46977.
7407
7408 2003-07-26  Martin Baulig  <martin@ximian.com>
7409
7410         * expression.cs (Indexers.Indexer): New nested struct; contains
7411         getter, setter and the indexer's type.
7412         (Indexers.Properties): This is now an ArrayList of
7413         Indexers.Indexer's.
7414         (IndexerAccess.DoResolveLValue): Correctly set the type if the
7415         indexer doesn't have any getters.
7416
7417         * assign.cs (Assign.DoResolve): Also do the implicit conversions
7418         for embedded property and indexer assignments.
7419
7420 2003-07-26  Martin Baulig  <martin@ximian.com>
7421
7422         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
7423         preprocessor directive is not the first non-whitespace character
7424         on a line.
7425
7426 2003-07-26  Martin Baulig  <martin@ximian.com>
7427
7428         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
7429         namespace parsing, follow the spec more closely.
7430
7431         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
7432         NamespaceEntry.Lookup().
7433
7434 2003-07-25  Martin Baulig  <martin@ximian.com>
7435
7436         * MethodCore.cs (OverridesSomething): New public field; it's set
7437         from TypeContainer.DefineMembers if this method overrides
7438         something (which doesn't need to be a method).  Fix #39462.
7439
7440 2003-07-25  Ravi Pratap  <ravi@ximian.com>
7441
7442         * typemanager.cs (GetMembers): Ensure that the list of members is
7443         reversed. This keeps things in sync.
7444
7445         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
7446         find an AttributeUsage attribute.
7447
7448         * expression.cs (Invocation.OverloadResolve): Perform the check
7449         which disallows Invoke to be directly called on a Delegate.
7450
7451         (Error_InvokeOnDelegate): Report error cs1533.
7452
7453 2003-07-25  Martin Baulig  <martin@ximian.com>
7454
7455         * expression.cs (Indexers.GetIndexersForType): Only look in the
7456         interface hierarchy if the requested type is already an
7457         interface.  Fixes #46788 while keeping #46502 fixed.
7458
7459 2003-07-25  Martin Baulig  <martin@ximian.com>
7460
7461         * class.cs (TypeContainer.DefineMembers): Check whether all
7462         readonly fields have been assigned and report warning CS0649 if
7463         not.
7464
7465         * statement.cs (LocalInfo.IsFixed): Always return true if this is
7466         a valuetype.
7467
7468 2003-07-24  Ravi Pratap  <ravi@ximian.com>
7469
7470         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
7471         returned from GetMethods to make things consistent with the
7472         assumptions MCS makes about ordering of methods.
7473
7474         This should comprehensively fix bug #45127 and it does :-)
7475
7476         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
7477         ordering is actually reverse.
7478
7479         * Clean up some debug messages I left lying around.
7480
7481         * interface.cs (Populate*): Get rid of code which emits attributes
7482         since the stage in which we emit attributes is the 'Emit' stage,
7483         not the define stage.
7484
7485         (Emit): Move attribute emission for interface members here.
7486
7487 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7488
7489         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7490         closely: we eliminate methods in base types when we have an
7491         applicable method in a top-level type.
7492
7493         Please see section 14.5.5.1 for an exact description of what goes
7494         on. 
7495
7496         This fixes bug #45127 and a host of other related to corlib compilation.
7497
7498         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7499         array is the method corresponding to the top-level type (this is
7500         because of the changes made to icall.c) so we change this
7501         accordingly.
7502
7503         (MethodGroupExpr.Name): This too.
7504
7505         * typemanager.cs (GetElementType): New method which does the right
7506         thing when compiling corlib. 
7507
7508         * everywhere: Make use of the above in the relevant places.
7509
7510 2003-07-22  Martin Baulig  <martin@ximian.com>
7511
7512         * cs-parser.jay (invocation_expression): Moved
7513         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7514         `cast_expression', but create a InvocationOrCast which later
7515         resolves to either an Invocation or a Cast.
7516
7517         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7518         method; call this before EmitStatement() to make sure that this
7519         expression can be used as a statement.
7520
7521         * expression.cs (InvocationOrCast): New class; resolves to either
7522         an Invocation or a Cast.
7523
7524         * statement.cs (StatementExpression): Call ResolveStatement() on
7525         the ExpressionStatement before emitting it.
7526
7527 2003-07-21  Martin Baulig  <martin@ximian.com>
7528
7529         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7530         `ref' and `out' attributes match; fixes #46220.
7531         (MemberAccess.ResolveMemberAccess): You can't reference a type
7532         through an expression; fixes #33180.
7533         (Indexers.GetIndexersForType): Don't return the indexers from
7534         interfaces the class implements; fixes #46502.
7535
7536 2003-07-21  Martin Baulig  <martin@ximian.com>
7537
7538         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7539         CS0661 checks; fixes bug #30442.
7540
7541 2003-07-21  Martin Baulig  <martin@ximian.com>
7542
7543         * decl.cs (AdditionResult): Added `Error'.
7544
7545         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7546
7547         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
7548         makes cs0031.cs actually work.
7549
7550 2003-07-20  Martin Baulig  <martin@ximian.com>
7551
7552         * namespace.cs: Fixed that bug which caused a crash when compiling
7553         the debugger's GUI.
7554
7555 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7556
7557         * typemanager.cs (LookupTypeReflection): Never expose types which
7558         are NotPublic, NestedPrivate, NestedAssembly, or
7559         NestedFamANDAssem.  We used to return these, and later do a check
7560         that would report a meaningful error, but the problem is that we
7561         would not get the real match, if there was a name override.
7562
7563 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7564
7565         * namespace.cs (Namespace, Name): Do not compute the namespace
7566         name dynamically, compute it in the constructor.  This reduced
7567         memory usage by 1697 KB.
7568
7569         * driver.cs: Use --pause to pause at the end.
7570
7571 2003-07-17  Peter Williams  <peter@newton.cx>
7572
7573         * Makefile: Change the name of the test target so that it doesn't
7574         conflict with the recursive test target.
7575
7576 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7577
7578         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7579         AddressOf): Do not use EmitThis, that was wrong, use the actual
7580         this pointer.
7581
7582 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7583
7584         * class.cs (MethodData.Define): While checking if a method is an
7585         interface implementation, improve the test: If we are not public
7586         (use new test here: use the computed MethodAttributes directly,
7587         instead of the parsed modifier flags) check if the `implementing'
7588         method comes from an interface or not.
7589
7590         * pending.cs (VerifyPendingMethods): Slightly better error
7591         message.
7592
7593         * makefile: add test target that does the mcs bootstrap.
7594
7595 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7596
7597         * interface.cs (Define): Do nothing here since there are no
7598         members to populate etc. Move the attribute emission out of here
7599         since this was just totally the wrong place to put it. Attribute
7600         application happens during the 'Emit' phase, not in the 'Define'
7601         phase.
7602
7603         (Emit): Add this method and move the attribute emission here
7604
7605         * rootcontext.cs (EmitCode): Call the Emit method on interface
7606         types too.
7607
7608 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7609
7610         * expression.cs (OverloadResolve): Report error only if Location
7611         is not 'Null' which means that there was a probe going on.
7612
7613 2003-07-14  Martin Baulig  <martin@ximian.com>
7614
7615         * expression.cs (ConditionalLogicalOperator): New public class to
7616         implement user defined conditional logical operators.
7617         This is section 14.11.2 in the spec and bug #40505.
7618
7619 2003-07-14  Martin Baulig  <martin@ximian.com>
7620
7621         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7622
7623 2003-07-14  Martin Baulig  <martin@ximian.com>
7624
7625         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7626
7627         * ecore.cs (IVariable.VerifyFixed): New interface method.
7628
7629         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7630         operator, check whether the variable is actually fixed.  Fixes bug
7631         #36055.  Set a variable definitely assigned when taking its
7632         address as required by the spec.
7633
7634         * statement.cs (LocalInfo.IsFixed): New field.
7635         (LocalInfo.MakePinned): Set `IsFixed' to true.
7636
7637 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7638
7639         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7640         for .ctors, ensure that we only ask for members declared in the
7641         attribute type (BindingFlags.DeclaredOnly).
7642
7643         Fixes bug #43632.
7644
7645         * expression.cs (Error_WrongNumArguments): Report error 1501
7646         correctly the way CSC does.
7647
7648 2003-07-13  Martin Baulig  <martin@ximian.com>
7649
7650         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7651         lookup on the fully qualified name, to make things like "X.X" work
7652         where "X.X" is a fully qualified type name, but we also have a
7653         namespace "X" in the using list.  Fixes #41975.
7654
7655 2003-07-13  Martin Baulig  <martin@ximian.com>
7656
7657         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7658         function. If we're a CompoundAssign, we need to create an embedded
7659         CompoundAssign, not an embedded Assign.
7660         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7661         Fixes #45854.
7662
7663 2003-07-13  Martin Baulig  <martin@ximian.com>
7664
7665         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7666         work to fix bug #46088.
7667
7668 2003-07-13  Ravi Pratap <ravi@ximian.com>
7669
7670         * class.cs (Operator.Emit): Do not emit attributes here - it is
7671         taken care of by the Method class that we delegate too. This takes
7672         care of bug #45876.
7673
7674 2003-07-10  Martin Baulig  <martin@ximian.com>
7675
7676         * expression.cs (TypeOfVoid): New class.
7677         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7678
7679 2003-07-10  Martin Baulig  <martin@ximian.com>
7680
7681         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7682         bug #35957.
7683
7684 2003-07-10  Martin Baulig  <martin@ximian.com>
7685
7686         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7687         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7688
7689         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7690
7691         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7692
7693 2003-07-10  Martin Baulig  <martin@ximian.com>
7694
7695         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7696         of decimal.  Fixes #42850.
7697
7698         NOTE: I also fixed the created byte blob, but this doesn't work on
7699         the MS runtime and csc never produces any byte blobs for decimal
7700         arrays.
7701
7702 2003-07-10  Martin Baulig  <martin@ximian.com>
7703
7704         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7705         structs; fixes #32068.
7706         (Block.AddChildVariableNames): Fixed #44302.
7707
7708 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7709
7710         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7711
7712 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7713
7714         * attribute.cs: And this test is onger needed.
7715
7716 2003-07-08  Martin Baulig  <martin@ximian.com>
7717
7718         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7719         inaccessible types.  Fixes #36313.
7720
7721         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7722
7723         * namespace.cs (NamespaceEntry): Create implicit entries for all
7724         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7725         implicit entries for N1.N2 and N1.
7726
7727 2003-07-08  Martin Baulig  <martin@ximian.com>
7728
7729         Rewrote the handling of namespaces to fix a lot of the issues
7730         wrt. `using' aliases etc.
7731
7732         * namespace.cs (Namespace): Splitted this class into a
7733         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7734
7735         * typemanager.cs (TypeManager.IsNamespace): Removed.
7736         (TypeManager.ComputeNamespaces): Only compute namespaces from
7737         loaded assemblies here, not the namespaces from the assembly we're
7738         currently compiling.
7739
7740 2003-07-08  Martin Baulig  <martin@ximian.com>
7741
7742         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7743
7744 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7745
7746         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7747         already fixed it.  
7748
7749         I thought about the memory savings here, but LookupTypeReflection
7750         is used under already very constrained scenarios.  Compiling
7751         corlib or mcs only exposes one hit, so it would not really reduce
7752         any memory consumption.
7753
7754 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7755
7756         * typemanager.cs: fixes bug #45889 by only adding public types from
7757         other assemblies to the list of known types.
7758
7759 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7760
7761         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7762         on the type we resolved.
7763
7764 2003-07-05  Martin Baulig  <martin@ximian.com>
7765
7766         * pending.cs (PendingImplementation.ParentImplements): Don't
7767         create the proxy if the parent is abstract.
7768
7769         * class.cs (TypeContainer.DefineIndexers): Process explicit
7770         interface implementations first.  Fixes #37714.
7771
7772 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7773
7774         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7775         defined recursively;  but since we modify the input parameters
7776         (left is set to `this' temporarily), we reset this value if the
7777         left_is_explicit is false, which gives the original semantics to
7778         the code.  
7779
7780         * literal.cs (NullPointer): new class used to represent a null
7781         literal in a pointer context.
7782
7783         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7784         type is a pointer, use a NullPointer object instead of a
7785         NullLiteral.   Closes 43687
7786
7787         (ExplicitConversion): Convert pointer values using
7788         the conv opcode to the proper type.
7789
7790         * ecore.cs (New): change ValueTypeVariable property into a method,
7791         that returns whether the valuetype is suitable for being used.
7792
7793         * expression.cs (Binary.DoNumericPromotions): Only return if we
7794         the int constant was a valid uint, and we can return both left and
7795         right as uints.  If not, we continue processing, to trigger the
7796         type conversion.  This fixes 39018.
7797
7798         * statement.cs (Block.EmitMeta): During constant resolution, set
7799         the CurrentBlock property on the emitcontext, so that we resolve
7800         constants propertly.
7801
7802 2003-07-02  Martin Baulig  <martin@ximian.com>
7803
7804         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7805         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7806
7807         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7808         than emitting it here.
7809
7810         * statement.cs: Fixed some more flow analysis bugs.
7811
7812 2003-07-02  Martin Baulig  <martin@ximian.com>
7813
7814         * class.cs (MethodData.Define): When implementing interface
7815         methods, set Final unless we're Virtual.
7816
7817         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7818         check work for interface methods.
7819
7820 2003-07-01  Martin Baulig  <martin@ximian.com>
7821
7822         * ecore.cs (EmitContext.This): Replaced this property with a
7823         GetThis() method which takes a Location argument.  This ensures
7824         that we get the correct error location for a CS0188.
7825
7826 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7827
7828         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7829         ImplicitStandardConversion.
7830
7831         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7832
7833 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7834
7835         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7836         optimization.
7837
7838 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7839
7840         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7841         constructors.
7842
7843         (MethodData.Define): Turn off initlocals for unsafe methods.
7844
7845 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7846
7847         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7848         complete;  Fixes #37521.
7849
7850         * delegate.cs: Use Modifiers.TypeAttr to compute the
7851         TypeAttributes, instead of rolling our own.  This makes the flags
7852         correct for the delegates.
7853
7854 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7855
7856         * class.cs (Constructor.Define): Set the private flag for static
7857         constructors as well.
7858
7859         * cs-parser.jay (statement_expression): Set the return value to
7860         null, to avoid a crash when we catch an error.
7861
7862 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7863
7864         * cs-parser.jay: Applied patch from Jackson that adds support for
7865         extern and unsafe modifiers to destructor declarations.
7866
7867         * expression.cs: Report error 21 if the user is trying to index a
7868         System.Array.
7869
7870         * driver.cs: Add an error message, suggested by the bug report.
7871
7872         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7873         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7874
7875 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7876
7877         * namespace.cs: Add some information to reduce FAQs.
7878
7879 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7880
7881         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7882         underlying enumeration types.  Fixes #43915.
7883
7884         * expression.cs: Treat ushort/short as legal values to be used in
7885         bitwise operations.
7886
7887 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7888
7889         * delegate.cs: transfer custom attributes for paramenters from
7890         the delegate declaration to Invoke and BeginInvoke.
7891
7892 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7893
7894         * attribute.cs: handle custom marshalers and emit marshal info
7895         for fields, too.
7896
7897 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7898
7899         * makefile.gnu: Added anonymous.cs to the compiler sources.
7900
7901 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7902
7903         * iterators.cs: Change the name of the proxy class to include two
7904         underscores.
7905
7906         * cs-parser.jay: Update grammar to include anonymous methods.
7907
7908         * anonymous.cs: new file.
7909
7910 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7911
7912         * class.cs (Field.Define): Add missing test for pointers and
7913         safety. 
7914
7915 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7916
7917         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7918         we use the stobj opcode.
7919
7920         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7921         since it wasn't the correct fix. 
7922
7923         It still is puzzling that we are required to use stobj for IntPtr
7924         which seems to be a ValueType.
7925
7926 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7927
7928         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7929         during regular simple name resolution.   Now, the trick is that
7930         instead of returning for processing the simplename, we do a
7931         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7932         contextual lookup type).   If a match is found, return that, if
7933         not, return for further composition.
7934
7935         This fixes long-standing 30485.
7936
7937         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7938         using the address to initialize an object, do an Stobj instead of
7939         using the regular Stelem.
7940
7941         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7942         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7943         Because if we are a BaseIndexerAccess that value will be true.
7944         Fixes 43643.
7945
7946         * statement.cs (GotoCase.Resolve): Return after reporting an
7947         error, do not attempt to continue. 
7948
7949         * expression.cs (PointerArithmetic.Emit): If our operand is a
7950         long, convert our constants to match the operand before
7951         multiplying.  Convert to I type before adding.   Fixes 43670.
7952
7953 2003-05-14  Ravi Pratap  <ravi@ximian.com>
7954
7955         * enum.cs (ImplicitConversionExists) : Rename to
7956         ImplicitEnumConversionExists to remove ambiguity. 
7957
7958         * ecore.cs (NullCast): New type of cast expression class which
7959         basically is very similar to EmptyCast with the difference being
7960         it still is a constant since it is used only to cast a null to
7961         something else
7962         (eg. (string) null)
7963
7964         * convert.cs (ImplicitReferenceConversion): When casting a null
7965         literal, we return a NullCast.
7966
7967         * literal.cs (NullLiteralTyped): Remove - I don't see why this
7968         should be around anymore.
7969
7970         The renaming (reported was slightly wrong). Corrections:
7971
7972         ConvertImplicitStandard -> ImplicitConversionStandard
7973         ConvertExplicitStandard -> ExplicitConversionStandard
7974
7975         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
7976         before passing them in !
7977
7978         * convert.cs (ImplicitConversionStandard): When comparing for
7979         equal expr and target types, ensure that expr is not a
7980         NullLiteral.
7981
7982         In general, we must not be checking (expr_type ==
7983         target_type) in the top level conversion methods
7984         (ImplicitConversion, ExplicitConversion etc). This checking is
7985         done in the methods that they delegate to.
7986
7987 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
7988
7989         * convert.cs: Move Error_CannotConvertType,
7990         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
7991         ImplicitNumericConversion, ImplicitConversionExists,
7992         ImplicitUserConversionExists, StandardConversionExists,
7993         FindMostEncompassedType, FindMostSpecificSource,
7994         FindMostSpecificTarget, ImplicitUserConversion,
7995         ExplicitUserConversion, GetConversionOperators,
7996         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
7997         TryImplicitIntConversion, Error_CannotConvertImplicit,
7998         ConvertImplicitRequired, ConvertNumericExplicit,
7999         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8000         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8001         its own file.
8002
8003         Perform the following renames:
8004
8005         StandardConversionExists -> ImplicitStandardConversionExists
8006         ConvertImplicit -> ImplicitConversion
8007         ConvertImplicitStandard -> ImplicitStandardConversion
8008         TryImplicitIntConversion -> ImplicitIntConversion
8009         ConvertImplicitRequired -> ImplicitConversionRequired
8010         ConvertNumericExplicit -> ExplicitNumericConversion
8011         ConvertReferenceExplicit -> ExplicitReferenceConversion
8012         ConvertExplicit -> ExplicitConversion
8013         ConvertExplicitStandard -> ExplicitStandardConversion
8014
8015 2003-05-19  Martin Baulig  <martin@ximian.com>
8016
8017         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8018         (TypeInfo): Added support for structs having structs as fields.
8019
8020         * ecore.cs (FieldExpr): Implement IVariable.
8021         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8022         VariableInfo for the field.
8023
8024 2003-05-18  Martin Baulig  <martin@ximian.com>
8025
8026         * expression.cs (This.DoResolve): Report a CS0027 if we're
8027         emitting a field initializer.
8028
8029 2003-05-18  Martin Baulig  <martin@ximian.com>
8030
8031         * expression.cs (This.ResolveBase): New public function.
8032         (This.DoResolve): Check for CS0188.
8033
8034         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8035         This.Resolve().
8036
8037         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8038         `instance_expression' to null if we don't have any non-static
8039         methods.
8040
8041 2003-05-18  Martin Baulig  <martin@ximian.com>
8042
8043         Reworked the way how local variables and parameters are handled by
8044         the flow analysis code.
8045
8046         * statement.cs (TypeInfo, VariableMap): New public classes.
8047         (VariableInfo): New public class.  This is now responsible for
8048         checking whether a variable has been assigned.  It is used for
8049         parameters and local variables.
8050         (Block.EmitMeta): Take the InternalParameters as argument; compute
8051         the layout of the flow vectors here.
8052         (Block.LocalMap, Block.ParameterMap): New public properties.
8053         (FlowBranching): The .ctor doesn't get the InternalParameters
8054         anymore since Block.EmitMeta() now computes the layout of the flow
8055         vector.
8056         (MyStructInfo): This class is now known as `StructInfo' and nested
8057         in `TypeInfo'; we don't access this directly anymore.
8058
8059         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8060         property and removed IsAssigned(), IsFieldAssigned(),
8061         SetAssigned() and SetFieldAssigned(); we now call them on the
8062         VariableInfo so we don't need to duplicate this code everywhere.
8063
8064         * expression.cs (ParameterReference): Added `Block block' argument
8065         to the .ctor.
8066         (LocalVariableReference, ParameterReference, This): The new
8067         VariableInfo class is now responsible for all the definite
8068         assignment stuff.
8069
8070         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8071         IsParameterAssigned, SetParameterAssigned): Removed.
8072
8073 2003-05-18  Martin Baulig  <martin@ximian.com>
8074
8075         * typemanager.cs (InitCoreTypes): Try calling
8076         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8077         the 3-args-version.  Corlib now also needs our `void_type'.
8078         (GetMethod): Added overloaded version which takes an optional
8079         `bool report_errors' to allow lookups of optional methods.
8080
8081 2003-05-12  Martin Baulig  <martin@ximian.com>
8082
8083         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8084         only used for locals and not for parameters.
8085
8086 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8087
8088         * support.cs (InternalParameters.ParameterType): Return the
8089         ExternalType of the parameter.
8090
8091         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8092         they were unused.
8093
8094 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8095
8096         * class.cs (MethodData.Define): Do not set the `newslot' on
8097         interface members, if they are also flagged as "override".
8098
8099         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8100         better code for ++i and i++.  This only works for static fields
8101         and local variables.
8102
8103         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8104         want to pull the DeclSpace out of the builder_to_declspace instead
8105         of the TypeBuilder (like in TypeContainer.FindMembers).
8106
8107         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8108         instead of LookupTypeContainer.  Fixes the crash on .NET for
8109         looking up interface members.
8110
8111         * const.cs: Create our own emit context during the Definition
8112         stage, so that constants are evaluated in the proper context, when
8113         a recursive definition happens.
8114
8115 2003-05-11  Martin Baulig  <martin@ximian.com>
8116
8117         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8118         new block for a switch section.
8119         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8120         the adding/lookup in the switch block.  Fixes #39828.
8121
8122 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8123
8124         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8125         functionality: I needed to convert the data after I had performed
8126         the add/sub operation into the operands type size.
8127
8128         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8129         pass the type for the box operation, otherwise the resulting
8130         object would have been of type object.
8131
8132         (BoxedCast): Add constructor to specify the type to box as.
8133
8134 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8135
8136         * iterators.cs: I was reusing the `count' variable inadvertently,
8137         take steps to not allow this to happen.
8138
8139 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8140
8141         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8142         by creating an array at the point where the params starts and
8143         putting all those arguments there, then adjusting the size of the
8144         array.
8145
8146 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8147
8148         * expression.cs (New.AddressOf): Implement interface
8149         IMemoryLocation.  This is used when the `new' operator is used in
8150         the context of an invocation to a method on a value type.
8151
8152         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8153         example. 
8154
8155         * namespace.cs: Also check the using aliases here.
8156
8157         * driver.cs: Move the test for using validity after the types have
8158         been entered, so we do a single pass that also includes the using
8159         aliases. 
8160
8161         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8162         in the regular case.   CreateSiblingForFinally is doing extra
8163         error checking.
8164
8165         * attribute.cs (GetAttributeArgumentExpression): Store the result
8166         on an out value, and use the return value to indicate failure
8167         instead of using null (which is a valid return for Constant.GetValue).
8168
8169         * statement.cs: Perform the analysis flow for the increment
8170         portion after the statement, because this will be the real flow of
8171         execution.  Fixes #42385
8172
8173         * codegen.cs (EmitContext.EmitArgument,
8174         EmitContext.EmitStoreArgument): New helper functions when the
8175         RemapToProxy flag is set.
8176
8177         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8178         function.
8179
8180         Add support for remapping parameters. 
8181
8182         * iterators.cs: Propagate parameter values;  Store parameter
8183         values in the proxy classes.
8184
8185 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8186
8187         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8188         need a proxy reference;  I do not know what I was thinking
8189
8190         * cs-parser.jay (constructor_initializer): catch another error,
8191         and display nice message.
8192
8193         (field_declaration): catch void field declaration
8194         to flag a better error. 
8195
8196         * class.cs (MemberBase.CheckBase): Report an error instead of a
8197         warning if a new protected member is declared in a struct. 
8198         (Field.Define): catch the error of readonly/volatile.
8199
8200         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8201
8202         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8203         volatile variable is taken
8204
8205 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8206
8207         * statement.cs (Fixed.Resolve): Report an error if we are not in
8208         an unsafe context.
8209
8210 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8211
8212         * typemanager.cs: reuse the code that handles type clashes for
8213         delegates and enumerations.
8214
8215         * class.cs (Report28): Always report.
8216
8217         * expression.cs (EncodeAsAttribute): Allow nulls here.
8218
8219 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8220
8221         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8222         the functionality for testing whether an expression is valid for
8223         an attribute here.  Also handle the case of arrays of elements
8224         being stored. 
8225
8226         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8227         encoding a linear array into an array of objects that are suitable
8228         to be passed to an CustomAttributeBuilder.
8229
8230         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8231
8232         * ecore.cs: (FieldExpr): Handle field remapping here.
8233
8234         * iteratators.cs: Pass the instance variable (if the method is an
8235         instance method) to the constructors, so we can access the field
8236         variables on the class.
8237
8238         TODO: Test this with structs.  I think the THIS variable on
8239         structs might have to be a pointer, and not a refenrece
8240
8241 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8242
8243         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8244         local variables to fields in a proxy class.
8245
8246         * iterators.cs (PopulateProxy): Rename our internal fields to
8247         <XXX>.  
8248         Create a <THIS> field if we are an instance method, so we can
8249         reference our parent container variables.
8250         (MapVariable): Called back from the EmitContext code to enter a
8251         new variable to field mapping into the proxy class (we just create
8252         a FieldBuilder).
8253
8254         * expression.cs
8255         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8256         for using the remapped locals to fields.
8257
8258         I placed the code here, because that gives the same semantics to
8259         local variables, and only changes the Emit code.
8260
8261         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8262         statements inside iterators.
8263         (VariableInfo): Add a FieldBuilder for the cases when we are
8264         remapping local variables to fields in a proxy class
8265
8266         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8267         current_block != null.
8268
8269         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8270         not cope with strings, as it has been moved to the
8271         TableSwitchEmit.  Fixed bug in switch generation.
8272
8273         * expression.cs (New.DoResolve): Provide more context for the user
8274         when reporting an error.
8275
8276         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8277         pointers. 
8278
8279         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8280         check the permissions for it.  Note than in a type-resolution
8281         context the check was already present in DeclSpace.ResolveType,
8282         but was missing from the MemberAccess.
8283
8284         (ArrayCreation.CheckIndices): warn if the user has
8285         more nested levels of expressions, but there are no more
8286         dimensions specified.  Avoids crash on bug 41906.
8287
8288 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8289
8290         * statement.cs (Block): replace Implicit bool, for a generic
8291         flags.   
8292         New flag: `Unchecked'.  This is used during the EmitMeta phase
8293         (which is out-of-line with the regular Resolve/Emit process for a
8294         statement, as this is done ahead of time, but still gets a chance
8295         to call constant resolve).
8296
8297         (Block.Flags): new enum for adding a new flag.
8298
8299         (Block.EmitMeta): track the state of unchecked.
8300
8301         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8302         to enable constant resolution to work there as well.
8303
8304 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8305
8306         * typemanager.cs (ienumerable_type): Also look up
8307         System.Collections.IEnumerable. 
8308
8309 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8310
8311         TODO: Test more than one conditional per method.
8312
8313         * class.cs (Indexer.Define): Report the location where the user is
8314         referencing the unsupported feature.
8315
8316         (MethodData): Overload the use of `conditionals' to
8317         minimize the creation of needless ArrayLists.   This saves roughly
8318         212kb on my machine.
8319
8320         (Method): Implement the new IIteratorContainer interface.
8321         (Method.SetYields): Implement the method by setting the ModFlags
8322         to contain METHOD_YIELDS.
8323
8324         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8325         which just got set to null.
8326
8327         * iterators.cs: New file.
8328
8329         (Yield, YieldBreak): New statements.
8330
8331         * statement.cs (Return.Resolve): Flag an error if we are used in
8332         an iterator method.
8333
8334         * codegen.cs (InIterator): New flag set if the code is being
8335         compiled in an iterator method.
8336
8337         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8338         internal modifier, and we just use it to avoid adding extra
8339         fields, as this is seldom used.  
8340
8341         * cs-parser.jay: Add yield_statement (yield and yield break).
8342
8343         * driver.cs: New flag -v2 to turn on version 2 features. 
8344
8345         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8346         hashtable when v2 is enabled.
8347
8348 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8349
8350         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8351         there is already a namespace defined with this name.
8352
8353         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8354         people upgraded their corlibs.
8355
8356         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8357         always use fully qualified types, no need to use the compiler
8358         front end.
8359
8360         (TypeManager.IsNamespace): Use binarysearch.
8361
8362         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8363         AddDelegate): I did not quite use the new IsValid API properly: I
8364         have to pass the short-name and the fullname.  I was passing only
8365         the basename instead of the fullname sometimes. 
8366
8367         (TypeContainer.DefineType): call NamespaceClash.
8368
8369         * interface.cs (Interface.DefineType): use NamespaceClash before
8370         defining the type.
8371
8372         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8373         defining the type.
8374
8375         * enum.cs: (Enum.DefineType): use NamespaceClash before
8376         defining the type.
8377
8378         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8379         speed increase.  First, use the negative_hits cache when we get a
8380         negative.  Second, add the type with its full original name
8381         instead of the new . and + encoded name (reflection uses + to
8382         separate type from a nested type).  Use LookupTypeReflection
8383         directly which bypasses the type->name hashtable (that we already
8384         know does not contain the type.
8385
8386         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8387         location/container type. 
8388
8389         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8390
8391 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8392
8393         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8394
8395         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8396         method is being referenced in the method group from a static
8397         context, and report error 120 if so.
8398
8399         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8400         Error118. 
8401
8402         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8403         is created, we create the A namespace).
8404
8405         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8406         Fixes #41591
8407
8408 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8409
8410         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8411         invocation to ModuleBuilder.GetType with the same values will
8412         return a new type instance, so we need to cache its return
8413         values. 
8414
8415         * expression.cs (Binary.ResolveOperator): Only allow the compare
8416         operators on enums if they are of the same type.
8417
8418         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8419         types of ValueType on their own case.  Before we were giving them
8420         the same treatment as objects.
8421
8422         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8423         fullname.  Short name is used to compare against container name.
8424         Fullname is used to check against defined namespace names.
8425
8426         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8427         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8428
8429         (Method.CheckBase): Call parent.
8430         (MemberBase.CheckBase): Check for protected members on sealed
8431         classes.
8432         (PropertyBase.CheckBase): Call parent.
8433         (Field.Define): Call parent.
8434
8435         * report.cs: Negative error codes are now mapped to 8000 - code,
8436         so that the display is render more nicely.
8437
8438         * typemanager.cs: Do not use try/catch, instead report a regular
8439         error. 
8440
8441         (GetPointerType, GetReferenceType): These methods provide
8442         mechanisms to obtain the T* and T& from a T.  We had the code
8443         previously scattered around the code base, and it also used
8444         TypeManager.LookupType that would go through plenty of caches.
8445         This one goes directly to the type source.
8446
8447         In some places we did the Type.GetType followed by
8448         ModuleBuilder.GetType, but not in others, so this unifies the
8449         processing as well.
8450
8451         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8452         statements now that we have namespace information.
8453
8454         * typemanager.cs (IsNamespace): New method, returns whether the
8455         string presented is a namespace or not.
8456
8457         (ComputeNamespaces): New public entry point, computes the list of
8458         available namespaces, using the GetNamespaces API call in Mono, or
8459         the slower version in MS.NET.   
8460
8461         Now before we start the semantic analysis phase, we have a
8462         complete list of namespaces including everything that the user has
8463         provided.
8464
8465         Deleted old code to cache namespaces in .nsc files.
8466
8467 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8468
8469         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8470         class/struct location definition Location for the implicit
8471         constructor location.
8472
8473         (Operator.Define): Use the location of the operator for the
8474         implicit Method definition.
8475
8476         (Constructor.Emit): use the constructor location for the implicit
8477         base initializer constructor.
8478
8479         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8480         and the Expression class now contains two new methods:
8481
8482         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8483         isolate type lookup from the rest of the resolution process.
8484
8485         Since we use Expressions to hold type definitions due to the way
8486         we parse the input we have historically overloaded Resolve to
8487         perform the Type lookups if a special flag is passed.  Now this is
8488         eliminated and two methods take their place. 
8489
8490         The differences in the two methods between xStep and xTerminal is
8491         that xStep is involved in our current lookup system that uses
8492         SimpleNames to compose a name, while xTerminal is used just to
8493         catch the case where the simplename lookup failed.
8494
8495 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8496
8497         * expression.cs (ResolveMemberAccess): Remove redundant code.
8498         TypeExpr expressions are always born fully resolved.
8499
8500         * interface.cs (PopulateMethod): Do not lookup the types twice.
8501         We were doing it once during SemanticAnalysis and once during
8502         PopulateMethod.
8503
8504         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8505         in local variable type definitions, were being returned as a
8506         SimpleName (we decomposed everything into a string), that is
8507         because primary_expression was being used instead of a type in the
8508         grammar (reduce/reduce conflicts).
8509
8510         The part that was wrong is that we converted the expression into a
8511         string (an oversimplification in one hand, compounded with primary
8512         expressions doing string concatenation).
8513
8514         So things like:
8515
8516         A.B.C [] x;
8517
8518         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8519         using clauses from working on this particular context.  And a type
8520         was being matched directly against "A.B.C[]".
8521
8522         We now use the correct approach, and allow for ComposedCast to be
8523         part of the unary expression.  So the "A.B.C []" become a composed
8524         cast of "A.B.C" (as a nested group of MemberAccess with a
8525         SimpleName at the end) plus the rank composition "[]". 
8526
8527         Also fixes 35567
8528
8529 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8530
8531         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8532         for the access level checking.
8533
8534         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8535         `TypeContainer container', because I kept getting confused when I
8536         was debugging this code.
8537
8538         * expression.cs (Indexers): Instead of tracking getters/setters,
8539         we now track them in parallel.  We create one arraylist less, but
8540         most importantly it is possible now for the LValue code to find a
8541         matching get for a set.
8542
8543         (IndexerAccess.DoResolveLValue): Update the code.
8544         GetIndexersForType has been modified already to extract all the
8545         indexers from a type.  The code assumed it did not.
8546
8547         Also make the code set the correct return type for the indexer.
8548         This was fixed a long time ago for properties, but was missing for
8549         indexers.  It used to be void_type.
8550
8551         (Binary.Emit): Test first for doubles instead of
8552         floats, as they are more common.
8553
8554         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8555         when dealing with floats and the <=, >= operators.  This fixes bug
8556         #39314 
8557
8558         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8559         to load the array value by emitting a load on the foreach variable
8560         type.  This was incorrect.  
8561
8562         We now emit the code to load an element using the the array
8563         variable type, and then we emit the conversion operator.
8564
8565         Fixed #40176
8566
8567 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8568
8569         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8570
8571 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8572
8573         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8574         test for protection before we test for signatures. 
8575
8576         (MethodSignature.ToString): implement.
8577
8578         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8579         to the case where we reduced into a LongConstant.
8580
8581         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8582         depend on whether the information is acurrate, because the
8583         Microsoft runtime will always claim that the array type is public,
8584         regardless of the real state.
8585
8586         If the type is a pointer, another problem happens: the type is
8587         reported as non-public in Microsoft.  
8588
8589         In both cases we have to call CheckAccessLevel recursively with
8590         the underlying type as the argument to be tested.
8591
8592 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8593
8594         * assign.cs (Assign.Emit): If we are dealing with a compound
8595         assignment expression, we should use the code path that stores the
8596         intermediate result in a temporary value.  This fixes #40903.
8597
8598         *expression.cs (Indirection.ToString): Provide ToString method for
8599         debugging. 
8600
8601 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8602
8603         * class.cs: Null out fields holding references to Block objects so
8604         they can be garbage collected.
8605
8606         * expression.cs (OverloadResolve): Remove unused local.
8607
8608 2003-04-07  Martin Baulig  <martin@ximian.com>
8609
8610         * codegen.cs (EmitContext.CurrentFile): New public field.
8611         (EmitContext.Mark): Use the CurrentFile to check whether the
8612         location is in the correct file.
8613         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8614
8615 2003-04-07  Martin Baulig  <martin@ximian.com>
8616
8617         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8618
8619         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8620         location.  [FIXME: The location argument which gets passed to this
8621         method is sometimes wrong!]
8622
8623 2003-04-07  Nick Drochak <ndrochak@gol.com>
8624
8625         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8626
8627 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8628
8629         * expression.cs (Indirection.EmitAssign): We were using the
8630         temporary, but returning immediately instead of continuing the
8631         EmitAssing flow.
8632
8633 2003-04-06  Martin Baulig  <martin@ximian.com>
8634
8635         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8636         if it's a nested child, but also deriving from the outer class.
8637         See test 190.cs.
8638
8639         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8640         nested child, but also deriving from the outer class.  See
8641         test-190.cs.
8642         (FilterWithClosure): We may access private members of the outer
8643         class if we're a nested child and deriving from the outer class.
8644         (RealMemberLookup): Only set `closure_private_ok' if the
8645         `original_bf' contained BindingFlags.NonPublic.
8646
8647 2003-04-05  Martin Baulig  <martin@ximian.com>
8648
8649         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
8650
8651 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8652
8653         * class.cs (Event.Define): Do not allow abstract events to have
8654         initializers. 
8655
8656 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8657
8658         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8659         block in event declarations.
8660
8661         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8662         value type, get its address.
8663
8664         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8665         leaving a class on the stack instead of a boolean value (int
8666         0/1).  Change the code so we compare against null, and then the
8667         result against zero.
8668
8669         * class.cs (TypeContainer.GetClassBases): We were checking for the
8670         parent class being sealed too late.
8671
8672         * expression.cs (Binary.Emit): For <= and >= when dealing with
8673         floating point values, use cgt.un and clt.un instead of cgt and
8674         clt alone.
8675
8676 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8677
8678         * statement.cs: Apply the same optimization as MS: skip the 
8679         GetEnumerator returning an IEnumerator, and use the one returning a 
8680         CharEnumerator instead. This allows us to avoid the try-finally block 
8681         and the boxing.
8682
8683 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8684
8685         * cs-parser.jay: Attributes cannot be applied to
8686                          namespaces. Fixes #40473
8687
8688 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8689
8690         * class.cs:
8691         (Add*): check if the name is valid using the full name for constants,
8692         fields, properties and events.
8693
8694 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8695
8696         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8697         char constants to be part of the enumeration.
8698
8699         * expression.cs (Conditional.DoResolve): Add support for operator
8700         true. Implements the missing functionality from 14.12
8701
8702         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8703         operator true/false as required by the spec.
8704
8705         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8706         implicit conversion to boolean.
8707
8708         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8709         also one where the type implements `operator true'. 
8710
8711         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8712         get an expression that will invoke operator true based on an
8713         expression.  
8714
8715         (GetConversionOperators): Removed the hack that called op_True
8716         here.  
8717
8718         (Expression.ResolveBoolean): Move this from Statement.
8719
8720 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8721
8722         * ecore.cs (FieldExpr): do not allow initialization of initonly
8723         fields on derived classes
8724
8725 2003-03-13  Martin Baulig  <martin@ximian.com>
8726
8727         * statement.cs (Block.Emit): Call ig.BeginScope() and
8728         ig.EndScope() when compiling with debugging info; call
8729         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8730
8731 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8732
8733         * expression.cs (Indexers): Do not construct immediately, allow
8734         for new members to be appended as we go.  Fixes 38143
8735
8736 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8737
8738         * expression.cs: save/restore context when resolving an unchecked
8739         expression.
8740
8741 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8742
8743         * cfold.cs: Catch division by zero in modulus operator during
8744         constant folding.
8745
8746 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8747
8748         * interface.cs (Interface.DefineMembers): Avoid defining members
8749         twice. 
8750
8751 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * driver.cs: handle the +/- options for -noconfig
8754
8755         * statement.cs (Unckeched.Resolve): Also track the state of
8756         unchecked in the Resolve phase.
8757
8758 2003-02-27  Martin Baulig  <martin@ximian.com>
8759
8760         * ecore.cs (Expression.MemberLookup): Don't create a
8761         MethodGroupExpr for something which is not a method.  Fixes #38291.
8762
8763 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8764
8765         * class.cs (MemberBase.CheckParameters): Also check that the type
8766         is unmanaged if it is a pointer.
8767
8768         * expression.cs (SizeOf.Resolve): Add location information.
8769
8770         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8771         a managed type is declared.
8772
8773         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8774         parameter modifiers as well.  Fixes bug 38606
8775
8776         * class.cs: Very sad.  Am backing out the speed up changes
8777         introduced by the ArrayList -> Array in the TypeContainer, as they
8778         were not actually that much faster, and introduced a bug (no error
8779         reports on duplicated methods).
8780
8781         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8782         source first, this will guarantee that we have a valid expression
8783         before calling in lower levels functions that will require a
8784         resolved object.  Then use this original_source in the
8785         target.ResolveLValue instead of the original source that was
8786         passed to us.
8787
8788         Another change.  Use target.Resolve instead of LValueResolve.
8789         Although we are resolving for LValues, we will let the Assign code
8790         take care of that (it will be called again from Resolve).  This
8791         basically allows code like this:
8792
8793         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8794         class Y { void A (X x) { x [0] += o; }
8795
8796         The problem was that the indexer was trying to resolve for
8797         set_Item (idx, object o) and never finding one.  The real set_Item
8798         was set_Item (idx, X).  By delaying the process we get the right
8799         semantics. 
8800
8801         Fixes bug 36505
8802
8803 2003-02-23  Martin Baulig  <martin@ximian.com>
8804
8805         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8806         while calling DoEmit ().
8807
8808         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8809         source files; if you use the #line directive inside a method, the
8810         compiler stops emitting line numbers for the debugger until it
8811         reaches the end of the method or another #line directive which
8812         restores the original file.
8813
8814 2003-02-23  Martin Baulig  <martin@ximian.com>
8815
8816         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8817
8818 2003-02-23  Martin Baulig  <martin@ximian.com>
8819
8820         * statement.cs (Block.AddChildVariableNames): We need to call this
8821         recursively, not just for our immediate children.
8822
8823 2003-02-23  Martin Baulig  <martin@ximian.com>
8824
8825         * class.cs (Event.Define): Always make the field private, like csc does.
8826
8827         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8828         actually work, fixes bug #37521.
8829
8830 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8831
8832         * delegate.cs: When creating the various temporary "Parameters"
8833         classes, make sure that we call the ComputeAndDefineParameterTypes
8834         on those new parameters (just like we do with the formal ones), to
8835         allow them to be resolved in the context of the DeclSpace.
8836
8837         This fixes the bug that Dick observed in Bugzilla #38530.
8838
8839 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8840
8841         * expression.cs (ResolveMemberAccess): When resolving a constant,
8842         do not attempt to pull a constant if the value was not able to
8843         generate a valid constant.
8844
8845         * const.cs (LookupConstantValue): Do not report more errors than required.
8846
8847 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8848
8849         * expression.cs: fixes bug #38328.
8850
8851 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8852
8853         * class.cs: Changed all the various members that can be part of a
8854         class from being an ArrayList to be an Array of the right type.
8855         During the DefineType type_list, interface_list, delegate_list and
8856         enum_list are turned into types, interfaces, delegates and enums
8857         arrays.  
8858
8859         And during the member population, indexer_list, event_list,
8860         constant_list, field_list, instance_constructor_list, method_list,
8861         operator_list and property_list are turned into their real arrays.
8862
8863         Although we could probably perform this operation earlier, for
8864         good error reporting we need to keep the lists and remove the
8865         lists for longer than required.
8866
8867         This optimization was triggered by Paolo profiling the compiler
8868         speed on the output of `gen-sample-program.pl' perl script. 
8869
8870         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8871         not crash in methods like MemberLookupFailed that use this field.  
8872
8873         This problem arises when the compiler fails to resolve a type
8874         during interface type definition for example.
8875
8876 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8877
8878         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8879         inherit from System.Object, so we have to stop at null, not only
8880         when reaching System.Object.
8881
8882 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8883
8884         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8885         DeclaredOnly because the parent indexer might have had a different
8886         name, but did not loop until the top of the hierarchy was reached.
8887
8888         The problem this one fixes is 35492: when a class implemented an
8889         indexer from an interface, we were getting the interface method
8890         (which was abstract) and we were flagging an error (can not invoke
8891         abstract method).
8892
8893         This also keeps bug 33089 functioning, and test-148 functioning.
8894
8895         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8896         out if a method is special is to see if it is declared in a
8897         property or event, or whether it is one of the predefined operator
8898         names.   This should fix correctly #36804.
8899
8900 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8901
8902         The goal here is to remove the dependency on EmptyCast.Peel ().
8903         Killing it completely.
8904
8905         The problem is that currently in a number of places where
8906         constants are expected, we have to "probe" for an EmptyCast, and
8907         Peel, which is not the correct thing to do, as this will be
8908         repetitive and will likely lead to errors. 
8909
8910         The idea is to remove any EmptyCasts that are used in casts that
8911         can be reduced to constants, so we only have to cope with
8912         constants. 
8913
8914         This bug hunt was triggered by Bug 37363 and the desire to remove
8915         the duplicate pattern where we were "peeling" emptycasts to check
8916         whether they were constants.  Now constants will always be
8917         constants.
8918
8919         * ecore.cs: Use an enumconstant here instead of wrapping with
8920         EmptyCast.  
8921
8922         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8923         throwing me off.  By handling this we can get rid of a few hacks.
8924
8925         * statement.cs (Switch): Removed Peel() code.
8926
8927 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * class.cs: Location information for error 508
8930
8931         * expression.cs (New.DoResolve): Add a guard against double
8932         resolution of an expression.  
8933
8934         The New DoResolve might be called twice when initializing field
8935         expressions (see EmitFieldInitializers, the call to
8936         GetInitializerExpression will perform a resolve on the expression,
8937         and later the assign will trigger another resolution
8938
8939         This leads to bugs (#37014)
8940
8941         * delegate.cs: The signature for EndInvoke should contain any ref
8942         or out parameters as well.  We were not doing this in the past. 
8943
8944         * class.cs (Field.Define): Do not overwrite the type definition
8945         inside the `volatile' group.  Turns out that volatile enumerations
8946         were changing the type here to perform a validity test, which
8947         broke conversions. 
8948
8949 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
8950
8951         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
8952         and structs, we do not want to load the instance variable
8953
8954         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
8955         enum_type has to be handled like an object reference (implicit
8956         conversions exists from this to object), but the regular IsClass
8957         and IsValueType tests will never return true for this one.
8958
8959         Also we use TypeManager.IsValueType instead of type.IsValueType,
8960         just for consistency with the rest of the code (this is only
8961         needed if we ever use the construct exposed by test-180.cs inside
8962         corlib, which we dont today).
8963
8964 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
8965
8966         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
8967         just InternalCall.
8968
8969 2003-02-09  Martin Baulig  <martin@ximian.com>
8970
8971         * namespace.cs (Namespace..ctor): Added SourceFile argument.
8972         (Namespace.DefineNamespaces): New static public method; this is
8973         called when we're compiling with debugging to add all namespaces
8974         to the symbol file.
8975
8976         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
8977         pass it to the Namespace's .ctor.
8978
8979         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
8980         and MethodBase arguments; pass the namespace ID to the symwriter;
8981         pass the MethodBase instead of the token to the symwriter.
8982         (SymbolWriter.DefineNamespace): New method to add a namespace to
8983         the symbol file.
8984
8985 2003-02-09  Martin Baulig  <martin@ximian.com>
8986
8987         * symbolwriter.cs: New file.  This is a wrapper around
8988         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
8989         methods here in near future.
8990
8991 2003-02-09  Martin Baulig  <martin@ximian.com>
8992
8993         * codegen.cs (EmitContext.Mark): Just pass the arguments to
8994         ILGenerator.MarkSequencePoint() which are actually used by the
8995         symbol writer.
8996
8997 2003-02-09  Martin Baulig  <martin@ximian.com>
8998
8999         * location.cs (SourceFile): New public sealed class.  This
9000         contains the name and an index which is used in the location's token.
9001         (Location): Reserve an appropriate number of bits in the token for
9002         the source file instead of walking over that list, this gives us a
9003         really huge performance improvement when compiling with debugging.
9004
9005         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9006         `SourceFile' argument instead of a string.
9007         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9008         but don't parse/tokenize here, we need to generate the list of all
9009         source files before we do that.
9010         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9011         the files.
9012
9013         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9014         instead of a string.
9015
9016         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9017         of a string.
9018
9019 2003-02-09  Martin Baulig  <martin@ximian.com>
9020
9021         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9022         filename on `#line default'.
9023
9024 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9025
9026         * statement.cs: don't clear the pinned var when the fixed statement
9027         returns from the method (fixes bug#37752).
9028
9029 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9030
9031         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9032         to IsValueType.
9033
9034 2003-02-07  Martin Baulig  <martin@ximian.com>
9035
9036         * driver.cs: Removed the `--debug-args' command line argument.
9037
9038         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9039         automatically by the AsssemblyBuilder.
9040         (CodeGen.InitializeSymbolWriter): We don't need to call any
9041         initialization function on the symbol writer anymore.  This method
9042         doesn't take any arguments.
9043
9044 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9045
9046         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9047         from referenced assemblies as well.
9048
9049 2003-02-02  Martin Baulig  <martin@ximian.com>
9050
9051         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9052
9053 2003-02-02  Martin Baulig  <martin@ximian.com>
9054
9055         * class.cs (Constructor.Emit): Open the symbol writer before
9056         emitting the constructor initializer.
9057         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9058         single-stepping through constructor initializers.
9059
9060 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9061
9062         * class.cs: Handle error 549: do not allow virtual methods in
9063         sealed classes. 
9064
9065 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9066
9067         * decl.cs: Check access levels when resolving types
9068
9069 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9070
9071         * statement.cs: Add parameters and locals set in catch blocks that might 
9072         return to set vector
9073
9074 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9075
9076         * class.cs (Operator): Set the SpecialName flags for operators.
9077
9078         * expression.cs (Invocation.DoResolve): Only block calls to
9079         accessors and operators on SpecialName methods.
9080
9081         (Cast.TryReduce): Handle conversions from char constants.
9082
9083
9084 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9085
9086         * statement.cs: small memory and time optimization in FlowBranching.
9087
9088 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9089
9090         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9091         problem that the last fix but in the other sid (Set).
9092
9093         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9094         access when there is no indexer in the hierarchy.
9095
9096 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9097
9098         * class.cs: Combine some if statements.
9099
9100 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9101
9102         * driver.cs: fixed bug #37187.
9103
9104 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9105
9106         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9107         any indexer, it's needed to build a list with all the indexers in the
9108         hierarchy (AllGetters), else we have problems. Fixes #35653.
9109
9110 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9111
9112         * class.cs (MethodData.Define): It is wrong for an interface
9113         implementation to be static in both cases: explicit and implicit.
9114         We were only handling this in one case.
9115
9116         Improve the if situation there to not have negations.
9117
9118         * class.cs (Field.Define): Turns out that we do not need to check
9119         the unsafe bit on field definition, only on usage.  Remove the test.
9120
9121 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9122
9123         * driver.cs: use assembly.Location instead of Codebase (the latest
9124         patch made mcs fail when using MS assemblies).
9125
9126 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9127
9128         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9129         get the path to *corlib.dll.
9130
9131 2003-01-21  Nick Drochak <ndrochak@gol.com>
9132
9133         * cs-tokenizer.cs:
9134         * pending.cs:
9135         * typemanager.cs: Remove compiler warnings
9136
9137 2003-01-20  Duncan Mak  <duncan@ximian.com>
9138
9139         * AssemblyInfo.cs: Bump the version number to 0.19.
9140
9141 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9142
9143         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9144
9145 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9146
9147         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9148
9149 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9150
9151         * cs-parser.jay: Small fix: we were not comparing the constructor
9152         name correctly.   Thanks to Zoltan for the initial pointer.
9153
9154 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9155
9156         * cs-tokenizer.cs: Set file name when specified with #line
9157
9158 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9159
9160         * cs-parser.jay: Only perform the constructor checks here if we
9161         are named like the class;  This will help provider a better
9162         error.  The constructor path is taken when a type definition is
9163         not found, but most likely the user forgot to add the type, so
9164         report that rather than the constructor error.
9165
9166 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9167
9168         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9169         allocations.
9170
9171 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9172
9173         * cs-parser.jay: Add cleanup call.
9174
9175 2003-01-13  Duncan Mak  <duncan@ximian.com>
9176
9177         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9178         consistent with other methods.
9179
9180 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9181
9182         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9183
9184 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9185
9186         * attribute.cs: only set GuidAttr to true when we have a
9187         GuidAttribute.
9188
9189 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9190
9191         * ecore.cs:
9192         * expression.cs:
9193         * typemanager.cs: fixes to allow mcs compile corlib with the new
9194         Type.IsSubclassOf fix.
9195
9196 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9197
9198         * expression.cs (LocalVariableReference.DoResolve): Classify a
9199         constant as a value, not as a variable.   Also, set the type for
9200         the variable.
9201
9202         * cs-parser.jay (fixed_statement): take a type instead of a
9203         pointer_type, so we can produce a better error message later.
9204
9205         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9206         as an error.  
9207
9208         (For.DoEmit): Make inifinite loops have a
9209         non-conditional branch back.
9210
9211         (Fixed.DoEmit): First populate the pinned variables, then emit the
9212         statement, then clear the variables.  Before I was emitting the
9213         code once for each fixed piece.
9214
9215
9216 2003-01-08  Martin Baulig  <martin@ximian.com>
9217
9218         * statement.cs (FlowBranching.MergeChild): A break in a
9219         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9220
9221 2003-01-08  Martin Baulig  <martin@ximian.com>
9222
9223         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9224         lives in the same number space than `param_map'.  Fixes #36154.
9225
9226 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9227
9228         * cs-parser.jay (constructor_declaration): Set the
9229         Constructor.ModFlags before probing for it.  This makes the
9230         compiler report 514, 515 and 132 (the code was there, but got
9231         broken). 
9232
9233         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9234         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9235         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9236
9237 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9238
9239         * enum.cs: create the enum static fields using the enum type.
9240
9241 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9242
9243         * class.cs: don't try to create the ParamBuilder for the return
9244         type if it's not needed (and handle it breaking for the ms runtime
9245         anyway).
9246
9247 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9248
9249         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9250
9251 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9252
9253         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9254         the command.   This showed up while compiling the JANET source
9255         code, which used \r as its only newline separator.
9256
9257 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9258
9259         * class.cs (Method.Define): If we are an operator (because it
9260         reuses our code), then set the SpecialName and HideBySig.  #36128
9261
9262 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9263
9264         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9265         exception, report error 120 `object reference required'.
9266
9267         * driver.cs: Add --pause option, used during to measure the size
9268         of the process as it goes with --timestamp.
9269
9270         * expression.cs (Invocation.DoResolve): Do not allow methods with
9271         SpecialName to be invoked.
9272
9273 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9274
9275         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9276         number before adding it.
9277
9278 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9279
9280         * ecore.cs (StandardImplicitConversion): When in an unsafe
9281         context, we allow conversion between void * to any other pointer
9282         type. This fixes bug #35973.
9283
9284 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9285
9286         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9287         is not thrown when extensionless outputs are used 
9288
9289 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9290
9291         * rootcontext.cs: fixed compilation of corlib.
9292
9293 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9294
9295         * attribute.cs (Attributes.Contains): Add new method.
9296
9297         * class.cs (MethodCore.LabelParameters): if the parameter is an
9298         `out' parameter, check that no attribute `[In]' has been passed.
9299
9300         * enum.cs: Handle the `value__' name in an enumeration.
9301
9302 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9303
9304         * decl.cs: Added special case to allow overrides on "protected
9305         internal" methods
9306
9307 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9308
9309         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9310         since it makes much more sense.
9311
9312         (Attributes.ctor): Don't require a Location parameter.
9313
9314         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9315
9316         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9317         since we already have that information per attribute.
9318
9319         * everywhere : make appropriate changes.
9320
9321         * class.cs (LabelParameters): Write the code which actually
9322         applies attributes to the return type. We can't do this on the MS
9323         .NET runtime so we flag a warning in the case an exception is
9324         thrown.
9325
9326 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * const.cs: Handle implicit null conversions here too.
9329
9330 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9331
9332         * class.cs (MethodCore.LabelParameters): Remove the extra
9333         Type [] parameter since it is completely unnecessary. Instead
9334         pass in the method's attributes so that we can extract
9335         the "return" attribute.
9336
9337 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9340         of ignoring it and letting the compile continue.
9341
9342         * typemanager.cs (ChangeType): use an extra argument to return an
9343         error condition instead of throwing an exception.
9344
9345 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9346
9347         * expression.cs (Unary.TryReduce): mimic the code for the regular
9348         code path.  Perform an implicit cast in the cases where we can
9349         implicitly convert to one of the integral types, and then reduce
9350         based on that constant.   This fixes bug #35483.
9351
9352 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9353
9354         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9355
9356 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9357
9358         * namespace.cs: fixed bug #35489.
9359
9360 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9361
9362         * class.cs: Remove some dead code.
9363
9364         * cs-parser.jay: Estimate the number of methods needed
9365         (RootContext.MethodCount);
9366
9367         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9368         numbers instead of StringBuilders.
9369
9370         * support.cs (PtrHashtable): Add constructor with initial size;
9371         We can now reduce reallocations of the method table.
9372
9373 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9374
9375         * attribute.cs (ApplyAttributes): Keep track of the emitted
9376         attributes on a per-target basis. This fixes bug #35413.
9377
9378 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9379
9380         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9381         default to the Windows 1252 encoding.
9382
9383         (UnixParseOption): Support version, thanks to Alp for the missing
9384         pointer. 
9385
9386         * AssemblyInfo.cs: Add nice assembly information.
9387
9388         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9389         (bug 35169).
9390
9391         * cs-parser.jay: Allow a trailing comma before the close bracked
9392         in the attribute_section production.
9393
9394         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9395         address of the instance was being taken, I will take this out,
9396         because we take the address of the object immediately here.
9397
9398 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9399
9400         * typemanager.cs (AreMultipleAllowed): Take care of the most
9401         obvious case where attribute type is not in the current assembly -
9402         stupid me ;-)
9403
9404 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9405
9406         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9407         definitions, instead of doing that afterwards.  
9408
9409         Also we use a nice little hack, depending on the constructor, we
9410         know if we are a "composed" name or a simple name.  Hence, we
9411         avoid the IndexOf test, and we avoid 
9412
9413         * codegen.cs: Add code to assist in a bug reporter to track down
9414         the source of a compiler crash. 
9415
9416 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9417
9418         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9419         types have been emitted for a given element and flag an error
9420         if something which does not have AllowMultiple set is used more
9421         than once.
9422
9423         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9424         attribute types and their corresponding AllowMultiple properties
9425
9426         (AreMultipleAllowed): Check the property for a given type.
9427
9428         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9429         property in the case we have a TypeContainer.
9430
9431         (Attributes.AddAttribute): Detect duplicates and just skip on
9432         adding them. This trivial fix catches a pretty gross error in our
9433         attribute emission - global attributes were being emitted twice!
9434
9435         Bugzilla bug #33187 is now fixed.
9436
9437 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9438
9439         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9440         instead of pp_and).
9441
9442         * expression.cs (Binary.ResolveOperator): I can only use the
9443         Concat (string, string, string) and Concat (string, string,
9444         string, string) if the child is actually a concatenation of
9445         strings. 
9446
9447 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9448
9449         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9450         context where we need a 2-character lookahead.
9451
9452         * pending.cs (PendingImplementation): Rework so we can keep track
9453         of interface types all the time, and flag those which were
9454         implemented by parents as optional.
9455
9456 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9457
9458         * expression.cs (Binary.ResolveOperator): Use
9459         String.Concat(string,string,string) or
9460         String.Concat(string,string,string,string) when possible. 
9461
9462         * typemanager: More helper methods.
9463
9464
9465 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9466
9467         * pending.cs: remove the bogus return from GetMissingInterfaces()
9468         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9469
9470 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9471
9472         * namespace.cs: avoid duplicated 'using xxx' being added to
9473         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9474         when we get more than one 'using' statement for the same namespace.
9475         Report a CS0105 warning for it.
9476
9477 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9478
9479         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9480         of calling getChar/putback, uses internal knowledge of it.    
9481
9482         (xtoken): Reorder tokenizer so most common patterns are checked
9483         first.  This reduces the compilation time in another 5% (from 8.11s
9484         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9485
9486         The parsing time is 22% of the compilation in mcs, and from that
9487         64% is spent on the tokenization process.  
9488
9489         I tried using a binary search for keywords, but this is slower
9490         than the hashtable.  Another option would be to do a couple of
9491         things:
9492
9493                 * Not use a StringBuilder, instead use an array of chars,
9494                   with a set value.  Notice that this way we could catch
9495                   the 645 error without having to do it *afterwards*.
9496
9497                 * We could write a hand-parser to avoid the hashtable
9498                   compares altogether.
9499
9500         The identifier consumption process takes 37% of the tokenization
9501         time.  Another 15% is spent on is_number.  56% of the time spent
9502         on is_number is spent on Int64.Parse:
9503
9504                 * We could probably choose based on the string length to
9505                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9506                   computations. 
9507
9508         Another 3% is spend on wrapping `xtoken' in the `token' function.
9509
9510         Handle 0xa0 as whitespace (#34752)
9511
9512 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9513
9514         * typemanager.cs (IsCLRType): New routine to tell whether a type
9515         is one of the builtin types.  
9516
9517         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9518         typecode in more places instead of doing pointer comparissions.
9519         We could leverage some knowledge about the way the typecodes are
9520         laid out.
9521
9522         New code to cache namespaces in assemblies, it is currently not
9523         invoked, to be used soon.
9524
9525         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9526
9527         * expression.cs (Binary.ResolveOperator): specially handle
9528         strings, and do not perform user-defined operator overloading for
9529         built-in types.
9530
9531 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9534         internalcall as it is a pretty simple operation;  Avoid whenever
9535         possible to call Char.IsLetter.
9536
9537         (consume_identifier): Cut by half the number of
9538         hashtable calls by merging the is_keyword and GetKeyword behavior.
9539
9540         Do not short-circuit, because if we do, we
9541         report errors (ie, #if false && true would produce an invalid
9542         directive error);
9543
9544
9545 2002-11-24  Martin Baulig  <martin@ximian.com>
9546
9547         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9548         check constant ranges and report a CS0221.  Fixes #33186.
9549
9550 2002-11-24  Martin Baulig  <martin@ximian.com>
9551
9552         * cs-parser.jay: Make this work for uninitialized variable
9553         declarations in the `for' initializer.  Fixes #32416.
9554
9555 2002-11-24  Martin Baulig  <martin@ximian.com>
9556
9557         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9558         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9559
9560 2002-11-24  Martin Baulig  <martin@ximian.com>
9561
9562         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9563         argument; if true, we also check for user-defined conversions.
9564         This is only needed if both arguments are of a user-defined type.
9565         Fixes #30443, added test-175.cs.
9566         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9567
9568         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9569
9570 2002-11-24  Martin Baulig  <martin@ximian.com>
9571
9572         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9573         function to get the store opcode.
9574         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9575         only emit the Ldelema if the store opcode is Stobj.  You must run
9576         both test-34 and test-167 to test this.  Fixes #34529.
9577
9578 2002-11-23  Martin Baulig  <martin@ximian.com>
9579
9580         * ecore.cs (Expression.MemberLookup): Added additional
9581         `qualifier_type' argument which is used when we're being called
9582         from MemberAccess.DoResolve() and null if we're called from a
9583         SimpleName lookup.
9584         (Expression.MemberLookupFailed): New method to report errors; this
9585         does the CS1540 check and reports the correct error message.
9586
9587         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9588         argument for the CS1540 check and redone the way how we're dealing
9589         with private members.  See the comment in the source code for details.
9590         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9591         `closure_start_type' to `closure_qualifier_type' and check whether
9592         it's not null.  It was not this filter being broken, it was just
9593         being called with the wrong arguments.
9594
9595         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9596         and pass it the correct `qualifier_type'; this also does the error
9597         handling for us.
9598
9599 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9600
9601         * expression.cs (Invocation.EmitParams): If the we are dealing
9602         with a non-built-in value type, load its address as well.
9603
9604         (ArrayCreation): Use a a pretty constant instead
9605         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9606         static initializers.  
9607
9608         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9609         because they are not really value types, just glorified integers. 
9610
9611         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9612
9613         * ecore.cs: Remove redundant code for enumerations, make them use
9614         the same code path as everything else, fixes the casting issue
9615         with enumerations in Windows.Forms.
9616
9617         * attribute.cs: Do only cast to string if it is a string, the
9618         validation happens later.
9619
9620         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9621         people upgrade their corlibs.
9622
9623         * ecore.cs: Oops, enumerations were not following the entire code path
9624
9625 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9626
9627         * typemanager.cs (FilterWithClosure): Commented out the test for
9628         1540 in typemanager.cs, as it has problems when accessing
9629         protected methods from a parent class (see test-174.cs). 
9630
9631         * attribute.cs (Attribute.ValidateGuid): new method.
9632         (Attribute.Resolve): Use above.
9633
9634 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9635
9636         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9637
9638         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9639         handling for enumerations, as we only needed the TypeContainer
9640         functionality to begin with (this is required for the fix below to
9641         work for enums that reference constants in a container class for
9642         example). 
9643
9644         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9645
9646         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9647         a valid TypeBuilder to perform lookups on.o
9648
9649         * class.cs (InheritableMemberSignatureCompare): Use true in the
9650         call to GetGetMethod and GetSetMethod, because we are comparing
9651         the signature, and we need to get the methods *even* if they are
9652         private. 
9653
9654         (PropertyBase.CheckBase): ditto.
9655
9656         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9657         GotoCase.Resolve): Use Peel on EmpytCasts.
9658
9659         * ecore.cs (EmptyCast): drop child, add Peel method.
9660
9661 2002-11-17  Martin Baulig  <martin@ximian.com>
9662
9663         * ecore.cs (EmptyCast.Child): New public property.
9664
9665         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9666         label resolved to an EmptyCast.  Fixes #34162.
9667         (GotoCase.Resolve): Likewise.
9668         (Block.EmitMeta): Likewise.
9669
9670 2002-11-17  Martin Baulig  <martin@ximian.com>
9671
9672         * expression.cs (Invocation.BetterConversion): Prefer int over
9673         uint; short over ushort; long over ulong for integer literals.
9674         Use ImplicitConversionExists instead of StandardConversionExists
9675         since we also need to check for user-defined implicit conversions.
9676         Fixes #34165.  Added test-173.cs.
9677
9678 2002-11-16  Martin Baulig  <martin@ximian.com>
9679
9680         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9681         with the `true' and `false' literals.  Fixes #33151.
9682
9683 2002-11-16  Martin Baulig  <martin@ximian.com>
9684
9685         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9686         October 22nd; don't do the cs1540 check for static members.
9687
9688         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9689         now using our own filter here and doing the cs1540 check again.
9690
9691 2002-11-16  Martin Baulig  <martin@ximian.com>
9692
9693         * support.cs (InternalParameters): Don't crash if we don't have
9694         any fixed parameters.  Fixes #33532.
9695
9696 2002-11-16  Martin Baulig  <martin@ximian.com>
9697
9698         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9699         when looking up static methods to make this work on Windows.
9700         Fixes #33773.
9701
9702 2002-11-16  Martin Baulig  <martin@ximian.com>
9703
9704         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9705         a setter rather than using PropertyInfo.CanWrite.
9706
9707 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9708
9709         * class.cs: Allow acces to block member by subclasses. Fixes build
9710         breaker.
9711
9712 2002-11-14  Martin Baulig  <martin@ximian.com>
9713
9714         * class.cs (Constructor.Emit): Added the extern/block check.
9715         Fixes bug #33678.
9716
9717 2002-11-14  Martin Baulig  <martin@ximian.com>
9718
9719         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9720         iteration while looking for indexers, this is needed because the
9721         indexer may have a different name in our base classes.  Fixed the
9722         error reporting (no indexers at all, not get accessor, no
9723         overloaded match).  Fixes bug #33089.
9724         (IndexerAccess.DoResolveLValue): Likewise.
9725
9726 2002-11-14  Martin Baulig  <martin@ximian.com>
9727
9728         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9729         indexers.  Fixes the first part of bug #33089.
9730         (MethodSignature.InheritableMemberSignatureCompare): Added support
9731         for properties.
9732
9733 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9734
9735         * attribute.cs (Attribute.Resolve): Catch the
9736         NullReferenceException and report it since it isn't supposed to
9737         happen. 
9738
9739 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9740
9741         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9742         LogicalOr and LogicalAnd that can benefit from recursively
9743         handling EmitBranchable.  The code now should be nice for Paolo.
9744
9745 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9746
9747         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9748         the Type lookups, as we perform quite a number of lookups on
9749         non-Types.  This can be removed once we can deterministically tell
9750         whether we have a type or a namespace in advance.
9751
9752         But this might require special hacks from our corlib.
9753
9754         * TODO: updated.
9755
9756         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9757         and double which avoids a conversion from an integer to a double.
9758
9759         * expression.cs: tiny optimization, avoid calling IsConstant,
9760         because it effectively performs the lookup twice.
9761
9762 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9763
9764         But a bogus return here to keep the semantics of the old code
9765         until the Mono runtime is fixed.
9766
9767         * pending.cs (GetMissingInterfaces): New method used to remove all
9768         the interfaces that are already implemented by our parent
9769         classes from the list of pending methods. 
9770
9771         * interface.cs: Add checks for calls after ResolveTypeExpr.
9772
9773 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * class.cs (Class.Emit): Report warning 67: event not used if the
9776         warning level is beyond 3.
9777
9778         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9779         being a NullLiteral.
9780
9781         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9782         specifiers. 
9783
9784         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9785         path that might fail if a type can not be resolved.
9786
9787         * expression.cs (Binary.Emit): Emit unsigned versions of the
9788         operators. 
9789
9790         * driver.cs: use error 5.
9791
9792 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9793
9794         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9795
9796 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * cs-parser.jay (switch_section): A beautiful patch from Martin
9799         Baulig that fixed 33094.
9800
9801 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9802
9803         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9804         Check whether the base is abstract and report an error if so.
9805
9806         * expression.cs (IndexerAccess.DoResolveLValue,
9807         IndexerAccess.DoResolve): ditto. 
9808
9809         (Invocation.DoResolve): ditto.
9810
9811         (Invocation.FullMethodDesc): Improve the report string.
9812
9813         * statement.cs (Block): Eliminate IsVariableDefined as it is
9814         basically just a wrapper for GetVariableInfo.
9815
9816         * ecore.cs (SimpleName): Use new 
9817
9818         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9819         type, as we return the actual parameter ref/unref state on a
9820         different call.
9821
9822 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9823
9824         * support.cs: Return proper flags REF/OUT fixing the previous
9825         commit.  
9826
9827         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9828         not used to mean `ref' but `ref or out' in ParameterReference
9829
9830         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9831         full type signature instead of calling TypeManger.CSharpName
9832         ourselves. 
9833
9834         * support.cs (InternalParameters.ParameterDesc): Do not compare
9835         directly to the modflags, because REF/OUT will actually be bitsets
9836         if set. 
9837
9838         * delegate.cs (VerifyMethod): Check also the modifiers.
9839
9840         * cs-tokenizer.cs: Fix bug where floating point values with an
9841         exponent where a sign was missing was ignored.
9842
9843         * driver.cs: Allow multiple assemblies to be specified in a single
9844         /r: argument
9845
9846 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9849         because identifiers after a parenthesis would end up in this kind
9850         of production, and we needed to desamiguate it for having casts
9851         like:
9852
9853                 (UserDefinedType *) xxx
9854
9855 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9856
9857         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9858         we should set on the Bindingflags.NonPublic, but not turn on
9859         private_ok.  private_ok controls whether a Private member is
9860         returned (this is chekced on the filter routine), while the
9861         BindingFlags.NonPublic just controls whether private/protected
9862         will be allowed.   This fixes the problem part of the problem of
9863         private properties being allowed to be used in derived classes.
9864
9865         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9866         so we can call the children DoResolveLValue method (this will
9867         properly signal errors on lvalue assignments to base properties)
9868
9869         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9870         getter are null, and we have a property info, we know that this
9871         happened because the lookup failed, so we report an error 122 for
9872         protection level violation.
9873
9874         We also silently return if setter and getter are null in the
9875         resolve functions, this condition only happens if we have flagged
9876         the error before.  This is the other half of the problem. 
9877
9878         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9879         not have accessibility information, that is why we were returning
9880         true in the filter function in typemanager.cs.
9881
9882         To properly report 122 (property is inaccessible because of its
9883         protection level) correctly, we report this error in ResolveAccess
9884         by failing if both the setter and the getter are lacking (ie, the
9885         lookup failed). 
9886
9887         DoResolve and DoLResolve have been modified to check for both
9888         setter/getter being null and returning silently, the reason being
9889         that I did not want to put the knowledge about this error in upper
9890         layers, like:
9891
9892         int old = Report.Errors;
9893         x = new PropertyExpr (...);
9894         if (old != Report.Errors)
9895                 return null;
9896         else
9897                 return x;
9898
9899         So the property expr is returned, but it is invalid, so the error
9900         will be flagged during the resolve process. 
9901
9902         * class.cs: Remove InheritablePropertySignatureCompare from the
9903         class, as we no longer depend on the property signature to compute
9904         whether it is possible to implement a method or not.
9905
9906         The reason is that calling PropertyInfo.GetGetMethod will return
9907         null (in .NET, in Mono it works, and we should change this), in
9908         cases where the Get Method does not exist in that particular
9909         class.
9910
9911         So this code:
9912
9913         class X { public virtual int A { get { return 1; } } }
9914         class Y : X { }
9915         class Z : Y { public override int A { get { return 2; } } }
9916
9917         Would fail in Z because the parent (Y) would not have the property
9918         defined.  So we avoid this completely now (because the alternative
9919         fix was ugly and slow), and we now depend exclusively on the
9920         method names.
9921
9922         (PropertyBase.CheckBase): Use a method-base mechanism to find our
9923         reference method, instead of using the property.
9924
9925         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9926         routines are gone now.
9927
9928         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9929         names, they were incorrectly named.
9930
9931         * cs-tokenizer.cs: Return are more gentle token on failure. 
9932
9933         * pending.cs (PendingImplementation.InterfaceMethod): This routine
9934         had an out-of-sync index variable, which caused it to remove from
9935         the list of pending methods the wrong method sometimes.
9936
9937 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
9938
9939         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9940         CanWrite, because those refer to this particular instance of the
9941         property, and do not take into account the fact that we can
9942         override single members of a property.
9943
9944         Constructor requires an EmitContext.  The resolution process does
9945         not happen here, but we need to compute the accessors before,
9946         because the resolution does not always happen for properties.
9947
9948         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
9949         subclass, before we did not update this flag, but we did update
9950         bindingflags. 
9951
9952         (GetAccessors): Drop this routine, as it did not work in the
9953         presence of partially overwritten set/get methods. 
9954
9955         Notice that this broke the cs1540 detection, but that will require
9956         more thinking. 
9957
9958 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9959
9960         * class.cs:
9961         * codegen.cs:
9962         * driver.cs: issue a warning instead of an error if we don't support
9963         debugging for the platform. Also ignore a couple of errors that may
9964         arise when trying to write the symbols. Undo my previous patch.
9965
9966 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9967
9968         * driver.cs: ignore /debug switch except for Unix platforms.
9969
9970 2002-10-23  Nick Drochak  <ndrochak@gol.com>
9971
9972         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
9973
9974 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
9975
9976         * driver.cs: Do not make mcs-debug conditional, so we do not break
9977         builds that use it.
9978
9979         * statement.cs (UsageVector.MergeChildren): I would like Martin to
9980         review this patch.  But basically after all the children variables
9981         have been merged, the value of "Breaks" was not being set to
9982         new_breaks for Switch blocks.  I think that it should be set after
9983         it has executed.  Currently I set this to the value of new_breaks,
9984         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
9985         conservative, but I do not understand this code very well.
9986
9987         I did not break anything in the build, so that is good ;-)
9988
9989         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
9990
9991 2002-10-20  Mark Crichton  <crichton@gimp.org>
9992
9993         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
9994
9995 2002-10-20  Nick Drochak  <ndrochak@gol.com>
9996
9997         * cfold.cs: Fixed compile blocker.
9998
9999 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10000
10001         * driver.cs: I was chekcing the key, not the file.
10002
10003 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10004
10005         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10006         message that we were generating - we just need to silently return
10007         a null.
10008
10009 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10010
10011         * class.cs (Event.Define): Change my previous commit, as this
10012         breaks the debugger.  This is a temporary hack, as it seems like
10013         the compiler is generating events incorrectly to begin with.
10014
10015         * expression.cs (Binary.ResolveOperator): Added support for 
10016         "U operator - (E x, E y)"
10017
10018         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10019         y)".
10020
10021         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10022         init-only variables, but this path did not take into account that
10023         there might be also instance readonly variables.  Correct this
10024         problem. 
10025
10026         This fixes bug 32253
10027
10028         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10029         delegates as well.
10030
10031         * driver.cs: Change the extension for modules to `netmodule'
10032
10033         * cs-parser.jay: Improved slightly the location tracking for
10034         the debugger symbols.
10035
10036         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10037         modifiers that were specified instead of the hardcoded value
10038         (FamAndAssem).  This was basically ignoring the static modifier,
10039         and others.  Fixes 32429.
10040
10041         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10042         fixed a bug in the process (32476)
10043
10044         * expression.cs (ArrayAccess.EmitAssign): Patch from
10045         hwang_rob@yahoo.ca that fixes bug 31834.3
10046
10047 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10048
10049         * driver.cs: Make the module extension .netmodule.
10050
10051 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10052
10053         * driver.cs: Report an error if the resource file is not found
10054         instead of crashing.
10055
10056         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10057         false, like Emit does.
10058
10059 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10060
10061         * typemanager.cs: Remove unused private member.  Also reported mcs
10062         bug to report this as a warning like csc.
10063
10064 2002-10-15  Martin Baulig  <martin@gnome.org>
10065
10066         * statement.cs (Statement.Emit): Made this a virtual method; emits
10067         the line number info and calls DoEmit().
10068         (Statement.DoEmit): New protected abstract method, formerly knows
10069         as Statement.Emit().
10070
10071         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10072
10073 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10074
10075         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10076         have fixed a remaining problem: not every AddXXXX was adding a
10077         fully qualified name.  
10078
10079         Now everyone registers a fully qualified name in the DeclSpace as
10080         being defined instead of the partial name.  
10081
10082         Downsides: we are slower than we need to be due to the excess
10083         copies and the names being registered this way.  
10084
10085         The reason for this is that we currently depend (on the corlib
10086         bootstrap for instance) that types are fully qualified, because
10087         we dump all the types in the namespace, and we should really have
10088         types inserted into the proper namespace, so we can only store the
10089         basenames in the defined_names array.
10090
10091 2002-10-10  Martin Baulig  <martin@gnome.org>
10092
10093         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10094         from bug #31834, see the bug report for a testcase which is
10095         miscompiled.
10096
10097 2002-10-10  Martin Baulig  <martin@gnome.org>
10098
10099         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10100         flow analysis code for this.
10101
10102         * statement.cs (Do, While, For): Tell the flow analysis code about
10103         infinite loops.
10104         (FlowBranching.UsageVector): Added support for infinite loops.
10105         (Block.Resolve): Moved the dead code elimination here and use flow
10106         analysis to do it.
10107
10108 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10109
10110         * class.cs (Field.Define): Catch cycles on struct type
10111         definitions. 
10112
10113         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10114         fields if the fields are static.  We only need to check instance
10115         fields. 
10116
10117         * expression.cs (As.DoResolve): Test for reference type.
10118
10119         * statement.cs (Using.ResolveExpression): Use
10120         ConvertImplicitRequired, not ConvertImplicit which reports an
10121         error on failture
10122         (Using.ResolveLocalVariableDecls): ditto.
10123
10124         * expression.cs (Binary.ResolveOperator): Report errors in a few
10125         places where we had to.
10126
10127         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10128
10129 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10130
10131         * expression.cs: Use StoreFromPtr instead of extracting the type
10132         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10133
10134         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10135         an enumeration value to a System.Enum, but System.Enum is not a
10136         value type, but an class type, so we need to box.
10137
10138         (Expression.ConvertExplicit): One codepath could return
10139         errors but not flag them.  Fix this.  Fixes #31853
10140
10141         * parameter.cs (Resolve): Do not allow void as a parameter type.
10142
10143 2002-10-06  Martin Baulig  <martin@gnome.org>
10144
10145         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10146         if it's a class type and not a struct.  Fixes #31815.
10147
10148 2002-10-06  Martin Baulig  <martin@gnome.org>
10149
10150         * statement.cs: Reworked the flow analysis code a bit to make it
10151         usable for dead code elimination.
10152
10153 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10154
10155         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10156
10157 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10158
10159         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10160         to fix the test 165, will investigate deeper.
10161
10162 2002-10-04  Martin Baulig  <martin@gnome.org>
10163
10164         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10165         finally blocks actually work.
10166         (Try.Resolve): We don't need to create a sibling for `finally' if
10167         there is no finally block.
10168
10169 2002-10-04  Martin Baulig  <martin@gnome.org>
10170
10171         * class.cs (Constructor.Define): The default accessibility for a
10172         non-default constructor is private, not public.
10173
10174 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10175
10176         * class.cs (Constructor): Make AllowedModifiers public, add
10177         EXTERN.
10178
10179         * cs-parser.jay: Perform the modifiers test here, as the
10180         constructor for the Constructor class usually receives a zero
10181         because of the way we create it (first we create, later we
10182         customize, and we were never checking the modifiers).
10183
10184         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10185         is a version of LookupTypeReflection that includes the type-name
10186         cache.  This can be used as a fast path for functions that know
10187         the fully qualified name and are only calling into *.GetType() to
10188         obtain a composed type.
10189
10190         This is also used by TypeManager.LookupType during its type
10191         composition.
10192
10193         (LookupType): We now also track the real type name, as sometimes
10194         we can get a quey for the real type name from things like
10195         ComposedCast.  This fixes bug 31422.
10196
10197         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10198         complete type fullname, it does not have to go through the type
10199         resolution system to obtain the composed version of the type (for
10200         obtaining arrays or pointers).
10201
10202         (Conditional.Emit): Use the EmitBoolExpression to
10203         generate nicer code, as requested by Paolo.
10204
10205         (ArrayCreation.CheckIndices): Use the patch from
10206         hwang_rob@yahoo.ca to validate the array initializers. 
10207
10208 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10209
10210         * class.cs (ConstructorInitializer.Emit): simplify code by using
10211         Invocation.EmitCall, and at the same time, fix the bugs in calling
10212         parent constructors that took variable arguments. 
10213
10214         * ecore.cs (Expression.ConvertNumericExplicit,
10215         Expression.ImplicitNumericConversion): Remove the code that
10216         manually wrapped decimal (InternalTypeConstructor call is now gone
10217         as well).
10218
10219         * expression.cs (Cast.TryReduce): Also handle decimal types when
10220         trying to perform a constant fold on the type.
10221
10222         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10223
10224         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10225         that only turned off an error report, and did nothing else. 
10226
10227 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * driver.cs: Handle and ignore /fullpaths
10230
10231 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10232
10233         * expression.cs (Binary.ResolveOperator): Catch the case where
10234         DoNumericPromotions returns true, 
10235
10236         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10237
10238 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10239
10240         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10241         report error 70.
10242
10243 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10244
10245         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10246         conversion exists, but it is also required that the conversion be
10247         performed.  This manifested in "(Type64Enum) 2".  
10248
10249         * class.cs (TypeManager.AddMethod): The fix is not to change
10250         AddEnum, because that one was using a fully qualified name (every
10251         DeclSpace derivative does), but to change the AddMethod routine
10252         that was using an un-namespaced name.  This now correctly reports
10253         the duplicated name.
10254
10255         Revert patch until I can properly fix it.  The issue
10256         is that we have a shared Type space across all namespaces
10257         currently, which is wrong.
10258
10259         Options include making the Namespace a DeclSpace, and merge
10260         current_namespace/current_container in the parser.
10261
10262 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * cs-parser.jay: Improve error reporting when we get a different
10265         kind of expression in local_variable_type and
10266         local_variable_pointer_type. 
10267
10268         Propagate this to avoid missleading errors being reported.
10269
10270         * ecore.cs (ImplicitReferenceConversion): treat
10271         TypeManager.value_type as a target just like object_type.   As
10272         code like this:
10273
10274         ValueType v = 1;
10275
10276         Is valid, and needs to result in the int 1 being boxed before it
10277         is assigned to the value type v.
10278
10279         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10280         to validate the enumeration name.
10281
10282         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10283         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10284         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10285
10286         * ecore.cs (TryImplicitIntConversion): When doing an
10287         implicit-enumeration-conversion, check if the type is 64-bits and
10288         perform a conversion before passing to EnumConstant.
10289
10290 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10291
10292         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10293         report ambiguous type references.  Unlike the MS version, we
10294         report what the ambiguity is.   Innovation at work ;-)
10295
10296         (DeclSpace.FindType): Require a location argument to
10297         display when we display an ambiguous error.
10298
10299         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10300
10301         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10302
10303         * expression.cs (EmitDynamicInitializers): Apply patch from
10304         hwang_rob@yahoo.ca that fixes the order in which we emit our
10305         initializers. 
10306
10307 2002-09-21  Martin Baulig  <martin@gnome.org>
10308
10309         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10310         delegate takes no arguments.
10311
10312 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10315         from integers.
10316
10317         * expression.cs: Extract the underlying type.
10318
10319         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10320
10321         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10322
10323 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10324
10325         * class.cs (TypeContainer.DefineType): We can not use the nice
10326         PackingSize with the size set to 1 DefineType method, because it
10327         will not allow us to define the interfaces that the struct
10328         implements.
10329
10330         This completes the fixing of bug 27287
10331
10332         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10333         means also structs.  This fixes part of the problem. 
10334         (Expresion.ImplicitReferenceConversionExists): ditto.
10335
10336         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10337         error if there were no errors reported during the type lookup
10338         process, to avoid duplicates or redundant errors.  Without this
10339         you would get an ambiguous errors plus a type not found.  We have
10340         beaten the user enough with the first error.  
10341
10342         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10343         reference. 
10344
10345         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10346         during the resolution process, stop the lookup, this avoids
10347         repeated error reports (same error twice).
10348
10349         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10350
10351         * typemanager.cs (LookupType): Redo the type lookup code to match
10352         the needs of System.Reflection.  
10353
10354         The issue is that System.Reflection requires references to nested
10355         types to begin with a "+" sign instead of a dot.  So toplevel
10356         types look like: "NameSpace.TopLevelClass", and nested ones look
10357         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10358         levels. 
10359
10360 2002-09-19  Martin Baulig  <martin@gnome.org>
10361
10362         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10363         says that a method always returns or always throws an exception,
10364         don't report the CS0161.
10365
10366         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10367         set `Returns = new_returns'.
10368
10369 2002-09-19  Martin Baulig  <martin@gnome.org>
10370
10371         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10372         to an enum constant, check for a CS0176.
10373
10374 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10377         for operators that must be in pairs and report errors.
10378
10379         * ecore.cs (SimpleName.DoResolveType): During the initial type
10380         resolution process, when we define types recursively, we must
10381         check first for types in our current scope before we perform
10382         lookups in the enclosing scopes.
10383
10384         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10385
10386         (Invocation.VerifyArgumentsCompat): Call
10387         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10388         I thought we were supposed to always call this, but there are a
10389         few places in the code where we dont do it.
10390
10391 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10392
10393         * driver.cs: Add support in -linkres and -resource to specify the
10394         name of the identifier.
10395
10396 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10397
10398         * ecore.cs (StandardConversionExists): Sync with the conversion
10399         code: allow anything-* to void* conversions.
10400
10401         (FindMostSpecificSource): Use an Expression argument
10402         instead of a Type, because we might be handed over a Literal which
10403         gets a few more implicit conversions that plain types do not.  So
10404         this information was being lost.
10405
10406         Also, we drop the temporary type-holder expression when not
10407         required.
10408
10409 2002-09-17  Martin Baulig  <martin@gnome.org>
10410
10411         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10412         this is an explicit interface implementation.
10413
10414 2002-09-17  Martin Baulig  <martin@gnome.org>
10415
10416         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10417         different `IndexerName' attributes.
10418
10419         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10420         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10421         virtual CommonResolve().
10422
10423 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10424
10425         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10426         and convert that to the UnderlyingType.
10427
10428         * statement.cs (Foreach.Resolve): Indexers are just like variables
10429         or PropertyAccesses.
10430
10431         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10432         inside quoted strings, we were not doing this before.
10433
10434 2002-09-16  Martin Baulig  <martin@gnome.org>
10435
10436         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10437         resolve it.  This is needed for the definite assignment check of the
10438         instance expression, fixes bug #29846.
10439         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10440
10441 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10442
10443         * parameter.cs: Fix compile error.  Cannot reference static member
10444         from an instance object.  Is this an mcs bug?
10445
10446 2002-09-14  Martin Baulig  <martin@gnome.org>
10447
10448         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10449         multiple times.  Fixes bug #30295, added test-166.cs.
10450
10451 2002-09-14  Martin Baulig  <martin@gnome.org>
10452
10453         * statement.cs (Block.Emit): Don't emit unreachable code.
10454         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10455         `break' statements.
10456         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10457
10458 2002-09-14  Martin Baulig  <martin@gnome.org>
10459
10460         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10461         is set.
10462
10463 2002-09-14  Martin Baulig  <martin@gnome.org>
10464
10465         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10466         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10467         be false on the ms runtime.
10468
10469 2002-09-13  Martin Baulig  <martin@gnome.org>
10470
10471         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10472         the CS0038 error message.
10473
10474 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10477         constant inside, return it.
10478
10479 2002-09-12  Martin Baulig  <martin@gnome.org>
10480
10481         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10482         implicit conversion can be done between enum types.
10483
10484         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10485         check whether an implicit conversion to the current enum's UnderlyingType
10486         exists and report an error if not.
10487
10488         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10489         without debugging support.
10490
10491         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10492         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10493
10494 2002-09-12  Martin Baulig  <martin@gnome.org>
10495
10496         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10497
10498         * ecore.cs (IMemberExpr.DeclaringType): New property.
10499         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10500         nonstatic member of an outer type (CS0038).
10501
10502 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10503
10504         * driver.cs: Activate the using-error detector at warning level
10505         4 (at least for MS-compatible APIs).
10506
10507         * namespace.cs (VerifyUsing): Small buglett fix.
10508
10509         * pending.cs (PendingImplementation): pass the container pointer. 
10510
10511         * interface.cs (GetMethods): Allow for recursive definition.  Long
10512         term, I would like to move every type to support recursive
10513         definitions, not the current ordering mechanism that we have right
10514         now.
10515
10516         The situation is this: Attributes are handled before interfaces,
10517         so we can apply attributes to interfaces.  But some attributes
10518         implement interfaces, we will now handle the simple cases
10519         (recursive definitions will just get an error).  
10520
10521         * parameter.cs: Only invalidate types at the end if we fail to
10522         lookup all types.  
10523
10524 2002-09-09  Martin Baulig  <martin@gnome.org>
10525
10526         * ecore.cs (PropertyExpr.Emit): Also check for
10527         TypeManager.system_int_array_get_length so this'll also work when
10528         compiling corlib.  Fixes #30003.
10529
10530 2002-09-09  Martin Baulig  <martin@gnome.org>
10531
10532         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10533         and throw an exception if we can't get the type's size.  Fixed #30040,
10534         added test-165.cs.
10535
10536 2002-09-09  Martin Baulig  <martin@gnome.org>
10537
10538         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10539
10540         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10541         context.  Fixes bug #30027.
10542
10543         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10544         virtual functions.  Fixes bug #30043, added test-164.cs.
10545
10546 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10547
10548         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10549
10550 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10551
10552         * driver.cs: Use an object to get the windows codepage since it's not a
10553         static property.
10554
10555 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10556
10557         * statement.cs (For.Emit): for infinite loops (test == null)
10558         return whether there is a break inside, not always "true".
10559
10560         * namespace.cs (UsingEntry): New struct to hold the name of the
10561         using definition, the location where it is defined, and whether it
10562         has been used in a successful type lookup.
10563
10564         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10565         strings.
10566
10567         * decl.cs: ditto.
10568
10569 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10570
10571         * attribute.cs : Fix incorrect code which relied on catching
10572         a NullReferenceException to detect a null being passed in
10573         where an object was expected.
10574
10575 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10576
10577         * statement.cs (Try): flag the catch variable as assigned
10578
10579         * expression.cs (Cast): Simplified by using ResolveType instead of
10580         manually resolving.
10581
10582         * statement.cs (Catch): Fix bug by using ResolveType.
10583
10584 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10585
10586         * expression.cs (BetterConversion): Special case for when we have
10587         a NullLiteral as the argument and we have to choose between string
10588         and object types - we choose string the way csc does.
10589
10590         * attribute.cs (Attribute.Resolve): Catch the
10591         NullReferenceException and report error #182 since the Mono
10592         runtime no more has the bug and having this exception raised means
10593         we tried to select a constructor which takes an object and is
10594         passed a null.
10595
10596 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10597
10598         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10599         message (1502, 1503) when we can't locate a method after overload
10600         resolution. This is much more informative and closes the bug
10601         Miguel reported.
10602
10603         * interface.cs (PopulateMethod): Return if there are no argument
10604         types. Fixes a NullReferenceException bug.
10605
10606         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10607         expressions too. Previously we were checking only in one place for
10608         positional arguments leaving out named arguments.
10609
10610         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10611         type to the enum type is not allowed. Remove code corresponding to
10612         that.
10613
10614         (ConvertNumericExplicit): Allow explicit conversions from
10615         the underlying type to enum type. This precisely follows the spec
10616         and closes a bug filed by Gonzalo.
10617
10618 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10619
10620         * compiler.csproj:
10621         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10622
10623 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10624
10625         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10626         it was important that we stored the right value after the
10627         reduction in `converted'.
10628
10629 2002-09-04  Martin Baulig  <martin@gnome.org>
10630
10631         * location.cs (Location.SymbolDocument): Use full pathnames for the
10632         source files.
10633
10634 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10635
10636         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10637         of the expression resolve mechanism, because that will catch the
10638         SimpleName error failures.
10639
10640         (Conditional): If we can not resolve the
10641         expression, return, do not crash.
10642
10643 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10644
10645         * cs-tokenizer.cs:
10646         (location): display token name instead of its number.
10647
10648 2002-08-28  Martin Baulig  <martin@gnome.org>
10649
10650         * expression.cs (Binary.ResolveOperator): Don't silently return
10651         but return an error if an operator cannot be applied between two
10652         enum types.
10653
10654 2002-08-28  Martin Baulig  <martin@gnome.org>
10655
10656         * class.cs (Constructor.Define): Set the permission attributes
10657         correctly instead of making all constructors public.
10658
10659 2002-08-28  Martin Baulig  <martin@gnome.org>
10660
10661         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10662         for private members before reporting a CS0103; if we find anything,
10663         it's a CS0122.
10664
10665 2002-08-28  Martin Baulig  <martin@gnome.org>
10666
10667         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10668         to check whether `closure_start_type == closure_invocation_type',
10669         we also need to check whether `m.DeclaringType == closure_invocation_type'
10670         before bypassing the permission checks.  We might be accessing
10671         protected/private members from the base class.
10672         (TypeManager.RealMemberLookup): Only set private_ok if private
10673         members were requested via BindingFlags.NonPublic.
10674
10675         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10676
10677         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10678         MethodGroupExpr.IsExplicitImpl if appropriate.
10679         (Invocation.DoResolve): Don't report the CS0120 for explicit
10680         interface implementations.
10681
10682 2002-08-27  Martin Baulig  <martin@gnome.org>
10683
10684         * expression.cs (Invocation.DoResolve): If this is a static
10685         method and we don't have an InstanceExpression, we must report
10686         a CS0120.
10687
10688 2002-08-25  Martin Baulig  <martin@gnome.org>
10689
10690         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10691         `==' between a valuetype and an object.
10692
10693 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * ecore.cs (TypeExpr): Provide a ToString method.
10696
10697 2002-08-24  Martin Baulig  <martin@gnome.org>
10698
10699         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10700         now called proggie.dbg and it's a binary file.
10701
10702 2002-08-23  Martin Baulig  <martin@gnome.org>
10703
10704         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10705
10706 2002-08-23  Martin Baulig  <martin@gnome.org>
10707
10708         * struct.cs (MyStructInfo.ctor): Make this work with empty
10709         structs; it's not allowed to use foreach() on null.
10710
10711 2002-08-23  Martin Baulig  <martin@gnome.org>
10712
10713         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10714         writer the full pathname of the generated assembly.
10715
10716 2002-08-23  Martin Baulig  <martin@gnome.org>
10717
10718         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10719         A `finally' block never returns or breaks; improved handling of
10720         unreachable code.
10721
10722 2002-08-23  Martin Baulig  <martin@gnome.org>
10723
10724         * statement.cs (Throw.Resolve): Allow `throw null'.
10725
10726 2002-08-23  Martin Baulig  <martin@gnome.org>
10727
10728         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10729         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10730         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10731         MemberLookup would return a wrong event if this is an explicit
10732         interface implementation and the class has an event with the same
10733         name.
10734
10735 2002-08-23  Martin Baulig  <martin@gnome.org>
10736
10737         * statement.cs (Block.AddChildVariableNames): New public method.
10738         (Block.AddChildVariableName): Likewise.
10739         (Block.IsVariableNameUsedInChildBlock): Likewise.
10740         (Block.AddVariable): Check whether a variable name has already
10741         been used in a child block.
10742
10743         * cs-parser.jay (declare_local_variables): Mark all variable names
10744         from the current block as being used in a child block in the
10745         implicit block.
10746
10747 2002-08-23  Martin Baulig  <martin@gnome.org>
10748
10749         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10750         find the symbol writer.
10751
10752         * driver.cs: csc also allows the arguments to /define being
10753         separated by commas, not only by semicolons.
10754
10755 2002-08-23  Martin Baulig  <martin@gnome.org>
10756
10757         * interface.cs (Interface.GetMembers): Added static check for events.
10758
10759 2002-08-15  Martin Baulig  <martin@gnome.org>
10760
10761         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10762         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10763
10764         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10765         why the MethodData.EmitDestructor() change was necessary.
10766
10767 2002-08-20  Martin Baulig  <martin@gnome.org>
10768
10769         * class.cs (TypeContainer.FindMembers): Added static check for events.
10770
10771         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10772
10773         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10774         use Type.GetEvents(), not Type.FindMembers().
10775
10776 2002-08-20  Martin Baulig  <martin@gnome.org>
10777
10778         * decl.cs (MemberCache): Added a special method cache which will
10779         be used for method-only searched.  This ensures that a method
10780         search will return a MethodInfo with the correct ReflectedType for
10781         inherited methods.      
10782
10783 2002-08-20  Martin Baulig  <martin@gnome.org>
10784
10785         * decl.cs (DeclSpace.FindMembers): Made this public.
10786
10787 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10788
10789         * delegate.cs: fixed build on windows.
10790         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10791
10792 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10793
10794         * ecore.cs (StandardConversionExists): Return a false
10795         if we are trying to convert the void type to anything else
10796         since that is not allowed.
10797
10798         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10799         we flag error 70 in the event an event is trying to be accessed
10800         directly from outside the declaring type.
10801
10802 2002-08-20  Martin Baulig  <martin@gnome.org>
10803
10804         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10805         MemberCache from typemanager.cs to decl.cs.
10806
10807 2002-08-19  Martin Baulig  <martin@gnome.org>
10808
10809         * class.cs (TypeContainer): Implement IMemberContainer.
10810         (TypeContainer.DefineMembers): Create the MemberCache.
10811         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10812         return public members if BindingFlags.Public was given, check
10813         whether members are static.
10814
10815 2002-08-16  Martin Baulig  <martin@gnome.org>
10816
10817         * decl.cs (DeclSpace.Define): Splitted this in Define and
10818         DefineMembers.  DefineMembers is called first and initializes the
10819         MemberCache.
10820
10821         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10822         DefineMembers() on all our DeclSpaces.
10823
10824         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10825         but call DefineMembers() on all nested interfaces.  We call their
10826         Define() in our new Define() function.
10827
10828         * interface.cs (Interface): Implement IMemberContainer.
10829         (Interface.Define): Moved all code except the attribute stuf to
10830         DefineMembers().
10831         (Interface.DefineMembers): Initialize the member cache.
10832
10833         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10834         need this anymore since we can use MemberCache.FindMembers directly.
10835
10836 2002-08-19  Martin Baulig  <martin@gnome.org>
10837
10838         * typemanager.cs (MemberCache): When creating the cache for an
10839         interface type, add all inherited members.
10840         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10841         to `out bool used_cache' and documented it.
10842         (TypeManager.MemberLookup): If we already used the cache in the first
10843         iteration, we don't need to do the interfaces check.
10844
10845 2002-08-19  Martin Baulig  <martin@gnome.org>
10846
10847         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10848         here from IMemberFinder and don't implement this interface anymore.
10849         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10850
10851         * typemanager.cs (IMemberFinder): This interface is now only used by
10852         classes which actually support the member cache.
10853         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10854         since we only put DeclSpaces into this Hashtable.
10855         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10856         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10857
10858 2002-08-16  Martin Baulig  <martin@gnome.org>
10859
10860         * typemanager.cs (ICachingMemberFinder): Removed.
10861         (IMemberFinder.MemberCache): New property.
10862         (TypeManager.FindMembers): Merged this with RealFindMembers().
10863         This function will never be called from TypeManager.MemberLookup()
10864         so we can't use the cache here, just the IMemberFinder.
10865         (TypeManager.MemberLookup_FindMembers): Check whether the
10866         IMemberFinder has a MemberCache and call the cache's FindMembers
10867         function.
10868         (MemberCache): Rewrote larger parts of this yet another time and
10869         cleaned it up a bit.
10870
10871 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * driver.cs (LoadArgs): Support quoting.
10874
10875         (Usage): Show the CSC-like command line arguments.
10876
10877         Improved a few error messages.
10878
10879 2002-08-15  Martin Baulig  <martin@gnome.org>
10880
10881         * typemanager.cs (IMemberContainer.Type): New property.
10882         (IMemberContainer.IsInterface): New property.
10883
10884         The following changes are conditional to BROKEN_RUNTIME, which is
10885         defined at the top of the file.
10886
10887         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10888         class'es members, but add all members from TypeHandle.ObjectType
10889         if we're an interface.
10890         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10891         is the current type.
10892         (MemberCache.CacheEntry.Container): Removed this field.
10893         (TypeHandle.GetMembers): Include inherited members.
10894
10895 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10896
10897         * typemanager.cs: fixed compilation and added a comment on a field that
10898         is never used.
10899
10900 2002-08-15  Martin Baulig  <martin@gnome.org>
10901
10902         * class.cs (ConstructorInitializer.Resolve): In the
10903         Expression.MemberLookup call, use the queried_type as
10904         invocation_type.
10905
10906         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10907         declared' attribute, it's always true.
10908         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10909         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10910         temporary wrapper for FindMembers which tells MemberLookup whether
10911         members from the base classes are included in the return value.
10912         This will go away soon.
10913         (TypeManager.MemberLookup): Use this temporary hack here; once the
10914         new MemberCache is completed, we don't need to do the DeclaredOnly
10915         looping here anymore since the MemberCache will take care of this.
10916         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10917         (MemberCache): When creating the MemberCache for a class, get
10918         members from the current class and all its base classes.
10919         (MemberCache.CacheEntry.Container): New field.  This is a
10920         temporary hack until the Mono runtime is fixed to distinguish
10921         between ReflectedType and DeclaringType.  It allows us to use MCS
10922         with both the MS runtime and the unfixed Mono runtime without
10923         problems and without accecting performance.
10924         (MemberCache.SearchMembers): The DeclaredOnly looping from
10925         TypeManager.MemberLookup is now done here.      
10926
10927 2002-08-14  Martin Baulig  <martin@gnome.org>
10928
10929         * statement.cs (MyStructInfo.MyStructInfo): Don't call
10930         Type.GetFields on dynamic types but get the fields from the
10931         corresponding TypeContainer.
10932         (MyStructInfo.GetStructInfo): Added check for enum types.
10933
10934         * typemanager.cs (MemberList.IsSynchronized): Implemented.
10935         (MemberList.SyncRoot): Implemented.
10936         (TypeManager.FilterWithClosure): No need to check permissions if
10937         closure_start_type == closure_invocation_type, don't crash if
10938         closure_invocation_type is null.
10939
10940 2002-08-13  Martin Baulig  <martin@gnome.org>
10941
10942         Rewrote TypeContainer.FindMembers to use a member cache.  This
10943         gives us a speed increase of about 35% for the self-hosting MCS
10944         build and of about 15-20% for the class libs (both on GNU/Linux).
10945
10946         * report.cs (Timer): New class to get enhanced profiling.  This
10947         whole class is "TIMER" conditional since it remarkably slows down
10948         compilation speed.
10949
10950         * class.cs (MemberList): New class.  This is an IList wrapper
10951         which we're now using instead of passing MemberInfo[]'s around to
10952         avoid copying this array unnecessarily.
10953         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
10954         (ICachingMemberFinder, IMemberContainer): New interface.
10955         (TypeManager.FilterWithClosure): If `criteria' is null, the name
10956         has already been checked, otherwise use it for the name comparision.
10957         (TypeManager.FindMembers): Renamed to RealMemberFinder and
10958         provided wrapper which tries to use ICachingMemberFinder.FindMembers
10959         if possible.  Returns a MemberList, not a MemberInfo [].
10960         (TypeHandle): New class, implements IMemberContainer.  We create
10961         one instance of this class per type, it contains a MemberCache
10962         which is used to do the member lookups.
10963         (MemberCache): New class.  Each instance of this class contains
10964         all members of a type and a name-based hash table.
10965         (MemberCache.FindMembers): This is our new member lookup
10966         function.  First, it looks up all members of the requested name in
10967         the hash table.  Then, it walks this list and sorts out all
10968         applicable members and returns them.
10969
10970 2002-08-13  Martin Baulig  <martin@gnome.org>
10971
10972         In addition to a nice code cleanup, this gives us a performance
10973         increase of about 1.4% on GNU/Linux - not much, but it's already
10974         half a second for the self-hosting MCS compilation.
10975
10976         * typemanager.cs (IMemberFinder): New interface.  It is used by
10977         TypeManager.FindMembers to call FindMembers on a TypeContainer,
10978         Enum, Delegate or Interface.
10979         (TypeManager.finder_to_member_finder): New PtrHashtable.
10980         (TypeManager.finder_to_container): Removed.
10981         (TypeManager.finder_to_delegate): Removed.
10982         (TypeManager.finder_to_interface): Removed.
10983         (TypeManager.finder_to_enum): Removed.
10984
10985         * interface.cs (Interface): Implement IMemberFinder.
10986
10987         * delegate.cs (Delegate): Implement IMemberFinder.
10988
10989         * enum.cs (Enum): Implement IMemberFinder.
10990
10991         * class.cs (TypeContainer): Implement IMemberFinder.
10992
10993 2002-08-12  Martin Baulig  <martin@gnome.org>
10994
10995         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
10996
10997 2002-08-12  Martin Baulig  <martin@gnome.org>
10998
10999         * ecore.cs (ITypeExpression): New interface for expressions which
11000         resolve to a type.
11001         (TypeExpression): Renamed to TypeLookupExpression.
11002         (Expression.DoResolve): If we're doing a types-only lookup, the
11003         expression must implement the ITypeExpression interface and we
11004         call DoResolveType() on it.
11005         (SimpleName): Implement the new ITypeExpression interface.
11006         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11007         hack, the situation that we're only looking up types can't happen
11008         anymore when this method is called.  Moved the type lookup code to
11009         DoResolveType() and call it.
11010         (SimpleName.DoResolveType): This ITypeExpression interface method
11011         is now doing the types-only lookup.
11012         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11013         (ResolveFlags): Added MaskExprClass.
11014
11015         * expression.cs (MemberAccess): Implement the ITypeExpression
11016         interface.
11017         (MemberAccess.DoResolve): Added support for a types-only lookup
11018         when we're called via ITypeExpression.DoResolveType().
11019         (ComposedCast): Implement the ITypeExpression interface.
11020
11021         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11022         Expression.Resolve() with ResolveFlags.Type instead.
11023
11024 2002-08-12  Martin Baulig  <martin@gnome.org>
11025
11026         * interface.cs (Interface.Define): Apply attributes.
11027
11028         * attribute.cs (Attribute.ApplyAttributes): Added support for
11029         interface attributes.
11030
11031 2002-08-11  Martin Baulig  <martin@gnome.org>
11032
11033         * statement.cs (Block.Emit): Only check the "this" variable if we
11034         do not always throw an exception.
11035
11036         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11037         whether the property has a set accessor.
11038
11039 2002-08-11  Martin Baulig  <martin@gnome.org>
11040
11041         Added control flow analysis support for structs.
11042
11043         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11044         with control flow analysis turned off.
11045         (IVariable): New interface.
11046         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11047         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11048         (FieldExpr.DoResolve): Resolve the instance expression with flow
11049         analysis turned off and do the definite assignment check after the
11050         resolving when we know what the expression will resolve to.
11051
11052         * expression.cs (LocalVariableReference, ParameterReference):
11053         Implement the new IVariable interface, only call the flow analysis
11054         code if ec.DoFlowAnalysis is true.
11055         (This): Added constructor which takes a Block argument.  Implement
11056         the new IVariable interface.
11057         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11058         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11059         This does the definite assignment checks for struct members.
11060
11061         * class.cs (Constructor.Emit): If this is a non-static `struct'
11062         constructor which doesn't have any initializer, call
11063         Block.AddThisVariable() to tell the flow analysis code that all
11064         struct elements must be initialized before control returns from
11065         the constructor.
11066
11067         * statement.cs (MyStructInfo): New public class.
11068         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11069         argument to this indexer.  If non-zero, check an individual struct
11070         member, not the whole struct.
11071         (FlowBranching.CheckOutParameters): Check struct members.
11072         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11073         overloaded versions of these methods which take an additional
11074         `int field_idx' argument to check struct members.
11075         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11076         overloaded versions of these methods which take an additional
11077         `string field_name' argument to check struct member.s
11078         (VariableInfo): Implement the IVariable interface.
11079         (VariableInfo.StructInfo): New public property.  Returns the
11080         MyStructInfo instance of the variable if it's a struct or null.
11081         (Block.AddThisVariable): New public method.  This is called from
11082         Constructor.Emit() for non-static `struct' constructor which do
11083         not have any initializer.  It creates a special variable for the
11084         "this" instance variable which will be checked by the flow
11085         analysis code to ensure that all of the struct's fields are
11086         initialized before control returns from the constructor.
11087         (UsageVector): Added support for struct members.  If a
11088         variable/parameter is a struct with N members, we reserve a slot
11089         in the usage vector for each member.  A struct is considered fully
11090         initialized if either the struct itself (slot 0) or all its
11091         members are initialized.
11092
11093 2002-08-08  Martin Baulig  <martin@gnome.org>
11094
11095         * driver.cs (Driver.MainDriver): Only report an error CS5001
11096         if there were no compilation errors.
11097
11098         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11099         `UnsafeContext' property to determine whether the parent is in
11100         unsafe context rather than checking the parent's ModFlags:
11101         classes nested in an unsafe class are unsafe as well.
11102
11103 2002-08-08  Martin Baulig  <martin@gnome.org>
11104
11105         * statement.cs (UsageVector.MergeChildren): Distinguish between
11106         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11107         we return.  Added test17() and test18() to test-154.cs.
11108
11109 2002-08-08  Martin Baulig  <martin@gnome.org>
11110
11111         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11112         Family access, make sure the invoking type isn't a subclass of the
11113         queried type (that'd be a CS1540).
11114
11115         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11116         this method which takes an additional `Type invocation_type'.
11117
11118         * expression.cs (BaseAccess.DoResolve): Use the base type as
11119         invocation and query type.
11120         (MemberAccess.DoResolve): If the lookup failed and we're about to
11121         report a CS0122, try a lookup with the ec.ContainerType - if this
11122         succeeds, we must report a CS1540.
11123
11124 2002-08-08  Martin Baulig  <martin@gnome.org>
11125
11126         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11127         (MethodGroupExpr): Implement the IMemberExpr interface.
11128
11129         * expression (MemberAccess.ResolveMemberAccess): No need to have
11130         any special code for MethodGroupExprs anymore, they're now
11131         IMemberExprs.   
11132
11133 2002-08-08  Martin Baulig  <martin@gnome.org>
11134
11135         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11136         Family, FamANDAssem and FamORAssem permissions.
11137         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11138
11139 2002-08-08  Martin Baulig  <martin@gnome.org>
11140
11141         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11142         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11143         or loop block.
11144
11145 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11146
11147         * driver.cs: implemented /resource option to embed managed resources.
11148
11149 2002-08-07  Martin Baulig  <martin@gnome.org>
11150
11151         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11152         (FieldBase.HasFieldInitializer): New public property.
11153         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11154         returns the field initializer and makes sure it is only resolved once.
11155         (TypeContainer.EmitFieldInitializers): Call
11156         FieldBase.GetInitializerExpression to get the initializer, this ensures
11157         that it isn't resolved multiple times.
11158
11159         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11160         the resolving process (SimpleName/MemberLookup) that we're currently
11161         emitting a field initializer (which must not access any instance members,
11162         this is an error CS0236).
11163
11164         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11165         argument, if the `IsFieldInitializer' flag is set, we must report and
11166         error CS0236 and not an error CS0120.   
11167
11168 2002-08-07  Martin Baulig  <martin@gnome.org>
11169
11170         * ecore.cs (IMemberExpr): New public interface.
11171         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11172         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11173         if the expression is an IMemberExpr.
11174
11175         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11176         to be null, implicitly default to `this' if we're non-static in
11177         this case.  Simplified the code a lot by using the new IMemberExpr
11178         interface.  Also fixed bug #28176 here.
11179
11180 2002-08-06  Martin Baulig  <martin@gnome.org>
11181
11182         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11183         ParameterReferences during semantic analysis so that we can do a
11184         type-only search when resolving Cast, TypeOf and SizeOf.
11185         (block): Pass the `current_local_parameters' to the Block's
11186         constructor.
11187
11188         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11189         argument to the constructor.
11190         (ConstructorInitializer.Resolve): Create a temporary implicit
11191         block with the parameters.
11192
11193         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11194         references here if we aren't doing a type-only search.
11195
11196         * statement.cs (Block): Added constructor which takes a
11197         `Parameters parameters' argument.
11198         (Block.Parameters): New public property.
11199
11200         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11201         to `Parameters' and made it public readonly.
11202
11203 2002-08-06  Martin Baulig  <martin@gnome.org>
11204
11205         * ecore.cs (Expression.Warning): Made this public as well.
11206
11207         * report.cs (Report.Debug): Print the contents of collections.
11208
11209 2002-08-06  Martin Baulig  <martin@gnome.org>
11210
11211         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11212         used to tell Resolve() which kinds of expressions it may return.
11213         (Expression.Resolve): Added overloaded version of this method which
11214         takes a `ResolveFlags flags' argument.  This can be used to tell
11215         Resolve() which kinds of expressions it may return.  Reports a
11216         CS0118 on error.
11217         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11218         ResolveFlags.SimpleName.
11219         (Expression.Error118): Added overloaded version of this method which
11220         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11221         which kinds of expressions are allowed.
11222
11223         * expression.cs (Argument.ResolveMethodGroup): New public method.
11224         Resolves an argument, but allows a MethodGroup to be returned.
11225         This is used when invoking a delegate.
11226
11227         * TODO: Updated a bit.
11228
11229 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11230
11231         Fixed compilation with csc.
11232
11233         * ecore.cs: Expression.Error made public. Is this correct? Should
11234         Warning be made public too?
11235
11236         * expression.cs: use ea.Location instead of ea.loc.
11237         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11238
11239 2002-08-06  Martin Baulig  <martin@gnome.org>
11240
11241         * ecore.cs (Expression.loc): Moved the location here instead of
11242         duplicating it in all derived classes.
11243         (Expression.Location): New public property.
11244         (Expression.Error, Expression.Warning): Made them non-static and
11245         removed the location argument.
11246         (Expression.Warning): Added overloaded version which takes an
11247         `int level' argument.
11248         (Expression.Error118): Make this non-static and removed the
11249         expression and location arguments.
11250         (TypeExpr): Added location argument to the constructor.
11251
11252         * expression.cs (StaticCallExpr): Added location argument to
11253         the constructor.
11254         (Indirection, PointerArithmetic): Likewise.
11255         (CheckedExpr, UnCheckedExpr): Likewise.
11256         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11257         (StringPtr): Likewise.
11258
11259
11260 2002-08-05  Martin Baulig  <martin@gnome.org>
11261
11262         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11263
11264         * assign.cs (Assign.DoResolve): Check whether the source
11265         expression is a value or variable.
11266
11267         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11268         while resolving the corresponding blocks.
11269
11270         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11271         an error, don't silently return null.
11272
11273         * statement.cs (Block.AddVariable): Do the error reporting here
11274         and distinguish between CS0128 and CS0136.
11275         (Block.DoResolve): Report all unused labels (warning CS0164).
11276         (LabeledStatement): Pass the location to the constructor.
11277         (LabeledStatement.HasBeenReferenced): New property.
11278         (LabeledStatement.Resolve): Set it to true here.
11279
11280         * statement.cs (Return.Emit): Return success even after reporting
11281         a type mismatch error (CS0126 or CS0127), this is what csc does and
11282         it avoids confusing the users with any consecutive errors.
11283
11284 2002-08-05  Martin Baulig  <martin@gnome.org>
11285
11286         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11287
11288         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11289
11290         * expression.cs (MemberAccess.DoResolve): Silently return if an
11291         error has already been reported.
11292
11293         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11294         error has already been reported.
11295
11296 2002-08-05  Martin Baulig  <martin@gnome.org>
11297
11298         * statement.cs (UsageVector): Only initialize the `parameters'
11299         vector if we actually have any "out" parameters.
11300
11301 2002-08-05  Martin Baulig  <martin@gnome.org>
11302
11303         * expression.cs (Binary.ResolveOperator): When combining delegates,
11304         they must have the same type.
11305
11306 2002-08-05  Martin Baulig  <martin@gnome.org>
11307
11308         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11309         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11310         work with the ms runtime and we also don't need it: if we're a
11311         PropertyBuilder and not in the `indexer_arguments' hash, then we
11312         are a property and not an indexer.
11313
11314         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11315         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11316         since the latter one doesn't work with the ms runtime.
11317
11318 2002-08-03  Martin Baulig  <martin@gnome.org>
11319
11320         Fixed bugs #27998 and #22735.
11321
11322         * class.cs (Method.IsOperator): New public field.
11323         (Method.CheckBase): Report CS0111 if there's already a method
11324         with the same parameters in the current class.  Report CS0508 when
11325         attempting to change the return type of an inherited method.
11326         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11327         and it's not marked abstract or extern.
11328         (PropertyBase): New abstract base class for Property and Indexer.
11329         (PropertyBase.CheckBase): Moved here from Property and made it work
11330         for indexers.
11331         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11332         the same so we can reuse it there.
11333         (Property, Indexer): Derive from PropertyBase.
11334         (MethodSignature.inheritable_property_signature_filter): New delegate
11335         to find properties and indexers.
11336
11337         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11338         argument and improved error reporting.
11339
11340         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11341         EmptyReadOnlyParameters and made it a property.
11342
11343         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11344         version of this method which takes a `PropertyInfo indexer'.
11345         (TypeManager.RegisterIndexer): New method.
11346
11347         * class.cs: Added myself as author of this file :-)
11348
11349 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11350
11351         * class.cs: fixed compilation on windoze.
11352
11353 2002-08-03  Martin Baulig  <martin@gnome.org>
11354
11355         * interface.cs (Interface.GetInterfaceBases): Check whether all
11356         base interfaces are at least as accessible than the current one.
11357
11358         * class.cs (TypeContainer.GetClassBases): Check whether base types
11359         are at least as accessible than the current type.
11360         (TypeContainer.AsAccessible): Implemented and made non-static.
11361         (MemberBase.CheckParameters): Report errors if the accessibility
11362         checks fail.
11363
11364         * delegate.cs (Delegate.Delegate): The default visibility is
11365         internal for top-level types and private for nested types.
11366         (Delegate.Define): Report errors if the accessibility checks fail.
11367
11368         * enum.cs (Enum.Enum): The default visibility is internal for
11369         top-level types and private for nested types.
11370         (Enum.DefineType): Compute the correct visibility.
11371
11372         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11373         function which takes a `bool is_toplevel' instead of a TypeContainer.
11374
11375         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11376         builtin type.
11377
11378 2002-08-02  Martin Baulig  <martin@gnome.org>
11379
11380         * expression.cs (LocalVariableReferenc): Added constructor which
11381         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11382         (LocalVariableReference.IsReadOnly): New property.
11383         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11384         variable is readonly, use our own readonly flag to do this; you can
11385         use the new constructor to get a writable reference to a read-only
11386         variable.
11387
11388         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11389         reference to the local variable.
11390
11391 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11392
11393         * rootcontext.cs (ResolveCore): Also include System.Exception
11394
11395         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11396         we reach an EmptyStatement.
11397
11398         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11399         is also fine.
11400
11401         * expression.cs (Binary.ResolveOperator): Check error result in
11402         two places.
11403
11404         use brtrue/brfalse directly and avoid compares to null.
11405
11406 2002-08-02  Martin Baulig  <martin@gnome.org>
11407
11408         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11409         Fixes bug #28407, added test-155.cs.
11410
11411 2002-08-01  Martin Baulig  <martin@gnome.org>
11412
11413         * class.cs (Event.EmitDefaultMethod): Make this work with static
11414         events.  Fixes #28311, added verify-3.cs.
11415
11416 2002-08-01  Martin Baulig  <martin@gnome.org>
11417
11418         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11419         `is_disposable' fields.
11420         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11421         `hm.is_disposable' if we're using the collection pattern.
11422         (Foreach.EmitCollectionForeach): Use the correct type for the
11423         enumerator's local variable, only emit the try/finally block if
11424         necessary (fixes #27713).
11425
11426 2002-08-01  Martin Baulig  <martin@gnome.org>
11427
11428         * ecore.cs (Expression.report118): Renamed to Error118 and made
11429         it public static.
11430
11431         * statement.cs (Throw.Resolve): Check whether the expression is of
11432         the correct type (CS0118) and whether the type derives from
11433         System.Exception (CS0155).
11434         (Catch.Resolve): New method.  Do the type lookup here and check
11435         whether it derives from System.Exception (CS0155).
11436         (Catch.CatchType, Catch.IsGeneral): New public properties.
11437
11438         * typemanager.cs (TypeManager.exception_type): Added.
11439
11440 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11441
11442         * driver.cs: Updated About function.
11443
11444 2002-07-31  Martin Baulig  <martin@gnome.org>
11445
11446         Implemented Control Flow Analysis.
11447
11448         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11449         (EmitContext.CurrentBranching): Added.
11450         (EmitContext.StartFlowBranching): Added.
11451         (EmitContext.EndFlowBranching): Added.
11452         (EmitContext.KillFlowBranching): Added.
11453         (EmitContext.IsVariableAssigned): Added.
11454         (EmitContext.SetVariableAssigned): Added.
11455         (EmitContext.IsParameterAssigned): Added.
11456         (EmitContext.SetParameterAssigned): Added.
11457         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11458         Added control flow analysis stuff here.
11459
11460         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11461         resolve the expression as lvalue.
11462         (LocalVariableReference.DoResolve): Check whether the variable has
11463         already been assigned.
11464         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11465         the parameter as assigned here.
11466         (ParameterReference.DoResolve): Check whether the parameter has already
11467         been assigned.
11468         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11469         expression as lvalue.
11470
11471         * statement.cs (FlowBranching): New class for the flow analysis code.
11472         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11473         (LabeledStatement.IsDefined): New public property.
11474         (LabeledStatement.AddUsageVector): New public method to tell flow
11475         analyis that the label may be reached via a forward jump.
11476         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11477         flow analysis.
11478         (VariableInfo.Number): New public field.  This is used by flow analysis
11479         to number all locals of a block.
11480         (Block.CountVariables): New public property.  This is the number of
11481         local variables in this block (including the locals from all parent
11482         blocks).
11483         (Block.EmitMeta): Number all the variables.
11484
11485         * statement.cs: Added flow analysis support to all classes.
11486
11487 2002-07-31  Martin Baulig  <martin@gnome.org>
11488
11489         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11490         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11491         then use this argument.
11492
11493         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11494
11495         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11496         use this to specify /define options.
11497
11498 2002-07-29  Martin Baulig  <martin@gnome.org>
11499
11500         * statement.cs (Fixed): Moved all code that does variable lookups
11501         and resolvings from Emit to Resolve.
11502
11503         * statement.cs (For): Moved all code that does variable lookups
11504         and resolvings from Emit to Resolve.
11505
11506         * statement.cs (Using): Moved all code that does variable lookups
11507         and resolvings from Emit to Resolve.
11508
11509 2002-07-29  Martin Baulig  <martin@gnome.org>
11510
11511         * attribute.cs (Attribute.Resolve): Explicitly catch a
11512         System.NullReferenceException when creating the
11513         CustromAttributeBuilder and report a different warning message.
11514
11515 2002-07-29  Martin Baulig  <martin@gnome.org>
11516
11517         * support.cs (ParameterData.ParameterName): Added method to
11518         get the name of a parameter.
11519
11520         * typemanager.cs (TypeManager.IsValueType): New public method.
11521
11522 2002-07-29  Martin Baulig  <martin@gnome.org>
11523
11524         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11525         is a flag which specifies that it's either ref or out.
11526         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11527         the out parameter to `out Parameter.Modifier mod', also set the
11528         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11529
11530         * support.cs (InternalParameters.ParameterModifier): Distinguish
11531         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11532         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11533
11534         * expression.cs (Argument.GetParameterModifier): Distinguish
11535         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11536         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11537
11538 2002-07-29  Martin Baulig  <martin@gnome.org>
11539
11540         * expression.cs (ParameterReference.ParameterReference): Added
11541         `Location loc' argument to the constructor.
11542
11543         * cs-parser.jay: Pass location to ParameterReference.
11544
11545 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11546
11547         * statement.cs (Try): Initialize the location.
11548
11549         * cs-parser.jay: pass location to Try.
11550
11551         * expression.cs (Unary.Reduce): Change the prototype to return
11552         whether a constant fold could be performed or not.  The result is
11553         returned in an out parameters.  In the case of Indirection and
11554         AddressOf, we want to perform the full tests.
11555
11556 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11557
11558         * statement.cs (Statement.Emit): Flag dead code.
11559
11560 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11561
11562         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11563
11564 2002-07-27  Martin Baulig  <martin@gnome.org>
11565
11566         * class.cs (MethodData.Define): Put back call to
11567         TypeManager.AddMethod(), accidentally commented this out.
11568
11569         * report.cs (Debug): New public method to print debugging information,
11570         this is `[Conditional ("DEBUG")]'.
11571
11572 2002-07-26  Martin Baulig  <martin@gnome.org>
11573
11574         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11575         (switch_statement): Push the current_block to the switch_stack and
11576         pop it again when we're done with the switch.
11577         (switch_section): The new block is a child of the current_block.
11578         Fixes bug #24007, added test-152.cs.
11579
11580 2002-07-27  Martin Baulig  <martin@gnome.org>
11581
11582         * expression.cs (Invocation.EmitArguments): When calling a varargs
11583         function with only its fixed arguments, we need to pass an empty
11584         array.
11585
11586 2002-07-27  Martin Baulig  <martin@gnome.org>
11587
11588         Mono 0.13 has been released.
11589
11590 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11591
11592         * driver.cs: Rename --resource to --linkres, because that is what
11593         we do currently, we dont support --resource yet.
11594
11595         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11596
11597 2002-07-25  Martin Baulig  <martin@gnome.org>
11598
11599         * class.cs (MethodData): New public class.  This is a `method builder'
11600         class for a method or one accessor of a Property/Indexer/Event.
11601         (MethodData.GetMethodFlags): Moved here from MemberBase.
11602         (MethodData.ApplyAttributes): Likewise.
11603         (MethodData.ApplyObsoleteAttribute): Likewise.
11604         (MethodData.ApplyConditionalAttribute): Likewise.
11605         (MethodData.ApplyDllImportAttribute): Likewise.
11606         (MethodData.CheckAbstractAndExternal): Likewise.
11607         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11608         (MethodData.Emit): Formerly known as Method.Emit().
11609         (MemberBase): Moved everything which was specific to a single
11610         accessor/method to MethodData.
11611         (Method): Create a new MethodData and call Define() and Emit() on it.
11612         (Property, Indexer, Event): Create a new MethodData objects for each
11613         accessor and call Define() and Emit() on them.
11614
11615 2002-07-25  Martin Baulig  <martin@gnome.org>
11616
11617         Made MethodCore derive from MemberBase to reuse the code from there.
11618         MemberBase now also checks for attributes.
11619
11620         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11621         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11622         as virtual.
11623         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11624         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11625         (MemberBase.ApplyAttributes): New virtual method; applies the
11626         attributes to a method or accessor.
11627         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11628         (MemberBase.ApplyConditionalAttribute): Likewise.
11629         (MemberBase.ApplyDllImportAttribute): Likewise.
11630         (MemberBase.CheckAbstractAndExternal): Likewise.
11631         (MethodCore.ParameterTypes): This is now a property instead of a
11632         method, it's initialized from DoDefineParameters().
11633         (MethodCore.ParameterInfo): Removed the set accessor.
11634         (MethodCore.DoDefineParameters): New protected virtual method to
11635         initialize ParameterTypes and ParameterInfo.
11636         (Method.GetReturnType): We can now simply return the MemberType.
11637         (Method.GetMethodFlags): Override the MemberBase version and add
11638         the conditional flags.
11639         (Method.CheckBase): Moved some code from Define() here, call
11640         DoDefineParameters() here.
11641         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11642         here to avoid some larger code duplication.
11643         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11644         ensure that abstract and external accessors don't declare a body.
11645
11646         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11647         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11648         lookup in the attribute's parent classes, so we need to abort as soon
11649         as we found the first match.
11650         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11651         the attribute has no arguments.
11652
11653         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11654         of a Method.
11655
11656 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11657
11658         * cs-parser.jay: reverted previous patch.
11659
11660 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11661
11662         * cs-parser.jay: fixed bug #22119.
11663
11664 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11665
11666         * attribute.cs: fixed compilation. The error was:
11667         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11668         be assigned to before control leaves the current method."
11669         [FIXME:  Filed as bug #28186: MCS must report this error.]
11670
11671 2002-07-25  Martin Baulig  <martin@gnome.org>
11672
11673         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11674         method to pull the condition name ouf of a Conditional attribute.
11675         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11676         the obsolete message and error flag out of an Obsolete attribute.
11677
11678         * class.cs (Method.GetMethodFlags): New public method to get the
11679         TypeManager.MethodFlags for this method.
11680         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11681         private methods.
11682         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11683         if we're overriding a virtual function, set the new private variable
11684         `parent_method'; call the new TypeManager.AddMethod().
11685
11686         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11687         the MethodBuilder and the Method in a PtrHashtable.
11688         (TypeManager.builder_to_method): Added for this purpose.
11689         (TypeManager.MethodFlags): Added IsObsoleteError.
11690         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11691         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11692         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11693         the message from the attribute.
11694
11695 2002-07-24  Martin Baulig  <martin@gnome.org>
11696
11697         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11698         preprocessor directives, ensure that the argument to #define/#undef is
11699         exactly one identifier and that it's actually an identifier.
11700
11701         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11702         did not work ....
11703
11704 2002-07-24  Martin Baulig  <martin@gnome.org>
11705
11706         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11707         initialize it to TypeManager.object_type in the constructor.
11708         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11709         of the `hm.get_current' method if we're using the collection pattern.
11710         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11711         for the explicit conversion to make it work when we're using the collection
11712         pattern and the `Current' property has a different return type than `object'.
11713         Fixes #27713.
11714
11715 2002-07-24  Martin Baulig  <martin@gnome.org>
11716
11717         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11718         does not match, but don't report any errors.  This method is called in
11719         order for all methods in a MethodGroupExpr until a matching method is
11720         found, so we don't want to bail out if the first method doesn't match.
11721         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11722         matches, report the 123.  Fixes #28070.
11723
11724 2002-07-24  Martin Baulig  <martin@gnome.org>
11725
11726         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11727         TypeManager.TypeToCoreType() to the top of the method so the
11728         following equality checks will work.  Fixes #28107.
11729
11730 2002-07-24  Martin Baulig  <martin@gnome.org>
11731
11732         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11733         operand is of type uint, and the other operand is of type sbyte,
11734         short or int, the operands are converted to type long." -
11735         Actually do what this comment already told us.  Fixes bug #28106,
11736         added test-150.cs.
11737
11738 2002-07-24  Martin Baulig  <martin@gnome.org>
11739
11740         * class.cs (MethodBase): New abstract class.  This is now a base
11741         class for Property, Indexer and Event to avoid some code duplication
11742         in their Define() and DefineMethods() methods.
11743         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11744         generic methods for Define() and DefineMethods().
11745         (FieldBase): Derive from MemberBase, not MemberCore.
11746         (Property): Derive from MemberBase, not MemberCore.
11747         (Property.DefineMethod): Moved all the code from this method to the
11748         new MethodBase.DefineAccessor(), just call it with appropriate
11749         argumetnts.
11750         (Property.Define): Call the new Property.DoDefine(), this does some
11751         sanity checks and we don't need to duplicate the code everywhere.
11752         (Event): Derive from MemberBase, not MemberCore.
11753         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11754         accessors, this will also make them work with interface events.
11755         (Indexer): Derive from MemberBase, not MemberCore.
11756         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11757         (Indexer.Define): Use the new MethodBase functions.
11758
11759         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11760         argument to the constructor.
11761         (Interface.FindMembers): Added support for interface events.
11762         (Interface.PopluateEvent): Implemented.
11763
11764         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11765
11766 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11767
11768         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11769         but this is required to check for a method name being the same as
11770         the containing class.  
11771
11772         Handle this now.
11773
11774 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11775
11776         * interface.cs: initialize variable.
11777
11778 2002-07-23  Martin Baulig  <martin@gnome.org>
11779
11780         Implemented the IndexerName attribute in interfaces.
11781
11782         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11783         name if this is an explicit interface implementation.
11784         (Indexer.InterfaceIndexerName): New public variable.  If we're
11785         implementing an interface indexer, this is the IndexerName in that
11786         interface.  Otherwise, it's the IndexerName.
11787         (Indexer.DefineMethod): If we're implementing interface indexer,
11788         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11789         and Pending.ImplementIndexer methods.
11790         (Indexer.Define): Also define the PropertyBuilder if we're
11791         implementing an interface indexer and this is neither an explicit
11792         interface implementation nor do the IndexerName match the one in
11793         the interface.
11794
11795         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11796         If a method is defined here, then we always need to create a proxy
11797         for it.  This is used when implementing interface indexers.
11798         (Pending.IsInterfaceIndexer): New public method.
11799         (Pending.ImplementIndexer): New public method.
11800         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11801         This is used when implementing interface indexers to define a proxy
11802         if necessary.
11803         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11804         define a proxy if necessary.
11805
11806         * interface.cs (Interface.IndexerName): New public variable.
11807         (Interface.PopulateIndexer): Set the IndexerName.
11808         (Interface.DefineIndexers): New private method.  Populate all the
11809         indexers and make sure their IndexerNames match.
11810
11811         * typemanager.cs (IndexerPropertyName): Added support for interface
11812         indexers.
11813
11814 2002-07-22  Martin Baulig  <martin@gnome.org>
11815
11816         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11817         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11818         ret if HasReturnLabel.
11819         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11820         variables.
11821
11822         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11823         and set the ec.LoopBeginTryCatchLevel.
11824         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11825         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11826         the current ec.TryCatchLevel, the branch goes out of an exception
11827         block.  In this case, we need to use Leave and not Br.
11828
11829 2002-07-22  Martin Baulig  <martin@gnome.org>
11830
11831         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11832         block unless the block does not always return or it is contained in
11833         another try { ... } catch { ... } block.  Fixes bug #26506.
11834         Added verify-1.cs to the test suite.
11835
11836 2002-07-22  Martin Baulig  <martin@gnome.org>
11837
11838         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11839         then we do not always return.  Fixes bug #24985.
11840
11841 2002-07-22  Martin Baulig  <martin@gnome.org>
11842
11843         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11844         lookup on a per-class level; ie. walk up the class hierarchy until we
11845         found at least one applicable method, then choose the best among them.
11846         Fixes bug #24463 and test-29.cs.
11847
11848 2002-07-22  Martin Baulig  <martin@gnome.org>
11849
11850         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11851         return types of the methods.  The return type is not part of the
11852         signature and we must not check it to make the `new' modifier work.
11853         Fixes bug #27999, also added test-147.cs.
11854         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11855
11856         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11857         on the method's return type.
11858
11859 2002-07-21  Martin Baulig  <martin@gnome.org>
11860
11861         * assign.cs: Make this work if the rightmost source is a constant and
11862         we need to do an implicit type conversion.  Also adding a few more tests
11863         to test-38.cs which should have caught this.
11864
11865         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11866         target in the makefile for this.  The makefile.gnu is primarily intended
11867         for end-users who don't want to debug the compiler.
11868
11869 2002-07-21  Martin Baulig  <martin@gnome.org>
11870
11871         * assign.cs: Improved the Assign class so it can now handle embedded
11872         assignments (X = Y = Z = something).  As a side-effect this'll now also
11873         consume less local variables.  test-38.cs now passes with MCS, added
11874         a few new test cases to that test.
11875
11876 2002-07-20  Martin Baulig  <martin@gnome.org>
11877
11878         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11879         instructions.  Fixes bug #27977, also added test-146.cs.
11880
11881 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11882
11883         * cs-tokenizer.cs: fixed getHex ().
11884
11885 2002-07-19  Martin Baulig  <martin@gnome.org>
11886
11887         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11888         not Type.GetType() to lookup the array type.  This is needed when
11889         we're constructing an array of a user-defined type.
11890         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11891         single-dimensional arrays, but also for single-dimensial arrays of
11892         type decimal.
11893
11894 2002-07-19  Martin Baulig  <martin@gnome.org>
11895
11896         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11897         this function is called, it's not allowed to share LocalBuilders
11898         among ILGenerators.
11899
11900 2002-07-19  Martin Baulig  <martin@gnome.org>
11901
11902         * expression.cs (Argument.Resolve): Report an error 118 when trying
11903         to pass a type as argument.
11904
11905 2002-07-18  Martin Baulig  <martin@gnome.org>
11906
11907         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11908         Conv_R_Un for the signed `long' type.
11909
11910 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11913         `expr' for the temporary result, as that will fail if we do
11914         multiple resolves on the same expression.
11915
11916 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11919         ec.TypeContainer for looking up aliases. 
11920
11921         * class.cs (TypeContainer): Remove LookupAlias from here.
11922
11923         * decl.cs (DeclSpace); Move here.
11924
11925 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
11926
11927         * class.cs (FindMembers): Only call filter if the constructor
11928         bulider is not null.
11929
11930         Also handle delegates in `NestedTypes' now.  Now we will perform
11931         type lookups using the standard resolution process.  This also
11932         fixes a bug.
11933
11934         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11935         This uses Expressions (the limited kind that can be parsed by the
11936         tree) instead of strings.
11937
11938         * expression.cs (ComposedCast.ToString): Implement, used to flag
11939         errors since now we have to render expressions.
11940
11941         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
11942         FormArrayType. 
11943
11944         * ecore.cs (SimpleName.ToString): ditto.
11945
11946         * cs-parser.jay: Instead of using strings to assemble types, use
11947         Expressions to assemble the type (using SimpleName, ComposedCast,
11948         MemberAccess).  This should fix the type lookups in declarations,
11949         because we were using a different code path for this.
11950
11951         * statement.cs (Block.Resolve): Continue processing statements
11952         even when there is an error.
11953
11954 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
11955
11956         * class.cs (Event.Define): Also remove the `remove' method from
11957         the list of pending items.
11958
11959         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
11960         generate more compact code. 
11961
11962 2002-07-17  Martin Baulig  <martin@gnome.org>
11963
11964         * const.cs (Const.LookupConstantValue): Add support for constant
11965         `unchecked' and `checked' expressions.
11966         Also adding test case test-140.cs for this.
11967
11968 2002-07-17  Martin Baulig  <martin@gnome.org>
11969
11970         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
11971         check whether mi.ReturnType implements the IEnumerator interface; the
11972         `==' and the IsAssignableFrom() will fail in this situation.
11973
11974 2002-07-16  Ravi Pratap  <ravi@ximian.com>
11975
11976         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
11977         here too.
11978
11979 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11980
11981         * expression.cs: fixed bug #27811.
11982
11983 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
11984
11985         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
11986         Molaro: when we are a ref, the value already contains a pointer
11987         value, do not take the address of it.
11988
11989 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
11990         * removed mb-parser.jay and mb-tokenizer.cs
11991
11992 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11993
11994         * expression.cs: check against the building corlib void type.
11995
11996 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
11997
11998         * ecore.cs: fix for valuetype static readonly fields: when 
11999         initializing them, we need their address, not the address of a copy.
12000
12001 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12002
12003         * typemanager.cs: register also enum_type in corlib.
12004
12005 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12006
12007         * class.cs: allow calling this (but not base) initializers in structs.
12008
12009 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12010
12011         * ecore.cs: make sure we compare against the building base types
12012         in GetTypeSize ().
12013
12014 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12015
12016         * typemanager.cs: fix TypeToCoreType() to handle void and object
12017         (corlib gets no more typerefs after this change).
12018
12019 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12020
12021         * expression.cs (ArrayCreation.EmitArrayArguments): use
12022         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12023
12024         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12025         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12026         array indexes, the runtime actually forbids them.
12027
12028         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12029         for array arguments here.
12030
12031         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12032         instead of the default for ValueTypes.
12033
12034         (New.DoEmit): Use IsValueType instead of
12035         IsSubclassOf (value_type)
12036         (New.DoResolve): ditto.
12037         (Invocation.EmitCall): ditto.
12038
12039         * assign.cs (Assign): ditto.
12040
12041         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12042         Statements *are* currently doing part of their resolution during
12043         Emit.  
12044
12045         Expressions do always resolve during resolve, but statements are
12046         only required to propagate resolution to their children.
12047
12048 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12049
12050         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12051
12052         (LoadAssembly): Do not add the dll if it is already specified
12053
12054         (MainDriver): Add the System directory to the link path at the end,
12055         after all the other -L arguments. 
12056
12057         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12058         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12059         ldelem.u1) and using the opposite for sbytes.
12060
12061         This fixes Digger, and we can finally run it.
12062
12063         * driver.cs (UnixParseOption): Move the option parsing here.  
12064         (CSCParseOption): Implement CSC-like parsing of options.
12065
12066         We now support both modes of operation, the old Unix way, and the
12067         new CSC-like way.  This should help those who wanted to make cross
12068         platform makefiles.
12069
12070         The only thing broken is that /r:, /reference: and /lib: are not
12071         implemented, because I want to make those have the same semantics
12072         as the CSC compiler has, and kill once and for all the confussion
12073         around this.   Will be doing this tomorrow.
12074
12075         * statement.cs (Unsafe.Resolve): The state is checked during
12076         resolve, not emit, so we have to set the flags for IsUnsfe here.
12077
12078 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12079
12080         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12081         not catch the Error_ObjectRefRequired in SimpleName (as it is
12082         possible to have a class/instance variable name that later gets
12083         deambiguated), we have to check this here.      
12084
12085 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12086
12087         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12088         make static and put into Expression.
12089
12090         (Event.Define): Register the private field of the event with the 
12091         TypeManager so that GetFieldFromEvent can get at it.
12092
12093         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12094         keep track of the private field associated with an event which
12095         has no accessors.
12096
12097         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12098         private field.
12099
12100         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12101
12102 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12103
12104         * expression.cs (Binary.EmitBranchable): this routine emits the
12105         Binary expression in a branchable context.  This basically means:
12106         we need to branch somewhere, not just get the value on the stack.
12107
12108         This works together with Statement.EmitBoolExpression.
12109
12110         * statement.cs (Statement.EmitBoolExpression): Use
12111         EmitBranchable. 
12112
12113 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12114
12115         * statement.cs (For): Reduce the number of jumps in loops.
12116
12117         (For): Implement loop inversion for the For statement.
12118
12119         (Break): We can be breaking out of a Try/Catch controlled section
12120         (foreach might have an implicit try/catch clause), so we need to
12121         use Leave instead of Br.
12122
12123         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12124         now).  If the instace expression supports IMemoryLocation, we use
12125         the AddressOf method from the IMemoryLocation to extract the
12126         address instead of emitting the instance.
12127
12128         This showed up with `This', as we were emitting the instance
12129         always (Emit) instead of the Address of This.  Particularly
12130         interesting when This is a value type, as we dont want the Emit
12131         effect (which was to load the object).
12132
12133 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12134
12135         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12136
12137         * statement.cs (Checked): Set the CheckedState during the resolve
12138         process too, as the ConvCast operations track the checked state on
12139         the resolve process, and not emit.
12140
12141         * cs-parser.jay (namespace_member_declaration): Flag that we have
12142         found a declaration when we do.  This is used to flag error 1529
12143
12144         * driver.cs: Report ok when we display the help only.
12145
12146 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12147
12148         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12149
12150 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12151
12152         * cs-tokenizer.cs (define): We also have to track locally the
12153         defines.  AllDefines is just used for the Conditional Attribute,
12154         but we also need the local defines for the current source code. 
12155
12156 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * statement.cs (While, For, Do): These loops can exit through a
12159         Break statement, use this information to tell whether the
12160         statement is the last piece of code.
12161
12162         (Break): Flag that we break.
12163
12164         * codegen.cs (EmitContexts): New `Breaks' state variable.
12165
12166 2002-07-03  Martin Baulig  <martin@gnome.org>
12167
12168         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12169         modifiers in method declarations in structs.  Otherwise, you won't
12170         be able to override things like Object.Equals().
12171
12172 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12173
12174         * class.cs (Method, Property, Indexer): Do not allow the public
12175         modifier to be used in explicit interface implementations.
12176
12177         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12178         override modifiers in method declarations in structs
12179
12180 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12181
12182         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12183         integer or real overflow, report an error
12184
12185 2002-07-02  Martin Baulig  <martin@gnome.org>
12186
12187         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12188         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12189         to tell the runtime about our newly created System.Object and
12190         System.ValueType types.
12191
12192 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12193
12194         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12195         struct instead of Ldarg/Starg.
12196
12197 2002-07-02  Martin Baulig  <martin@gnome.org>
12198
12199         * expression.cs (Indirection.Indirection): Call
12200         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12201
12202 2002-07-02  Martin Baulig  <martin@gnome.org>
12203
12204         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12205         ValueType, call TypeManager.TypeToCoreType() on it.
12206         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12207         the OpCodes.Newarr argument.
12208
12209 2002-07-02  Martin Baulig  <martin@gnome.org>
12210
12211         * expression.cs (Invocation.EmitCall): When compiling corlib,
12212         replace all calls to the system's System.Array type to calls to
12213         the newly created one.
12214
12215         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12216         System.Array methods.
12217         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12218         from the system's System.Array type which must be replaced.
12219
12220 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12221
12222         * typemanager.cs: load unverifiable_code_ctor so we can build
12223         corlib using the correct type. Avoid using GetTypeCode() with
12224         TypeBuilders.
12225         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12226         TypeManager.object_type to allow building corlib.
12227
12228 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12229
12230         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12231
12232 2002-07-01  Martin Baulig  <martin@gnome.org>
12233
12234         * class.cs: Make the last change actually work, we need to check
12235         whether `ifaces != null' to avoid a crash.
12236
12237 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12238
12239         * class.cs: when we build structs without fields that implement
12240         interfaces, we need to add the interfaces separately, since there is
12241         no API to both set the size and add the interfaces at type creation
12242         time.
12243
12244 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12245
12246         * expression.cs: the dimension arguments to the array constructors
12247         need to be converted if they are a long.
12248
12249 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12250
12251         * class.cs: don't emit ldarg.0 if there is no parent constructor
12252         (fixes showstopper for corlib).
12253
12254 2002-06-29  Martin Baulig  <martin@gnome.org>
12255
12256         MCS now compiles corlib on GNU/Linux :-)
12257
12258         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12259         ie. check for MethodImplOptions.InternalCall.
12260
12261         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12262         and TypeManager.attribute_type are null, so we must explicitly check
12263         whether parent is not null to find out whether it's an attribute type.
12264         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12265         and SetBuilder, not only if the property is neither abstract nor external.
12266         This is necessary to set the MethodImplOptions on the accessor methods.
12267         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12268         SetBuilder, see Property.Emit().
12269
12270         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12271         populate "System.Object", "System.ValueType" and "System.Attribute" since
12272         they've already been populated from BootCorlib_PopulateCoreTypes().
12273
12274 2002-06-29  Martin Baulig  <martin@gnome.org>
12275
12276         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12277         is the NullLiteral, we also need to make sure that target_type is not
12278         an enum type.   
12279
12280 2002-06-29  Martin Baulig  <martin@gnome.org>
12281
12282         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12283         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12284         before calling BootstrapCorlib_ResolveDelegate ().
12285
12286 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12287
12288         * statement.cs: fixed build-breaker. All tests passed ok.
12289
12290 2002-06-27  Martin Baulig  <martin@gnome.org>
12291
12292         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12293         for System.Decimal when compiling corlib.
12294
12295 2002-06-27  Martin Baulig  <martin@gnome.org>
12296
12297         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12298         switch blocks which contain nothing but a default clause.
12299
12300 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12301
12302        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12303
12304 2002-06-27  Martin Baulig  <martin@gnome.org>
12305
12306         * ecore.cs (PropertyExpr.PropertyExpr): Call
12307         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12308
12309         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12310         is already a TypeBuilder.
12311
12312 2002-06-27  Martin Baulig  <martin@gnome.org>
12313
12314         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12315         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12316         the "from an array-type to System.Array" case.  This makes it work
12317         when compiling corlib.
12318
12319 2002-06-27  Martin Baulig  <martin@gnome.org>
12320
12321         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12322         non-static PropertyExpr, set its InstanceExpression.  This makes
12323         the `ICollection.Count' property work in System/Array.cs.
12324
12325 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12326
12327         * driver.cs: Made error handling more consistent.  Errors now
12328         tracked by Report class, so many methods which used to return int
12329         now return void.  Main() now prints success/failure and 
12330         errors/warnings message.
12331
12332         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12333         the magic number return values (123 and 124).  Now, if the
12334         expected error occurs, the compiler exits with success (exit value
12335         0).  If the compilation completes without seeing that particular
12336         error, the compiler exits with failure (exit value 1).  The
12337         makefile in mcs/errors has been changed to handle the new behaviour.
12338
12339         * report.cs: Made 'expected error' number a property and renamed
12340         it from 'Probe' to 'ExpectedError'.
12341
12342         * genericparser.cs: Removed error handling support, since it is
12343         now all done by Report class.
12344
12345         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12346         class, so parse() no longer returns an int.
12347
12348         * namespace.cs: Use Report.Error instead of GenericParser.error
12349
12350 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12351
12352         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12353         TypeContainer.AddOperator): At the front of the list put the
12354         explicit implementations, so they get resolved/defined first. 
12355
12356 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12357
12358         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12359         interface type is implemented by this TypeContainer.  Used during
12360         explicit interface implementation.
12361
12362         (Property.Define, Indexer.Define, Method.Define): Validate that
12363         the given interface in the explicit implementation is one of the
12364         base classes for the containing type.
12365
12366         Also if we are explicitly implementing an interface, but there is
12367         no match in the pending implementation table, report an error.
12368
12369         (Property.Define): Only define the property if we are
12370         not explicitly implementing a property from an interface.  Use the
12371         correct name also for those properties (the same CSC uses,
12372         although that is really not needed).
12373
12374         (Property.Emit): Do not emit attributes for explicitly implemented
12375         properties, as there is no TypeBuilder.
12376
12377         (Indexer.Emit): ditto.
12378
12379         Hiding then means that we do not really *implement* a pending
12380         implementation, which makes code fail.
12381
12382 2002-06-22  Martin Baulig  <martin@gnome.org>
12383
12384         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12385         the return value of Object.GetType().  [FIXME: we need to do this whenever
12386         we get a type back from the reflection library].
12387
12388 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12389
12390         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12391
12392 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12393
12394         * attribute.cs: Return null if we can not look up the type.
12395
12396         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12397         the interface types found.
12398
12399         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12400         interface types found.
12401
12402         * typemanager.cs (GetInterfaces): Make this routine returns alll
12403         the interfaces and work around the lame differences between
12404         System.Type and System.Reflection.Emit.TypeBuilder in the results
12405         result for GetInterfaces.
12406
12407         (ExpandInterfaces): Given an array of interface types, expand and
12408         eliminate repeated ocurrences of an interface.  This expands in
12409         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12410         be IA, IB, IC.
12411
12412 2002-06-21  Martin Baulig  <martin@gnome.org>
12413
12414         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12415         on System.Enum.
12416
12417 2002-06-21  Martin Baulig  <martin@gnome.org>
12418
12419         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12420         and called with one of the core types, return the corresponding typebuilder for
12421         that type.
12422
12423         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12424         element type.
12425
12426 2002-06-21  Martin Baulig  <martin@gnome.org>
12427
12428         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12429         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12430         (Expression.ConvertReferenceExplicit): Likewise.
12431
12432         * expression.cs (ElementAccess.DoResolve): Likewise.
12433         (ElementAccess.DoResolveLValue): Likewise.
12434
12435 2002-06-10  Martin Baulig  <martin@gnome.org>
12436
12437         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12438         add the "value" parameter to the parameter list.
12439
12440         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12441         to our caller.
12442
12443 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12444
12445         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12446         the argument to an int, uint, long or ulong, per the spec.  Also
12447         catch negative constants in array creation.
12448
12449 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12450
12451         * class.cs: do not allow the same interface to appear twice in
12452         the definition list.
12453
12454 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12455
12456         * ecore.cs: don't use ldlen with System.Array.
12457
12458 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12459
12460         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12461
12462 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12463
12464         * modifiers.cs: produce correct field attributes for protected
12465         internal. Easy fix so miguel can work on ther harder stuff:-)
12466
12467 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12468
12469         * pending.cs: New file.  Move the code from class.cs here.
12470         Support clearning the pending flag for all methods (when not doing
12471         explicit interface implementation).
12472
12473 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12474
12475         * rootcontext.cs: added a couple more types needed to bootstrap.
12476
12477 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12478
12479         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12480         constructor in the type, instead of any constructor in the type
12481         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12482         a bug in the Mono runtime when applying the params attribute). 
12483
12484 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12485         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12486
12487 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12488
12489         * expression.cs (Unary.ResolveOperator): Use TypeManager
12490         to resolve the type.
12491
12492 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12493
12494         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12495         attached.
12496
12497         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12498         with each member too.
12499
12500         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12501         field builders too - this takes care of the enum member case.
12502
12503 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12504
12505         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12506         address-of operator on both value types and pointers.
12507
12508 2002-06-10  Martin Baulig  <martin@gnome.org>
12509
12510         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12511         PropertyBuilder to the `property_builders' list.
12512
12513         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12514         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12515         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12516         find any indexers which are inherited from an interface.
12517
12518 2002-06-09  Martin Baulig  <martin@gnome.org>
12519
12520         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12521         the same type as the constant if necessary.  There's also a test-130.cs
12522         for this.
12523
12524         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12525
12526         * typemanager.cs (TypeManager.ChangeType): Previously known as
12527         Enum.ChangeEnumType().
12528
12529 2002-06-09  Martin Baulig  <martin@gnome.org>
12530
12531         * expression.cs (Cast.TryReduce): Added support for consts.
12532
12533 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12534
12535         * class.cs (Accessor): Hold attributes information so we can pass
12536         it along.
12537
12538         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12539         Modify to pass in attributes attached to the methods.
12540
12541         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12542
12543         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12544         to handle the Accessor kind :-)
12545
12546         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12547
12548 2002-06-08  Martin Baulig  <martin@gnome.org>
12549
12550         * expression.cs (Unary.TryReduceNegative): Added support for
12551         ULongConstants.
12552
12553 2002-06-08  Martin Baulig  <martin@gnome.org>
12554
12555         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12556         name can't be found in the `defined_names' - the caller will do a
12557         MemberLookup in this case and thus find methods in System.Enum
12558         such as Enum.IsDefined().
12559
12560 2002-06-08  Martin Baulig  <martin@gnome.org>
12561
12562         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12563         Convert.ChangeType() which works with TypeBuilder created types.
12564         (Enum.LookupEnumValue, Enum.Define): Use it here.
12565
12566         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12567         `TypeBuilder.BaseType != null' check.
12568         (TypeContainer.FindMembers): Only lookup parent members if we
12569         actually have a parent.
12570         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12571         (ConstructorInitializer.Resolve): Likewise.
12572
12573         * interface.cs (Interface.FindMembers): Added
12574         `TypeBuilder.BaseType != null' check.
12575
12576         * rootcontext.cs (RootContext.ResolveCore): Added
12577         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12578         classes_second_stage.
12579
12580         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12581         debug_type and trace_type when compiling with --nostdlib.       
12582
12583 2002-06-07  Martin Baulig  <martin@gnome.org>
12584
12585         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12586         (AddField): Set it to true when adding a non-static field.
12587         (DefineType): Use `have_nonstatic_fields' to find out whether we
12588         have non-static fields, not `Fields != null'.
12589
12590 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12591
12592         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12593         dereferencing a null on the static-field code path)
12594
12595 2002-05-30  Martin Baulig  <martin@gnome.org>
12596
12597         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12598         to take command line arguments.  Use reflection to call the new
12599         custom `Initialize' function on the symbol writer and pass it the
12600         command line arguments.
12601
12602         * driver.cs (--debug-args): New command line argument to pass command
12603         line arguments to the symbol writer.
12604
12605 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12606
12607         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12608         the target type for indexers and properties.  Thanks to Joe for
12609         catching this.
12610
12611 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12612
12613         * typemanager.cs (MethodFlags): returns the method flags
12614         (Obsolete/ShouldIgnore) that control warning emission and whether
12615         the invocation should be made, or ignored. 
12616
12617         * expression.cs (Invocation.Emit): Remove previous hack, we should
12618         not do this on matching a base type, we should do this based on an attribute
12619
12620         Only emit calls to System.Diagnostics.Debug and
12621         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12622         on the command line.
12623
12624         * rootcontext.cs: Global settings for tracing and debugging.
12625
12626         * cs-tokenizer.cs (define): New utility function to track
12627         defines.   Set the global settings for TRACE and DEBUG if found.
12628
12629 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12630
12631         * interface.cs (Populate*): Pass in the TypeContainer as well as
12632         the DeclSpace as parameters so that we can create EmitContexts and
12633         then use that to apply attributes etc.
12634
12635         (PopulateMethod, PopulateEvent, PopulateProperty)
12636         (PopulateIndexer): Apply attributes everywhere.
12637
12638         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12639         etc.
12640
12641         (ApplyAttributes): Update accordingly.
12642
12643         We now apply interface attributes for all members too.
12644
12645 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12646
12647         * class.cs (Indexer.Define); Correctly check if we are explicit
12648         implementation (instead of checking the Name for a ".", we
12649         directly look up if the InterfaceType was specified).
12650
12651         Delay the creation of the PropertyBuilder.
12652
12653         Only create the PropertyBuilder if we are not an explicit
12654         interface implementation.   This means that explicit interface
12655         implementation members do not participate in regular function
12656         lookups, and hence fixes another major ambiguity problem in
12657         overload resolution (that was the visible effect).
12658
12659         (DefineMethod): Return whether we are doing an interface
12660         implementation. 
12661
12662         * typemanager.cs: Temporary hack until we get attributes in
12663         interfaces (Ravi is working on that) and we get IndexerName
12664         support in interfaces.
12665
12666         * interface.cs: Register the indexers as properties.
12667
12668         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12669         warning, I have verified that this is a bug in the .NET runtime
12670         (JavaScript suffers of the same problem).
12671
12672         * typemanager.cs (MemberLookup): When looking up members for
12673         interfaces, the parent of an interface is the implicit
12674         System.Object (so we succeed in searches of Object methods in an
12675         interface method invocation.  Example:  IEnumerable x;  x.ToString
12676         ()) 
12677
12678 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * class.cs (Event): Events should also register if they do
12681         implement the methods that an interface requires.
12682
12683         * typemanager.cs (MemberLookup); use the new GetInterfaces
12684         method. 
12685
12686         (GetInterfaces): The code used to lookup interfaces for a type is
12687         used in more than one place, factor it here. 
12688
12689         * driver.cs: Track the errors at the bottom of the file, we kept
12690         on going.
12691
12692         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12693         instance if the method we are calling is static!
12694
12695 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12696
12697         * attribute.cs (ApplyAttributes): Make this function filter out
12698         the IndexerName attribute (as that attribute in reality is never
12699         applied) and return the string constant for the IndexerName
12700         attribute. 
12701
12702         * class.cs (TypeContainer.Emit): Validate that all the indexers
12703         have the same IndexerName attribute, and if so, set the
12704         DefaultName attribute on the class. 
12705
12706         * typemanager.cs: The return value might contain other stuff (not
12707         only methods).  For instance, consider a method with an "Item"
12708         property and an Item method.
12709
12710         * class.cs: If there is a problem with the parameter types,
12711         return. 
12712
12713 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12714
12715         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12716         looks at user defined conversion after making a call to 
12717         StandardConversionExists - we need this for overload resolution.
12718
12719         * expression.cs : Update accordingly the various method calls.
12720
12721         This fixes 2 bugs filed against implicit user defined conversions 
12722
12723 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12724
12725         * statement.cs: Track the result of the assignment.
12726
12727 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12728
12729         * expression.cs (MemberAccess): Improved error reporting for
12730         inaccessible members.
12731
12732 2002-05-22  Martin Baulig  <martin@gnome.org>
12733
12734         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12735         itself with debugging support.
12736
12737 2002-05-22  Martin Baulig  <martin@gnome.org>
12738
12739         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12740         Removed, this isn't needed anymore.
12741
12742 2002-05-20  Martin Baulig  <martin@gnome.org>
12743
12744         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12745         be underlying type for an enum.
12746
12747 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12748
12749         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12750         that splits out the loading of just the core types.
12751
12752         * rootcontext.cs (ResolveCore): Split the struct resolution in
12753         two, so we can load the enumeration underlying types before any
12754         enums are used.
12755
12756         * expression.cs (Is): Bandaid until we fix properly Switch (see
12757         bug #24985 for details).
12758
12759         * typemanager.cs (ImplementsInterface): The hashtable will contain
12760         a null if there are no interfaces implemented.
12761
12762 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * cs-parser.jay (indexer_declarator): It is fine to have array
12765         parameters
12766
12767 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12768
12769         * typemanager.cs: (RegisterBuilder): New function used to register
12770         TypeBuilders that implement interfaces.  Since
12771         TypeBuilder.GetInterfaces (as usual) does not work with lame
12772         Reflection.Emit. 
12773         (AddUserType): register interfaces.
12774
12775         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12776         dealing with TypeBuilder.  Also, arrays are showing up as
12777         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12778         methods can not be invoked on them!
12779
12780         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12781         (ImplicitReferenceConversionExists): Split out from
12782         StandardConversionExists. 
12783
12784         * expression.cs (As): We were only implementing one of the three
12785         cases for the as operator.  We now implement them all.
12786         (Is): Implement the various other cases for Is as well.
12787
12788         * typemanager.cs (CACHE): New define used to control if we want or
12789         not the FindMembers cache.  Seems to have a negative impact on
12790         performance currently
12791
12792         (MemberLookup): Nested types have full acess to
12793         enclosing type members
12794
12795         Remove code that coped with instance/static returns for events, we
12796         now catch this in RealFindMembers.
12797
12798         (RealFindMembers): only perform static lookup if the instance
12799         lookup did not return a type or an event.  
12800
12801 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12802
12803         * assign.cs (CompoundAssign): We pass more semantic information
12804         now to Compound Assignments than we did before: now we have all
12805         the information at hand, and now we resolve the target *before* we
12806         do the expression expansion, which allows the "CacheValue" method
12807         to have the effect we intended (before, a [x] += 1 would generate
12808         two differen ArrayAccess expressions from the ElementAccess,
12809         during the resolution process).
12810
12811         (CompoundAssign.DoResolve): Resolve target and original_source here.
12812
12813 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12814
12815         * expression.cs (ArrayAccess): dropped debugging information. 
12816
12817         * typemanager.cs: Small bug fix: I was always returning i_members,
12818         instead of one of i_members or s_members (depending on which had
12819         the content).
12820
12821         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12822         method is invoked before any code generation takes place, and it
12823         is a mechanism to inform that the expression will be invoked more
12824         than once, and that the method should use temporary values to
12825         avoid having side effects
12826
12827         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12828
12829         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12830         implementation.
12831
12832         * expression.cs (Indirection, ArrayAccess): Add support for
12833         CacheTemporaries in these two bad boys. 
12834
12835         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12836         ldobj or ldind_ref.  
12837         (StoreFromPtr): Handle stobj as well.
12838
12839         * expression.cs (UnaryMutator): Share more code.
12840
12841         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12842         down: I was not tracking the Filter function as well, which
12843         was affecting the results of the cache.
12844
12845 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12846
12847         * attribute.cs: Remove the hack to handle the CharSet property on
12848         StructLayouts. 
12849
12850 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12851
12852         * attribute.cs (DoResolve): More uglyness, we now only try to
12853         resolve the attribute partially, to extract the CharSet
12854         information (only if we are a StructLayout attribute).  Otherwise 
12855
12856         (GetExtraTypeInfo): Add some code to conditionally kill in the
12857         future this.   I am more and more convinced that the .NET
12858         framework has special code to handle the attribute setting on
12859         certain elements.
12860
12861         * expression.cs (IsParamsMethodApplicable): Revert my previous
12862         foreach change here, it was wrong.
12863
12864 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12865
12866         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12867         (pp_expr): do not abort on unknown input, just return.
12868         (eval): abort if there are pending chars.
12869
12870         * attribute.cs (Attribute.Resolve): Positional parameters are
12871         optional.  Deal with that case.
12872
12873         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12874         the Ansi/Unicode/Auto information for the type.
12875
12876         (TypeContainer.DefineType): instantiate the EmitContext here, as
12877         we will be using it during the type definition (to resolve
12878         attributes) and during the emit phase.
12879
12880         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12881         to pull type information out of the attributes
12882
12883         (Attribute.Resolve): track the constructor builder, and allow for
12884         multiple invocations (structs and classes will use this).
12885
12886         * ecore.cs (MemberLookupFinal): new version with all the
12887         parameters customizable.
12888
12889         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12890         constructors.  Return if the result value is null (as the error
12891         would have been flagged already by MemberLookupFinal)
12892
12893         Do not allow instances of abstract classes or interfaces to be
12894         created.
12895
12896         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12897         We have to compare the assembly property here when dealing with
12898         FamANDAssem and Assembly access modifiers, because we might be
12899         creating an assembly from *modules* (that means that we are not
12900         getting TypeBuilders for types defined in other modules that are
12901         part of this assembly).
12902
12903         (Method.Emit): If the method is marked abstract and has a body,
12904         emit an error. 
12905
12906         (TypeContainer.DefineMembers): If both the defined member and the
12907         parent name match are methods, then do not emit any warnings: let
12908         the Method.Define routine take care of flagging warnings.  But if
12909         there is a mismatch (method overrides something else, or method is
12910         overriwritten by something, then emit warning).
12911
12912         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12913         set to null, this means `do not check for the return type on the
12914         signature'. 
12915
12916         (Method.Define): set the return type for the method signature to
12917         null, so that we get methods with the same name and parameters and
12918         different return types.  This is used to flag warning 114 (you are
12919         hiding a method, and you probably want to use the new/override
12920         keywords instead).
12921
12922         * typemanager.cs (MemberLookup): Implemented proper access
12923         control, closing a long standing set of bug reports.  The problem
12924         was that the Framework only has two bits: Public and NonPublic,
12925         and NonPublic includes private and protected methods, but we need
12926         to enforce the FamANDAssem, FamOrAssem and Family. 
12927
12928 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
12929
12930         * statement.cs (GotoCase): Return true: Ammounts to giving up
12931         knowledge on whether we return or not, and letting the other case
12932         be responsible for it.
12933
12934 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
12935
12936         * driver.cs: Do not load directories for each file processed, only
12937         do it if there is a pattern.
12938
12939         * ecore.cs: Report readonly assigns here as well, as we might have
12940         been resolved only by MemberAccess.
12941
12942         (SimpleName.SimpleNameResolve): Also be useful for LValue
12943         resolution.   We need this to propagate assign to local readonly variables
12944
12945         * typemanager.cs: Use a ptrhashtable for the criteria, because we
12946         do not want to reuse potential criteria memory.
12947
12948         * class.cs (MyEventBuilder): Set reflected_type;
12949
12950         * ecore.cs (Constantify): Added support for constifying bools.
12951
12952         (RootContext.LookupType): Added a cache for values looked up in
12953         the declaration space.
12954
12955         * typemanager.cs (FindMembers): Now is a front-end to
12956         RealFindMembers, and provides a two-level hashtable-based cache to
12957         the request.  
12958
12959         15% performance improvement: from 22.5 to 19.2 seconds.
12960
12961         * expression.cs (IsParamsMethodApplicable): use foreach.
12962         (Invocation.DoResolve): ditto.
12963         (New.DoResolve): ditto.
12964         (ArrayCreation.DoResolve): ditto.
12965
12966         * ecore.cs (FindMostEncompassingType): use foreach.
12967
12968         * delegate.cs (NewDelegate.DoResolve): Use foreach
12969
12970         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
12971         (RemoveMethods): use foreach.
12972
12973         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
12974         nested foreach statements instead of for, and also break out of
12975         the inner loop once a match is found.
12976
12977         (Invocation.OverloadResolve): Use foreach, simplify the code. 
12978
12979 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
12980
12981         * cfold.cs (BinaryFold): During an enumeration evaluation context,
12982         we actually unwrap the expression to allow for extra information
12983         to be extracted. 
12984
12985         * expression.cs: Use Shr_Un on unsigned operations. 
12986
12987 2002-05-08  Ravi Pratap  <ravi@ximian.com>
12988
12989         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
12990         applicable operators was not being considered correctly. This closes
12991         the bug Miguel reported.
12992
12993 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
12994
12995         * attribute.cs: check that the type derives from System.Attribute
12996         and report the correct error in that case (moved the duplicate code to
12997         its own method, too).
12998
12999 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13000
13001         * attribute.cs: lookup attribute type name as the spec says: first the
13002         bare attribute name and then name + "Attribute" (nant compiles with
13003         mcs after this fix).
13004
13005 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13006
13007         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13008         Because of the way we parse things, we should try to see if a
13009         UIntConstant can fit in an integer.
13010
13011 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13012
13013         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13014         when we are in an explicit context.
13015
13016         (ConvertReferenceExplicit): When converting from Iface type S to Class
13017         T make sure the rules are implemented as an OR.
13018
13019         * parameter.cs (ParameterType): Make it a property for now although the
13020         purpose really isn't anything immediate.
13021
13022         * expression.cs (Is*Applicable): Do better checking on the parameter type
13023         of a ref/out parameter. The ones from the system assemblies are already 
13024         marked with the correct type so we don't need to do any correction.
13025
13026         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13027         the object type is standard too so include that.
13028
13029 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13030
13031         * ecore.cs (StandardConversionExists): Augment with missing code:
13032         deal with IntConstant, LongConstants and Enumerations.
13033
13034         * assign.cs: Report the error, instead of failing silently
13035
13036         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13037         typecontainer that they are declared, because the
13038         typecontainer/namespace will have the list of using clauses that
13039         need to be applied.
13040
13041         Assembly Attributes were escaping the normal registration
13042         mechanism. 
13043
13044         (EmitCode): Apply attributes within an EmitContext that represents
13045         the container they were declared on.
13046
13047         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13048
13049 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13050
13051         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13052         Revamp completely - make much cleaner as we now operate only
13053         on a set of Types.
13054
13055         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13056         to implement the logic detailed in the spec more correctly.
13057
13058         (UserDefinedConversion): Update accordingly.
13059
13060 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13061
13062         * statement.cs: Return flow analysis information up.
13063
13064         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13065         and the default.
13066
13067         (token): Do not consume an extra character before calling
13068         decimal_digits.
13069
13070 2002-05-06  Piers Haken <piersh@friskit.com>
13071
13072         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13073
13074 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13075
13076         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13077         EmitContext during the instance constructor initializer
13078         resolution, to stop access to instance variables.
13079
13080         This is mandated by the spec, last paragraph of the `constructor
13081         initializers' section. 
13082
13083 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13084
13085         * cs-parser.jay, class.cs (Accessor): new class used to represent
13086         an accessor (get or set).  In the past we used `null' to represent
13087         a missing accessor.  But this is ambiguous because there was no
13088         way to tell in abstract indexers/properties if one of them was
13089         specified.
13090
13091         Now there is a way of addressing that.
13092
13093         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13094         instead of FindMembers.
13095
13096         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13097         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13098
13099         * attribute.cs: Treat indexers and properties as the same in terms
13100         of applying attributes
13101
13102         * ecore.cs (FindMostEncompassedType): Use statically initialized
13103         EmptyExpressions()s like we do elsewhere to avoid creating useless
13104         objects (and we take this out of the tight loop).
13105
13106         (GetConversionOperators): Move the code to extract the actual
13107         operators to a separate routine to clean things up.
13108
13109 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13110
13111         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13112         events are always registered FieldBuilders.
13113
13114         * class.cs (FieldBase): New class shared by Fields 
13115
13116         * delegate.cs: If we are a toplevel delegate, use our full name.
13117         If we are a nested delegate, then only use our tail name.
13118
13119 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13120
13121         * expression.cs (IsApplicable): Ensure that we add the "&" to
13122         ref/out types before comparing it with the type of the argument.
13123
13124         (IsParamsMethodApplicable): Ditto.
13125
13126         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13127         silly me ;-)
13128
13129         * delegate.cs : Handle the case when we have more than one applicable
13130         method. Flag an error only when we finish checking all.
13131
13132 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * expression.cs: Add support for boolean static initializers.
13135
13136 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13137
13138         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13139
13140         * parameter.cs (ComputeParameterTypes,
13141         ComputeAndDefineParameterTypes): Better error handling: now we
13142         clear the `types' cache if we fail during any of the type lookups.
13143         We also return the status code correctly to our caller
13144
13145         * delegate.cs: If we fail to define a delegate, abort the extra
13146         steps. 
13147
13148         * expression.cs (Binary.ResolveOperator): for
13149         operator==(object,object) and operator !=(object, object) we also
13150         have to verify that there is an implicit conversion from one to
13151         the other.
13152
13153         (ArrayAccess.DoResolve): Array Access can operate on
13154         non-variables. 
13155
13156 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13157
13158         * assign.cs (CompoundAssign): A new class used as a "flag" that
13159         the assignment actually is happening as part of a compound
13160         assignment operator.
13161
13162         During compound assignment, a few new rules exist to enable things
13163         like:
13164
13165         byte b |= 1 + 2
13166
13167         From the spec:
13168
13169         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13170         to the type of x) if y is implicitly convertible to the type of x,
13171         and the operator is a builtin operator and the return type of the
13172         operator is explicitly convertible to the type of x. 
13173
13174         * rootcontext.cs: Reset warning level to 2.  4 catches various
13175         "interesting" features in mcs, we must clean this up at some
13176         point, but currently am trying to kill other bugs ;-)
13177
13178         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13179         in container classes as well.  
13180
13181         * expression.cs (Binary.ResolveOperator): Handle string case
13182         before anything else (as operator overloading does emit an error
13183         before doing anything else).
13184
13185         This code could go away when we move to a table driven model, but
13186         i could not come up with a good plan last night.
13187
13188 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13189
13190         * typemanager.cs (CSharpName): reimplementation using regex.
13191         * class.cs: added null check for fields in Emit
13192         * rootcontext.cs: set warninglevel to 4
13193
13194 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13195
13196         * typemanager.cs (CSharpName): reimplemented with Lupus
13197         suggestion.
13198
13199 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * statement.cs (If): correclty implement Resolve, because we were
13202         not catching sem errors in there.  The same process is needed
13203         everywhere else. 
13204         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13205
13206
13207         (Statement.Warning_DeadCodeFound): Factorize code.
13208         (While): Report dead code here too.
13209
13210         (Statement): Added Resolve virtual method to allow
13211         for resolution split from the emit code.
13212
13213 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13214
13215         * statement.cs (EmitBoolExpression): No longer try to resolve the
13216         expression here.    
13217         (MakeBoolean): New utility function that resolve, implicitly
13218         converts to boolean and tags the expression. 
13219
13220
13221         (If, Do): Implement dead code elimination.
13222         (While): Implement loop inversion
13223
13224         (Do, While, For, If): Resolve the expression prior to calling our
13225         code generation.
13226
13227 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13228
13229         * class.cs:
13230           - added method Report28 (warning: program has more than one entry point)
13231           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13232           - modified method Method.Define, the part at the end of the method
13233
13234         * rootcontext.cs: added static public Location EntryPointLocation;
13235           
13236         * ../errors/cs0028.cs : Add test case for the above warning.              
13237
13238         * typemanager.cs:
13239           - modified method CSharpName to allow arrays of primitive type to
13240             be printed nicely (e.g. instead of System.Int32[][] it now prints
13241             int[][])
13242           - added method CSharpSignature: returns the signature of a method
13243             in string format to be used in reporting errors, warnings, etc.
13244
13245         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13246         with String.Empty.
13247
13248 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13249
13250         * delegate.cs (Define): Fix extremely silly bug where I was
13251         setting the type of the 'object' parameter of the BeginInvoke
13252         method to System.IAsyncResult instead of System.Object ;-)
13253
13254 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13255
13256         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13257         here. 
13258
13259         (Constructor.Emit): return if we fail to initialize the
13260         constructor.  Another door closed!  
13261
13262         * expression.cs (New.DoResolve): Improve error message (from -6 to
13263         1501).  Use DeclaredOnly lookup to find the exact constructor.
13264
13265         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13266         loop.  This is useful.
13267
13268         * cs-parser.jay: Adjust the default parameters so that destructors
13269         have the proper signature.
13270
13271 2002-04-26  Martin Baulig  <martin@gnome.org>
13272
13273         * driver.cs (LoadAssembly): If `assembly' contains any characters
13274         which are only valid in path names and not in assembly names
13275         (currently slash, backslash and point), use Assembly.LoadFrom ()
13276         instead of Assembly.Load () on the `assembly' (before iteration
13277         over the link_paths).
13278
13279 2002-04-26  Martin Baulig  <martin@gnome.org>
13280
13281         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13282
13283 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13284
13285         * class.cs (Property): use the new typemanager.MemberLookup
13286
13287         (TypeContainer.MemberLookup): Implement using the
13288         TypeManager.MemberLookup now. 
13289
13290         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13291         and return MemberInfos, so that these can be used without an
13292         EmitContext (what we had before).
13293
13294 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13295
13296         * expression.cs: Fix the case where the argument to params if the
13297         type of the params.  I omitted handling this before.   Fixed
13298
13299 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13300
13301         * driver.cs: Call BootCorlib_PopulateCoreType
13302
13303         * class.cs (Property.CheckBase): Check for properties only, not
13304         for all members. 
13305
13306         * interface.cs: Temporary hack: try/catch around the
13307         CustomAttributeBuilder, because I am getting an exception that I
13308         do not understand.
13309
13310         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13311         types whose definitions are required to be there (attributes are
13312         defined before standard types).
13313
13314         Compute definitions as we boot the various types, as they are used
13315         immediately (value_type class will need object_type, but if we do
13316         not initialize object_type, we will pass a null, which will let
13317         the runtime pick the System.Object from the existing corlib, which
13318         is not what we want).
13319
13320 2002-04-22  Patrik Torstensson <totte@labs2.com>
13321
13322         * cs-tokenizer.cs: fixed a number of trim() issues.
13323
13324 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13325
13326         * expression.cs (Argument.Type): Ensure that we return the correct
13327         type when we have out or ref parameters [in which case we 
13328         append a "&"].
13329
13330 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13331
13332         * class.cs (Property, Indexer): Allow extern modifier in there. 
13333
13334         * typemanager.cs (InitBaseTypes): Initializes object_type and
13335         value_type, since those will be used early on during the bootstrap
13336         process to compile corlib.
13337
13338         (InitCoreTypes): Move code from here to InitBaseTypes.
13339
13340 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13341
13342         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13343         single-dimension arrays as using the ldlen opcode.  
13344
13345         Daniel Lewis discovered this optimization.  
13346
13347         * typemanager.cs: Add signature for System.Array::get_Length
13348
13349 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13350
13351         * statement.cs: report the error when the foreach does not apply to an
13352         array nor a collection.
13353
13354 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13355
13356         * expression.cs: Add implicit conversions to the operator ~.
13357
13358         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13359
13360         * typemanager.cs: Locate the decimal constructor.
13361
13362 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13363
13364         * attribute.cs: use the new property of TypeOf.
13365         * expression.cs: added 'get' property around typearg.
13366
13367         These changes fix a build breaker reported by NickD. Is this the
13368         correct way to fix?  If not, please, revert my changes and make it
13369         work :-).
13370
13371 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * attribute.cs: Add support for typeof in attribute invocations.
13374         I am not sure that this is right though.
13375
13376 2002-04-14  Duncan Mak  <duncan@ximian.com>
13377
13378         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13379         Binary.Operator.Division case.
13380
13381 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13382
13383         * class.cs (DefineType): Ensure that we do a proper check on
13384         attribute types and also register it with the TypeManager.
13385
13386         (TypeContainer.Targets): The default for attribute types is
13387         AttributeTargets.All.
13388
13389         * attribute.cs (ApplyAttributes): Registering the attribute type
13390         is done elsewhere, not when we discover we have a Usage attribute.
13391
13392 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13393
13394         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13395         and get rid of is_delegate parameter.
13396
13397         * everywhere : update.
13398
13399 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13400
13401         * cs-parser.jay (compilation_unit): Revamp completely to use
13402         some new ideas that I got from Rhys' grammar to solve the problems
13403         with assembly level attributes.
13404
13405         (outer_declaration): New grammar production.
13406
13407         (attribute_sections): Add.
13408
13409         (opt_attributes): Base on attribute_sections
13410
13411         (namespace_declaration): Allow opt_attributes to tackle the case
13412         when we have assembly level attributes - we are clever in this
13413         regard now ;-)
13414
13415         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13416         attributes in the non-global context.
13417
13418         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13419         instead of SetGlobalAttributes.
13420
13421         * class.cs, rootcontext.cs : Ensure we define and generate 
13422         attribute types before anything else.
13423
13424         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13425         and flag the new error -20 for the case when the attribute type
13426         does not have valid targets specified. csc does not catch this.
13427
13428         * ../errors/errors.txt : update for error # -20
13429
13430 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13431
13432         * support.cs (InternalParameters.ParameterModifier): Do some null
13433         checking and return sane values.
13434
13435         * class.cs (Method.Define): If we are a PInvoke method, ensure
13436         that we are static and extern. Report error # 601
13437
13438         * ../errors/cs0601.cs : Add test case for the above error.
13439
13440 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13441
13442         * rootcontext.cs (attribute_types): We need to keep type of
13443         all attribute types separately and emit code for them first.
13444
13445         (RegisterAttribute) : Implement.
13446
13447         * class.cs (DefineType): Check if the current Type is a custom
13448         attribute type and register it accordingly.
13449
13450         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13451         adding the first attribute twice and rename to
13452
13453         (SetGlobalAttributes): this.
13454
13455         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13456         lookups.
13457
13458         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13459         if we are processing global arguments. Hmm, I am unsure of this.
13460
13461 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13462
13463         * expression.cs: added static array of strings to avoid calling
13464         Enum.ToString () for Operator in Binary. Significant recover of
13465         performance.
13466
13467 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13468
13469         * class.cs (FindMembers): Allow the Builders of the various
13470         members to be null.  If they are skip them.  This only happens
13471         during the PInvoke declaration.
13472
13473 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13476         failure, so we do not keep going afterwards.
13477
13478         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13479         wanted to pass `false' as the `is_delegate' argument.  If this is
13480         the case, why not use delegate_type == null to mean `is_delegate =
13481         false' and anything else as is_delegate = true.
13482
13483 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13484
13485         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13486         code for the section, not the beginning of the tests.
13487
13488 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13491
13492         * expression.cs (Binary): same.  Warn about errors where we have
13493         Enum/Enum in operator + as well.
13494
13495 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13496
13497         * statement.cs:
13498                 - added support for switch(bool)
13499                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13500                 - add TableSwitchEmit() to handle table-based switch statements
13501
13502 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13503
13504         * expression.cs (Invocation.OverloadResolve): Factor out code which
13505         does parameter compatibility checking with arguments so that we can 
13506         re-use the code even from Delegate.VerifyApplicability
13507
13508         (VerifyArgumentsCompat): Move above code here.
13509
13510         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13511         and instead make a call to the above method.
13512
13513 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13514
13515         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13516         We use it to keep track of classes which are attribute types.
13517
13518 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13519
13520         * delegate.cs (Delegate.Define): Correctly define the types in the
13521         presence of fixed and array parameters.
13522
13523         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13524         doing FindMembers.
13525
13526         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13527         include NonPublic after the first iteration.
13528
13529         * class.cs (Indexer.CheckBase): Only check if both parents are
13530         non-null. 
13531
13532         * cs-parser.jay (accessor_body): If empty, set to null.
13533
13534         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13535         same code path here to resolve constants names that we did have in
13536         MemberAccess.DoResolve.  There is too much code duplicated here.
13537
13538 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13539
13540         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13541
13542         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13543         to MakeUnionSet.
13544
13545         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13546         tokens, numbers and strings.
13547
13548         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13549         parenthesis.
13550
13551         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13552         asyncronous parameters and the regular parameters.  
13553
13554         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13555         specify the target directory.
13556
13557         * expression.cs: (This.DoResolve): Simplify
13558         (As.Emit): Optimize, do not generate IsInst if the expression is
13559         always of the given type.
13560
13561         (Is.DoResolve): Bug fix, we were reporting both always/never for
13562         the is expression.
13563
13564         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13565         creating too many unnecessary arrays.
13566
13567 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13568
13569         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13570         fields instead of rolling our own initializer.   Takes care of all
13571         implicit conversions, and drops unnecessary static checks/argument.
13572
13573 2002-03-31  Dick Porter  <dick@ximian.com>
13574
13575         * driver.cs: use the GetDirectories() return values properly, and
13576         use "/" as path separator.
13577
13578 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13579
13580         * expression.cs (Unary): Optimize - - expr into expr.
13581         (Binary): Optimize a + (-b) into a -b.
13582
13583         * codegen.cs (CodeGen): Made all methods static.
13584
13585 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13586
13587         * rootcontext.cs: 
13588
13589         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13590         TypeBuilder property.
13591
13592         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13593         instead. 
13594
13595         * tree.cs: Removed the various RecordXXXX, and replaced with a
13596         single RecordDecl.  Removed all the accessor methods, and just
13597         left a single access point Type 
13598
13599         * enum.cs: Rename DefineEnum to DefineType.
13600
13601         * decl.cs: New abstract method `DefineType' used to unify the
13602         Defines for Enumerations, Interfaces, TypeContainers and
13603         Delegates.
13604
13605         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13606         LookupBaseClasses method that used to live in class.cs and
13607         interface.cs here, and renamed to FindType.
13608
13609         * delegate.cs: Implement DefineType.  Take advantage of the
13610         refactored pattern for locating the parent builder without taking
13611         the parent_builder argument (which we know does not work if we are
13612         nested, and triggering a toplevel definition).
13613
13614 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13615
13616         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13617         accessibility of a member has changed during override and report
13618         an error if so.
13619
13620         * class.cs (Method.Define, Property.Define): Only complain on
13621         overrides if the method is private, any other accessibility is
13622         fine (and since we just checked the permission is the same, we are
13623         good to go).
13624
13625         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13626         and elif are processed always.  The other pre-processing
13627         directives are only processed if we are "taking" the path
13628
13629 2002-03-29  Martin Baulig  <martin@gnome.org>
13630
13631         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13632         current location is not Null.
13633
13634         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13635         a separate method so we can profile it.
13636
13637         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13638         `span.Seconds' are just seconds, but no minutes or hours.
13639         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13640
13641 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13642
13643         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13644         Remove the gratuitous set of Final:
13645
13646                                 // If an interface implementation, then we can set Final.
13647                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13648                                     implementing.DeclaringType.IsInterface)
13649                                         flags |= MethodAttributes.Final;
13650
13651         I do not know what I was smoking when I used that.
13652
13653
13654         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13655         step into fixing the name resolution issues for delegates and
13656         unifying the toplevel name resolution.
13657
13658 2002-03-28  Martin Baulig  <martin@gnome.org>
13659
13660         * class.cs (Method.Emit): If we have a symbol writer, call its
13661         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13662         tell it about the current method.
13663
13664         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13665         writer that we're going to emit the first byte of IL code for a new
13666         statement (a new source line).
13667         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13668         EmitContext.Mark() before emitting any code.
13669
13670         * location.cs (SymbolDocument): Return null when we're Null.
13671
13672         * statement.cs (Statement): Moved the `Location loc' variable here.
13673         (Statement.EmitBoolExpression): If we have a symbol writer, call
13674         ec.Mark() before emitting any code to tell it that we're at the
13675         beginning of a new statement.
13676         (StatementExpression): Added `Location' argument to the constructor.
13677         (Block): Added public readonly variable `StartLocation' and public
13678         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13679         (Block): Added constructor which takes a start and end location.
13680         (Block.SetEndLocation): New method. This sets the end location.
13681         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13682         local variables we create.
13683         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13684         each statement and do also mark the begin and end of the block.
13685
13686         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13687         tell it the current lexer.Location, use Location.Null for the end of the
13688         block.
13689         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13690         current block, set its end location using SetEndLocation().
13691         (statement_expression): StatementExpression constructor now takes the
13692         lexer.Location as additional argument.
13693         (for_statement, declare_local_variables): Likewise.
13694         (declare_local_variables): When creating a new implicit block, use the
13695         new Block constructor and pass it the lexer.Location.
13696
13697 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13698
13699         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13700         members also on the parent interfaces recursively.
13701
13702 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13703
13704         * report.cs: Use new formats, since Gonzalo finished the missing
13705         bits. 
13706
13707         * expression.cs (Binary.ResolveOperator): added missing operator|
13708         operator& and operator^ for bool/bool.
13709
13710         * cs-parser.jay: CheckDef now takes a Location argument that is
13711         used to report errors more precisly (instead of reporting the end
13712         of a definition, we try to track something which is a lot closer
13713         to the source of the problem).
13714
13715         * cs-tokenizer.cs: Track global token use, so we can properly flag
13716         the use of #define/#undef after the first token has been seen.
13717
13718         Also, rename the reportXXXX to Error_DescriptiveName
13719
13720         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13721         TypeContainer, so that Enum and Interface can use this too.
13722
13723         * class.cs (TypeContainer.LookupInterfaceOrClass,
13724         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13725         `builder' argument.  Typically this was used to pass the parent
13726         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13727         the definition).  
13728
13729         The problem is that a nested class could trigger the definition of
13730         a toplevel class, and the builder would be obviously wrong in that
13731         case. 
13732
13733         So we drop this argument, and we compute dynamically the
13734         TypeBuilder/ModuleBuilder (the correct information was available
13735         to us anyways from DeclSpace.Parent)
13736
13737         * interface.cs (Interface.DefineInterface): Drop builder
13738         parameter cleanup like class.cs
13739
13740         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13741         like class.cs
13742
13743         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13744         values. 
13745
13746         (Try.Emit): Propagate the returns value from the statement.
13747
13748         (Return.Emit): Even if we are leavning 
13749
13750         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13751
13752         * modifiers.cs: Fix the computation of MethodAttributes flags.
13753
13754 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13755
13756         * driver.cs: allow compilation of files that start with '/'.
13757         Add a default case when checking the argument of --target.
13758
13759 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13760
13761         * interface.cs: Implement the same search algorithm for types in
13762         the interface code.
13763
13764         * delegate.cs: Do not allow multiple definition.
13765
13766         * Recovered ChangeLog that got accidentally amputated
13767
13768         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13769
13770         * rootcontext.cs: Load manually enum to allow core classes to
13771         contain enumerations.
13772
13773         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13774         Update to new static methods in TypeManager.
13775
13776         * typemanager.cs (GetMethod, GetConstructor): Use our
13777         implementation of FindMembers to find the members, since during
13778         corlib compilation, the types are TypeBuilders and GetMethod and
13779         GetConstructor do not work.
13780
13781         Make all methods in TypeManager static.
13782
13783         (InitCodeHelpers): Split the functionality from
13784         the InitCodeTypes function.
13785
13786         * driver.cs: Call InitCodeHelpers after we have populated the
13787         types. 
13788
13789         * cs-parser.jay (delegate_declaration): we did not used to compute
13790         the delegate name correctly for void delegates.
13791
13792 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13793
13794         * rootcontext.cs (RootContext): Init the interface_resolve_order
13795         and type_container_resolve_order always.
13796
13797         (ResolveCore, BootstrapCorlib_ResolveClass,
13798         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13799         compiler when compiling with --nostdlib
13800
13801         * class.cs (TypeContainer.DefineType): Check that our parent is
13802         not null.  This test is most important when we are bootstraping
13803         the core types.
13804
13805         * codegen.cs: Split out the symbol writing code.
13806
13807 2002-03-25  Martin Baulig  <martin@gnome.org>
13808
13809         * driver.cs (-g): Made -g an alias for --debug.
13810
13811 2002-03-24  Martin Baulig  <martin@gnome.org>
13812
13813         * codegen.cs (SymbolWriter): New public variable. Returns the
13814         current symbol writer.
13815         (CodeGen): Added `bool want_debugging_support' argument to the
13816          constructor. If true, tell the ModuleBuild that we want debugging
13817         support and ask it for the ISymbolWriter.
13818         (Save): If we have a symbol writer, call it's Close() method after
13819         saving the assembly.
13820
13821         * driver.c (--debug): New command line argument to create a
13822         debugger information file.
13823
13824         * location.cs (SymbolDocument): New public property. Returns an
13825         ISymbolDocumentWriter object for the current source file or null
13826         if we don't have a symbol writer.
13827
13828 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * driver.cs (LoadAssembly): Correctly return when all the paths
13831         have been tried and not before.
13832
13833         * statement.cs (Switch.Emit): return the actual coverage for this
13834         statement (returns/not-returns)
13835
13836         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13837         switch of the statement if we are the last switch section.  That
13838         kills two problems: try/catch problems (we used to emit an empty
13839         nop at the end) and switch statements where all branches would
13840         return. 
13841
13842 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * driver.cs: Add default assemblies (the equivalent to the
13845         Microsoft CSC.RSP file)
13846
13847         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13848         also update tokens_seen and set it to false.
13849
13850         * driver.cs: Implement --recurse for Mike.
13851
13852         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13853         correctly splitting out the paths.
13854
13855 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13856
13857         * interface.cs (Interface.PopulateProperty): Instead of using
13858         `parent' as the declaration space for the set parameters, use
13859         `this' 
13860
13861         * support.cs (InternalParameters): InternalParameters constructor
13862         takes a DeclSpace instead of a TypeContainer.
13863
13864         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13865         types are being initialized, load the address of it before calling
13866         the function.  
13867
13868         (New): Provide a mechanism to disable the generation of local
13869         value type temporaries when the caller will be providing us with
13870         an address to store it.
13871
13872         (ArrayCreation.EmitDynamicInitializers): Use it.
13873
13874 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13875
13876         * expression.cs (Invocation.EmitArguments): Only probe for array
13877         property if there is more than one argument.  Sorry about that.
13878
13879         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13880         empty param arrays.
13881
13882         * class.cs (Method.LabelParameters): Fix incorrect code path that
13883         prevented the `ParamArrayAttribute' from being applied to the
13884         params attribute.
13885
13886 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13887
13888         * support.cs (ReflectionParameters): Correctly compute whether the
13889         last argument is a params array.  Fixes the problem with
13890         string.Split ('a')
13891
13892         * typemanager.cs: Make the assemblies array always be non-null
13893         (empty, but non-null)
13894
13895         * tree.cs (RecordDecl): New function that abstracts the recording
13896         of names.  This reports error 101, and provides a pointer to the
13897         previous declaration.  Fixes a crash in the compiler.
13898
13899         * cs-parser.jay (constructor_declaration): Update to new grammar,
13900         and provide a constructor_body that can be empty.
13901
13902 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13903
13904         * driver.cs: Add support for --resources.
13905
13906         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13907         Make all types for the various array helper methods be integer.
13908
13909         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13910         CheckState to ConvCast.
13911
13912         (ConvCast): Now it takes a `checked' state argument, to avoid
13913         depending on the emit context for the conversion, and just using
13914         the resolve time setting.
13915
13916         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13917         instead of Invocation.EmitArguments.  We do not emit the original
13918         arguments, instead we emit those which have been converted to
13919         unsigned int expressions.
13920
13921         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13922
13923         * codegen.cs: ditto.
13924
13925         * expression.cs (LocalVariableReference): Drop the use of the
13926         Store function that depended on the variable index.
13927
13928         * statement.cs (VariableInfo): Drop the `Idx' property from this
13929         class, as this is not taking into account the indexes for
13930         temporaries tat we generate during the execution, getting the
13931         indexes wrong.
13932
13933         * class.cs: First emit class initializers, then call the parent
13934         constructor. 
13935
13936         * expression.cs (Binary): Fix opcode emision.
13937         (UnaryMutator.EmitCode): Support checked code generation
13938
13939         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13940         matches for events for both the Static and Instance scans,
13941         pointing to the same element.   Fix that.
13942
13943 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
13944
13945         * rootcontext.cs (ResolveTree): Always set the
13946         interface_resolve_order, because nested interfaces will be calling
13947         into us.
13948
13949         * class.cs (GetInterfaceOrClass): Track the same resolution
13950         process used by TypeManager.LookupType.  This fixes the nested
13951         type lookups in class declarations (separate path from
13952         LookupType). 
13953
13954         (TypeContainer.DefineType): Also define nested interfaces.
13955         (TypeContainer.RegisterOrder): New public function used to
13956         register the order in which child interfaces need to be closed.
13957
13958         Nested interfaces need to be closed after their parents have been
13959         created. 
13960
13961         * interface.cs (InterfaceAttr): Put all the logic for computing
13962         the interface attribute here. 
13963
13964         (DefineInterface): Register our interface order with the
13965         RootContext or with the TypeContainer depending on the case.
13966
13967 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * cs-parser.jay: rework foreach statement to work with the new
13970         changes to the policy on SimpleNames.
13971
13972         * report.cs: support Stacktrace on warnings as well.
13973
13974         * makefile: drop --unsafe and /unsafe from the compile.
13975
13976 2002-03-13  Ravi Pratap  <ravi@ximian.com>
13977
13978         * ecore.cs (StandardConversionExists): Modify to take an Expression
13979         as the first parameter. Ensure we do null -> reference type conversion
13980         checking.
13981
13982         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
13983         temporary Expression objects.
13984
13985 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
13986
13987         * interface.cs: workaround bug in method overloading resolution
13988         (there is already a bugzilla bug for it).
13989
13990 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13991
13992         We could also solve this problem by having a separate path for
13993         performing type lookups, instead of DoResolve, we could have a
13994         ResolveType entry point, and only participating pieces of the
13995         production (simplename, deref, array) would implement this. 
13996
13997         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
13998         signal SimpleName to only resolve type names and not attempt to
13999         resolve anything else.
14000
14001         * expression.cs (Cast): Set the flag.
14002
14003         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14004
14005         * class.cs: Only report 108 if there is no `new' modifier.
14006
14007         * cs-parser.jay: rework foreach statement to work with the new
14008         changes to the policy on SimpleNames.
14009
14010         * report.cs: support Stacktrace on warnings as well.
14011
14012         * makefile: drop --unsafe and /unsafe from the compile.
14013
14014 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14015
14016         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14017         lookups here, instead of doing that at parse time.  This means
14018         that our grammar will not introduce `LocalVariableReferences' as
14019         expressions at this point.  That solves the problem of code like
14020         this:
14021
14022         class X {
14023            static void Main ()
14024            { int X = 1;
14025             { X x = null }}}
14026
14027         This is only half the fix.  The full fix requires parameters to
14028         also be handled in this way.
14029
14030         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14031         makes the use more obvious of the DeclSpace.  The
14032         ec.TypeContainer.TypeBuilder is now only used to pull the
14033         TypeBuilder for it.
14034
14035         My theory is that I can get rid of the TypeBuilder completely from
14036         the EmitContext, and have typecasts where it is used (from
14037         DeclSpace to where it matters).  
14038
14039         The only pending problem is that the code that implements Aliases
14040         is on TypeContainer, and probably should go in DeclSpace.
14041
14042         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14043         lookups here, instead of doing that at parse time.  This means
14044         that our grammar will not introduce `LocalVariableReferences' as
14045         expressions at this point.  That solves the problem of code like
14046         this:
14047
14048         class X {
14049            static void Main ()
14050            { int X = 1;
14051             { X x = null }}}
14052
14053         This is only half the fix.  The full fix requires parameters to
14054         also be handled in this way.
14055
14056         * class.cs (Property.DefineMethod): When implementing an interface
14057         method, set newslot, when implementing an abstract method, do not
14058         set the flag (before we tried never setting it, or always setting
14059         it, which is the difference).
14060         (Indexer.DefineMethod): same.
14061         (Method.DefineMethod): same.
14062
14063         * ecore.cs: Only set the status used flag if we get back a Field.
14064
14065         * attribute.cs: Temporary hack, so Paolo can keep working.
14066
14067 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14068
14069         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14070         the unmanaged type in the case we have a MarshalAs attribute.
14071
14072         (Resolve): Handle the case when we are parsing the special MarshalAs
14073         attribute [we need to store the unmanaged type to use later]
14074
14075         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14076         MarshalAs Attribute.
14077
14078         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14079         on parameters and accordingly set the marshalling info.
14080
14081 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14082
14083         * class.cs: Optimizing slightly by removing redundant code after
14084         we switched to the `NoTypes' return value.
14085         (Property.DefineMethod): use NoTypes here too.
14086
14087         This fixes the bug I introduced in my last batch of changes.
14088
14089 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14090
14091         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14092
14093         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14094         Enums since those are types too. 
14095
14096         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14097
14098         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14099         thanks to a call during the lookup process.
14100
14101 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14102
14103         * statement.cs (Foreach): Lots of work to accomodate a particular
14104         kind of foreach statement that I had not kept in mind.  It is
14105         possible to have foreachs on classes that provide a GetEnumerator
14106         method that return objects that implement the "pattern" for using
14107         a foreach, there is no need to support GetEnumerator
14108         specifically. 
14109
14110         This is needed to compile nant.
14111
14112         * decl.cs: Only report 114 if the member is not `Finalize' and if
14113         the warning level is at least 2.
14114
14115         * class.cs: Moved the compare function from Method to
14116         MethodSignature. 
14117
14118         (MethodSignature.InheritableMemberSignatureCompare): Add new
14119         filter function that is used to extract inheritable methods from a
14120         class. 
14121
14122         (Method.Define): Use the new `inheritable_method_signature_filter'
14123         delegate
14124
14125         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14126         command. 
14127
14128 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14129
14130         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14131
14132         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14133
14134         * expression.cs: Pass location information to
14135         ConvertImplicitStandard. 
14136
14137         * class.cs: Added debugging code to track return values from
14138         interfaces. 
14139
14140 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14141
14142         * expression.cs (Is.DoResolve): If either side of the `is' is an
14143         interface, do not flag the warning.
14144
14145         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14146         for interfaces
14147
14148         * report.cs: Allow for --fatal to be used with --probe.
14149
14150         * typemanager.cs (NoTypes): Move the definition for the empty Type
14151         array here. 
14152
14153         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14154         properties. 
14155         (TypeContainer.DefineProxy): New function used to proxy to parent
14156         implementations when implementing interfaces.
14157         (TypeContainer.ParentImplements): used to lookup if our parent
14158         implements a public function that is required by an interface.
14159         (TypeContainer.VerifyPendingMethods): Hook this up.
14160
14161         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14162         `modules' and `assemblies' arraylists into arrays.  We only grow
14163         these are the very early start up of the program, so this improves
14164         the speedof LookupType (nicely measured).
14165
14166         * expression.cs (MakeByteBlob): Replaced unsafe code with
14167         BitConverter, as suggested by Paolo.
14168
14169         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14170         folding of string concatenation, but if either side is a string,
14171         and the other is not, then return null, and let the runtime use
14172         the concatenation on the string plus the object (using
14173         `Object.ToString'). 
14174
14175 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14176
14177         Constant Folding has been implemented now.
14178
14179         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14180         the error instead on types that are not supported in one's
14181         complement. 
14182
14183         * constant.cs (Constant and all children): New set of functions to
14184         perform implict and explicit conversions.
14185
14186         * ecore.cs (EnumConstant): Implement the new functions to perform
14187         conversion by proxying to the child expression.
14188
14189         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14190         own separate setting that can not be turned off from the command
14191         line using --unchecked or --checked and is only controlled using
14192         the checked/unchecked statements and expressions.  This setting is
14193         used by the constant folder to flag errors.
14194
14195         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14196         ConstantCheckState as well.   
14197
14198         During Resolve, they also have to flag the state, because the
14199         constant folder runs completely in the Resolve phase.
14200
14201         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14202         well.
14203
14204 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14205
14206         * cfold.cs: New file, this file contains the constant folder.
14207
14208         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14209         argument to track whether we are using the resulting address to
14210         load or store a value and provide better error messages. 
14211
14212         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14213         new AddressOf arguments.
14214
14215         * statement.cs (Foreach.EmitCollectionForeach): Update
14216
14217         * expression.cs (Argument.Emit): Call AddressOf with proper
14218         arguments to track usage.
14219
14220         (New.DoEmit): Call AddressOf with new arguments.
14221
14222         (Unary.Emit): Adjust AddressOf call.
14223
14224 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14225
14226         * cs-parser.jay (member_access): Change the case for pre-defined types
14227         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14228         this suggestion.
14229
14230         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14231         a method body.
14232
14233         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14234         essentially like methods and apply attributes like MethodImplOptions to them too.
14235
14236         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14237         not being null.
14238
14239         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14240         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14241         is the DeclSpace.
14242
14243         * Update code everywhere accordingly.
14244
14245         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14246
14247         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14248
14249 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14250
14251         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14252         try performing lookups against those instead of jumping straight into using
14253         the 'using' clauses.
14254
14255         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14256
14257         (LookupType): Perform lookups in implicit parents too.
14258
14259         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14260         sequence as RootContext.LookupType. 
14261
14262         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14263         the various cases of namespace lookups into this method.
14264
14265 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14266
14267         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14268         in positional arguments)
14269
14270         * class.cs (Operator): Update the AllowedModifiers to contain
14271         extern. 
14272
14273         * cs-parser.jay: Update operator declaration to allow for the
14274         operator body to be empty.
14275
14276         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14277         values. 
14278
14279 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14280
14281         * class.cs (Method.Emit): Label parameters.
14282
14283         * driver.cs: Return 1 or 0 as the program exit code.
14284
14285 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14286
14287         * expression.cs: Special case the `null' object when trying to
14288         auto-compute the type, as anything can be explicitly converted to
14289         that. 
14290
14291         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14292         spotting this Paolo.
14293
14294         (Expression.ImplicitNumericConversion): Perform comparissions of
14295         the type using the underlying type in the case of an enumeration
14296         rather than using the enumeration type for the compare.
14297
14298         Cope with the underlying == type case, which is not possible to
14299         catch before. 
14300
14301         (Expression.ConvertNumericExplicit): Perform comparissions of
14302         the type using the underlying type in the case of an enumeration
14303         rather than using the enumeration type for the compare.
14304
14305         * driver.cs: If the user does not supply an extension, assume .exe
14306
14307         * cs-parser.jay (if_statement): Rewrote so that we can track the
14308         location for the if statement.
14309
14310         * expression.cs (Binary.ConstantFold): Only concat strings when
14311         the operation is "+", not everything ;-)
14312
14313         * statement.cs (Statement.EmitBoolExpression): Take a location
14314         argument. 
14315         (If, While, Do): Track location.
14316
14317         * expression.cs (Binary.ResolveOperator): In the object + string
14318         case, I was missing a call to ConvertImplicit
14319
14320 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14321
14322         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14323         Location arguments. Ensure we use RootContext.LookupType to do our work
14324         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14325
14326         * interface.cs (PopulateMethod): Handle the type of the parameter being
14327         null gracefully.
14328
14329         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14330         have a params method with no fixed arguments and a call is made with no
14331         arguments.
14332
14333 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14334
14335         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14336         the verbatim-string-literal
14337
14338         * support.cs (InternalParameters.ParameterModifier): handle null
14339         fixed parameters.
14340         (InternalParameters.ParameterType): ditto.
14341
14342         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14343         duplicating the name of the variable parameter.
14344         (GetParameterByName): Fix bug where we were not looking up array
14345         paramters if they were the only present (thanks Paolo!).
14346         (GetParameterInfo): We only have an empty set of types if both
14347         fixed and array are set to null.
14348         (GetParameterInfo-idx): Handle FixedParameter == null
14349
14350         * cs-parser.jay: Handle the case where there is no catch
14351         statements (missing null test).
14352
14353 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * driver.cs (MainDriver): Be conservative on our command line
14356         handling.
14357
14358         Catch DirectoryNotFoundException when calling GetFiles.
14359
14360         (SplitPathAndPattern): Used to split the input specification into
14361         a path and a pattern that we can feed to Directory.GetFiles.
14362
14363 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14364
14365         * statement.cs (Fixed): Implement the last case of the Fixed
14366         statement (string handling).
14367
14368         * expression.cs (StringPtr): New class used to return a char * to
14369         a string;  Used by the Fixed statement.
14370
14371         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14372
14373         * expression.cs (Binary.ResolveOperator): Remove redundant
14374         MemberLookup pn parent type.
14375         Optimize union call, we do not need a union if the types are the same.
14376         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14377         type.
14378
14379         Specialize the use of MemberLookup everywhere, instead of using
14380         the default settings. 
14381
14382         (StackAlloc): Implement stackalloc keyword.
14383
14384         * cs-parser.jay: Add rule to parse stackalloc.
14385
14386         * driver.cs: Handle /h, /help, /?
14387
14388         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14389         before we supported unsafe code.
14390
14391         * makefile: add --unsafe to the self compilation of mcs.
14392
14393 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14394
14395         * expression.cs (PointerArithmetic): New class that is used to
14396         perform pointer arithmetic.
14397         (Binary.Resolve): Handle pointer arithmetic
14398         Handle pointer comparission.
14399         (ArrayPtr): Utility expression class that is used to take the
14400         address of an array.
14401
14402         (ElementAccess): Implement array access for pointers
14403
14404         * statement.cs (Fixed): Implement fixed statement for arrays, we
14405         are missing one more case before we are done.
14406
14407         * expression.cs (Indirection): Implement EmitAssign and set the
14408         ExprClass to Variable.  This allows pointer dereferences to be
14409         treated as variables, and to have values assigned to them.
14410
14411         * ecore.cs (Expression.StoreFromPtr): New utility function to
14412         store values dereferencing.
14413
14414 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14415
14416         * expression.cs (Binary.ResolveOperator): Ensure that we are
14417         not trying to operate on a void type - this fixes the reported
14418         bug.
14419
14420         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14421         the parent implementation is sealed.
14422
14423         * ../errors/cs0239.cs : Add.
14424
14425         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14426
14427         * typemanager.cs (unverifiable_code_type): Corresponds to 
14428         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14429         which have unsafe code in them.
14430
14431         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14432         unsafe context.
14433
14434 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * cs-tokenizer.cs: Add support for @"litreal strings"
14437
14438         Make tokenizer accept pre-processor directives
14439         on any column (remove the old C-like limitation). 
14440
14441         * rootcontext.cs (EmitCode): Emit any global attributes.
14442         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14443
14444         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14445
14446         * cs-parser.jay: Add support for global attributes.  
14447
14448 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * expression.cs (Indirection): New helper class.  Unary will
14451         create Indirection classes to be able to implement the
14452         IMemoryLocation interface on it.
14453
14454 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14455
14456         * cs-parser.jay (fixed_statement): reference the right statement.
14457
14458         * statement.cs (Fixed.Emit): Finish implementing the fixed
14459         statement for the &x case.
14460
14461 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14462
14463         * class.cs (Property.Define, Method.Define): Remove newslot when
14464         `implementing'.  
14465
14466         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14467         wrong.  NewSlot should only be used if the `new' keyword is present.
14468
14469         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14470         locating our system dir.  Sorry about this.
14471
14472 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14473
14474         * driver.cs (GetSystemDir): Compute correctly the location of our
14475         system assemblies.  I was using the compiler directory instead of
14476         the library directory.
14477
14478 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14479
14480         * expression.cs (BetterFunction): Put back in what Miguel commented out
14481         since it is the correct fix. The problem is elsewhere ;-)
14482
14483         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14484         parameters of the parms method are themselves compatible or not !
14485
14486         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14487         to check that a class implements an interface before saying that an implicit
14488         conversion was allowed. Use ImplementsInterface to do the checking.
14489
14490 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * class.cs (Method.Define): Track whether we are an explicit
14493         implementation or not.  And only call DefineMethodOverride if we
14494         are an explicit implementation.
14495
14496         (Property.DefineMethod): Ditto.
14497
14498 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14499
14500         * expression.cs (BetterFunction): Catch hideous bug which was
14501          preventing us from detecting ambiguous calls due to implicit casts i.e
14502         cs0121.
14503
14504 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14505
14506         * support.cs (Pair): Remove un-needed method.  I figured why I was
14507         getting the error in cs-parser.jay, the variable in a foreach loop
14508         is readonly, and the compiler does not really treat this as a variable.
14509
14510         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14511         instead of EQUALS in grammar.  
14512
14513         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14514
14515         * expression.cs (Unary.DoResolve): Check whether the argument is
14516         managed or not.
14517
14518 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14519
14520         * support.cs: Api for Pair to set a value.  Despite the fact that
14521         the variables are public the MS C# compiler refuses to compile
14522         code that accesses the field if the variable is part of a foreach
14523         statement. 
14524
14525         * statement.cs (Fixed): Begin implementation of the fixed
14526         statement.
14527
14528         (Block.AddVariable): Return the VariableInfo on success and null
14529         on failure instead of true/false. 
14530
14531         * cs-parser.jay (foreach): Catch errors on variables already
14532         defined (we were ignoring this value before) and properly unwind
14533         the block hierarchy
14534
14535         (fixed_statement): grammar for the fixed statement.
14536
14537 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14538
14539         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14540         pointer types to be incretemented.
14541
14542         (SizeOf): Implement.
14543
14544         * cs-parser.jay (pointer_member_access): Implement
14545         expr->IDENTIFIER production.
14546
14547         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14548         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14549         on safe contexts.
14550
14551         (Unary): Implement indirection.
14552
14553         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14554         use in non-unsafe context).
14555
14556         (SimpleName.DoResolve): Check for pointers in field access on safe
14557         contexts. 
14558
14559         (Expression.LoadFromPtr): Factor the load-indirect code in this
14560         function.  This was duplicated in UnboxCast and ParameterReference
14561
14562 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14563
14564         * expression.cs (ComposedCast): report an error if a pointer cast
14565         is used in a safe region.
14566
14567         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14568         pointer type casts in unsafe context.
14569
14570         * codegen.cs (EmitContext): Set up IsUnsafe.
14571
14572         * cs-parser.jay (non_expression_type): Add productions for pointer
14573         casts. 
14574
14575         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14576         code.  We should not use force into static mode if the method is
14577         not virtual.  Fixes bug in MIS
14578
14579         * statement.cs (Do.Emit, While.Emit, For.Emit,
14580         Statement.EmitBoolExpression): Add support to Do and While to
14581         propagate infinite loop as `I do return' semantics.
14582
14583         Improve the For case to also test for boolean constants.
14584
14585         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14586         to the list of attributes we can add.
14587
14588         Remove `EmitContext' argument.
14589
14590         * class.cs (Method.Define): Apply parameter attributes.
14591         (Constructor.Define): Apply parameter attributes.
14592         (MethodCore.LabelParameters): Move here the core of labeling
14593         parameters. 
14594
14595         * support.cs (ReflectionParameters.ParameterModifier,
14596         InternalParameters.ParameterModifier): Use IsByRef on the type and
14597         only return the OUT bit for these parameters instead of in/out/ref
14598         flags.
14599
14600         This is because I miss-understood things.  The ParameterInfo.IsIn
14601         and IsOut represent whether the parameter has the [In] and [Out]
14602         attributes set.  
14603
14604 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * ecore.cs (FieldExpr.Emit): Release temporaries.
14607
14608         * assign.cs (LocalTemporary.Release): new function.
14609
14610         * codegen.cs (EmitContext.GetTemporaryStorage,
14611         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14612         temporary storage.  Now we can "put back" localbuilders when we
14613         are done with them
14614
14615 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14618         need to make a copy of the variable to generate verifiable code.
14619
14620 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14621
14622         * driver.cs: Compute dynamically the system directory.
14623
14624         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14625         Slower, but more generally useful.  Used by the abstract
14626         registering implementation. 
14627
14628         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14629         the rules for the special rule on Type/instances.  First check if
14630         we have the same name, and if so, try that special static path
14631         rather than the instance path.
14632
14633 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14634
14635         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14636         for, while and if.
14637
14638         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14639         Enum, ValueType, Delegate or Array for non-corlib compiles.
14640
14641         * cs-tokenizer.cs: Catch long identifiers (645)
14642
14643         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14644         piece of code.
14645
14646         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14647         fix, we were returning too early, so we were not registering
14648         pending methods from abstract classes.
14649
14650         Do not register pending methods if the class is abstract.
14651
14652         * expression.cs (Conditional.DoResolve): Report circular implicit
14653         conversions when we neecd to compute it for conditional
14654         expressions. 
14655
14656         (Is.DoResolve): If the expression is always of the provided type,
14657         flag warning 183.  If the expression can not ever be of the
14658         provided type flag warning 184.
14659
14660         * class.cs: Catch 169 as well.
14661
14662         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14663         read. 
14664
14665 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14666
14667         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14668
14669 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14670
14671         * interface.cs: (PopulateMethod): Check for pointers being defined
14672         only if the unsafe context is active.
14673         (PopulateProperty): ditto.
14674         (PopulateIndexer): ditto.
14675
14676         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14677         specified.  If pointers are present, make sure that they are
14678         present in an unsafe context.
14679         (Constructor, Constructor.Define): ditto.
14680         (Field, Field.Define): ditto.
14681         (Property, Property.Define): ditto.
14682         (Event, Event.Define): ditto.
14683
14684         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14685         hashtable if there are classes or structs defined.
14686
14687         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14688         code, as the constant resolution moved.
14689
14690         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14691         the metadata, so we can flag error 133. 
14692
14693         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14694         pointer is being declared in an unsafe context.
14695
14696 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * modifiers.cs (Modifiers.Check): Require a Location argument.
14699         Report error 227 for Unsafe use.
14700
14701         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14702
14703         * statement.cs (For.Emit): If the test is null, then report that
14704         we do `return', as we wont reach anything afterwards.
14705
14706         (Switch.SwitchGoverningType): Track the expression that matched
14707         the conversion.
14708
14709         * driver.cs: Allow negative numbers as an error code to flag.
14710
14711         * cs-parser.jay: Handle 1551.
14712
14713         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14714
14715 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * cs-parser.jay: Report 1518 (type declaration can only contain
14718         class, struct, interface, enum or delegate)
14719
14720         (switch_label): Report 1523 (keywords `case' or `default' must
14721         preced code)
14722
14723         (opt_switch_sections): Report 1522 (empty switch)
14724
14725         * driver.cs: Report 1515 (response file specified multiple times)
14726         Report 1516 (Source file specified multiple times).
14727
14728         * expression.cs (Argument.Resolve): Signal 1510
14729
14730         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14731         access not allowed in static code)
14732
14733 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14734
14735         * typemanager.cs (IsPointerType): Utility method which we are going
14736         to need a lot.
14737
14738         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14739         the object type, so we take care of that.
14740
14741         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14742
14743         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14744         added to non-params parameters :-)
14745
14746         * typemanager.cs (CSharpName): Include 'void' type too. 
14747
14748         (void_ptr_type): Include in the set of core types.
14749
14750         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14751         duplicating code.
14752
14753         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14754         an unsafe context.
14755
14756         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14757         completely forgotten about it.
14758
14759 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14760
14761         * cs-parser.jay (pointer_type): Add. This begins our implementation
14762         of parsing rules for unsafe code.
14763
14764         (unsafe_statement): Implement.
14765
14766         (embedded_statement): Modify to include the above.
14767
14768         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14769
14770         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14771         if the current context is an unsafe one.
14772
14773         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14774         are handled differently, we need separate rules for them.
14775
14776         (local_variable_declaration): Update to use local_variable_pointer_type
14777         to allow variable declarations of unmanaged pointer types.
14778
14779         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14780         in unsafe contexts.
14781
14782         * ../errors/cs0214.cs : Add.
14783
14784 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14785
14786         * makefile: remove 'response' file when cleaning.
14787
14788 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14789
14790         * cs-parser.jay: Report 1524.
14791
14792 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14793
14794         * typemanager.cs (RegisterMethod): drop checking if we have
14795         registered this from here
14796
14797 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14798
14799         * class.cs (Method.EmitDestructor): Implement calling our base
14800         destructor. 
14801
14802         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14803         value of InFinally.
14804
14805         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14806         this routine and will wrap the call in a try/catch block.  Deal
14807         with the case.
14808
14809 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14810
14811         * ecore.cs (Expression.MemberLookup): instead of taking a
14812         parameter `same_type' that was used to tell whether we could
14813         access private members we compute our containing type from the
14814         EmitContext.
14815
14816         (FieldExpr): Added partial support for volatile fields.  This does
14817         not work for volatile fields exposed from assemblies, as I can not
14818         figure out how to extract the modreq from it.
14819
14820         Updated all the source files to use this.
14821
14822         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14823         because it is referenced by MemberLookup very often. 
14824
14825 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14826
14827         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14828         TypeBuilder.GetCustomAttributes to retrieve what we need.
14829
14830         Get rid of redundant default_member_attr_type as this is the same as
14831         default_member_type which already exists.
14832
14833         * interface.cs, attribute.cs : Update accordingly.
14834
14835 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14836
14837         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14838         work for TYpeBuilders though.  Ravi, can you please fix this?
14839
14840         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14841
14842         * expression.cs (Argument.Emit): Handle the case of ref objects
14843         being passed to ref functions;  
14844
14845         (ParameterReference.EmitLoad): Loads the content of the pointer
14846         without dereferencing.
14847
14848 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14851
14852 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14853
14854         * class.cs (Indexer.DefineMethod): Incorporate the interface
14855         type in the name of the method if we are doing explicit interface
14856         implementation.
14857
14858         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14859
14860         (BetterConversion): Fix extremely trivial bug where we were referring to
14861         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14862         again !
14863
14864         * ../errors/bug16.cs : Add although we have fixed it.
14865
14866 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14867
14868         * expression.cs (BaseIndexer): Begin implementation.
14869
14870         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14871
14872         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14873         production directly to remove a shift/reduce, and implement
14874         explicit interface implementation.
14875
14876         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14877         after a floating point suffix.
14878
14879         * expression.cs (DoNumericPromotions): Improved the conversion for
14880         uint/uint.  If we have a constant, we avoid doing a typecast to a
14881         larger type.
14882
14883         * class.cs (Indexer): Implement explicit interface implementation
14884         for indexers.
14885
14886 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14887
14888         * class.cs: make the default instance constructor public and hidebysig.
14889
14890 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14891
14892         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14893         so we can call it from elsewhere.
14894
14895         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14896         we emit it internally if the class has a defined indexer; otherwise the user
14897         emits it by decorating the class definition with the DefaultMemberAttribute.
14898
14899         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14900         attribute is not used on a type which defines an indexer.
14901
14902         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14903         character when we skip whitespace.
14904
14905         * ../errors/cs0646.cs : Add.
14906
14907 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14908
14909         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14910         again. 
14911
14912         * makefile: Add practical target `mcs3.exe' which builds the third
14913         generation compiler. 
14914
14915         * expression.cs (New): Fix structures constructor calling.
14916
14917         * class.cs (Property, Method, Indexer): Emit Final flag on the
14918         method if we are an interface implementation and we are not
14919         abstract. 
14920
14921         * ecore.cs (PropertyExpr): New public field `IsBase', tells
14922         whether this property is referencing a `base' method.
14923
14924         * expression.cs (Invocation.EmitCall): take an extra argument:
14925         is_base, this is used to determine whether the `call' or
14926         `callvirt' opcode should be used.
14927
14928
14929         * delegate.cs: update EmitCall.
14930
14931         * class.cs (Method.Define): Set NewSlot for the cases where we are
14932         not implementing an interface method.
14933
14934         (Property.Define): ditto.
14935
14936 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
14937
14938         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14939         'r'.  Allows mcs to parse itself fully.
14940
14941 2002-01-02  Ravi Pratap  <ravi@ximian.com>
14942
14943         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14944         of the number of initializers that require the InitializeArray method.
14945
14946         (CheckIndices): Store the Expression in all cases - not the plain value. Also
14947         update the above field where necessary.
14948
14949         (MakeByteBlob): Update accordingly.
14950
14951         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
14952         greater than 2.
14953
14954         (EmitDynamicInitializers): Update in accordance with the new optimization.
14955
14956         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
14957         same OpCode applies.
14958
14959         * cs-parser.jay : Fix some glaring errors I introduced.
14960
14961 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
14962
14963         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
14964         so that we can check for name clashes there too.
14965
14966         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
14967         for interface indexers.
14968
14969         * interfaces.cs (Define): Emit the default member attribute.
14970
14971         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
14972         variable was being referred to while setting the value ;-)
14973
14974 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
14977         byte-by-byte information when we know the data is zero.
14978
14979         Make the block always a multiple of 4, because
14980         DefineInitializedData has a bug.
14981
14982         * assign.cs: Fix, we should assign from the temporary, not from
14983         the source. 
14984
14985         * expression.cs (MakeByteBlob): Fix my incorrect code.
14986
14987 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * typemanager.cs (EnumToUnderlying): This function is used to get
14990         the underlying type from an enumeration, because it does not
14991         always work. 
14992
14993         * constant.cs: Use the I4_S form for values between -128 and 127.
14994
14995         * statement.cs (Block.LookupLabel): Looks up a label.
14996         (Block): Drop support for labeled blocks.
14997
14998         (LabeledStatement): New kind of statement that represents a label
14999         only.
15000
15001         (Goto): Finally implement this bad boy.
15002
15003         * cs-parser.jay: Update to reflect new mechanism to implement
15004         labels.
15005
15006 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15007
15008         * codegen.cs (EmitContext.This): a codegen property that keeps the
15009         a single instance of this instead of creating many different this
15010         instances. 
15011
15012         * delegate.cs (Delegate.DoResolve): Update to use the property;
15013
15014         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15015
15016         * expression.cs (BaseAccess.DoResolve): Ditto.
15017
15018 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15019
15020         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15021         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15022
15023         (InitCoreTypes): Update accordingly.
15024
15025         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15026         so we can quickly store the state.
15027
15028         (ApplyAttributes): Set the correct implementation flags
15029         for InternalCall methods.
15030
15031 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * expression.cs (EmitCall): if a method is not virtual, then do
15034         not use callvirt on it.
15035
15036         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15037         user defined stuff) requires the use of stobj, which takes an
15038         address on the stack instead of an array and an index.  So emit
15039         the Ldelema operation for it.
15040
15041         (EmitStoreOpcode): Use stobj for valuetypes.
15042
15043         (UnaryMutator.EmitCode): Use the right 1 value depending on
15044         whether we are dealing with int64/uint64, float or doubles.
15045
15046         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15047         constructors that I implemented last night.
15048
15049         (Constructor.IsDefault): Fix to work properly for static
15050         constructors.
15051
15052         * cs-parser.jay (CheckDef): report method signature errors.
15053         Update error number 103 to be 132.
15054
15055         * decl.cs: New AdditionResult enumeration value: MethodExists.
15056         Although we do this check for methods later on in the semantic
15057         analysis, catching repeated default constructors is so easy that
15058         we catch these here. 
15059
15060         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15061         promotions code.
15062
15063         (ParameterReference.EmitAssign, Emit): handle
15064         bools as bytes.
15065
15066         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15067         (ArrayAccess.EmitStoreOpcode): ditto.
15068
15069         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15070
15071         * expression.cs (MakeByteBlob): Complete all the missing types
15072         (uint, short, ushort, byte, sbyte)
15073
15074         * class.cs: Only init instance field initializers on instance
15075         constructors. 
15076
15077         Rename `constructors' to instance_constructors. 
15078
15079         (TypeContainer.AddConstructor): Only add constructors to the list
15080         if it is not static.
15081
15082         Make sure that we handle default_static_constructor independently
15083         everywhere where we handle instance_constructors
15084
15085 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * class.cs: Do not lookup or create a base initializer for a
15088         static constructor.
15089
15090         (ConstructorInitializer.Resolve): use the proper type to lookup
15091         for constructors.
15092
15093         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15094
15095         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15096         in DeclSpace. 
15097
15098         * decl.cs: CloseType is now an virtual method, the default
15099         implementation just closes this type.
15100
15101 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15102
15103         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15104         to PreserveSig by default. Also emit HideBySig on such methods.
15105
15106         Basically, set the defaults to standard values.
15107
15108         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15109         argument, if candidate is better, it can't be worse than the best !
15110
15111         (Invocation): Re-write bits to differentiate between methods being
15112         applicable in their expanded form and their normal form - for params
15113         methods of course.
15114
15115         Get rid of use_standard everywhere as only standard conversions are allowed
15116         in overload resolution. 
15117
15118         More spec conformance.
15119
15120 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * driver.cs: Add --timestamp, to see where the compiler spends
15123         most of its time.
15124
15125         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15126         `this' in static code.
15127
15128         (SimpleName.DoResolve): Implement in terms of a helper function
15129         that allows static-references to be passed upstream to
15130         MemberAccess.
15131
15132         (Expression.ResolveWithSimpleName): Resolve specially simple
15133         names when called by MemberAccess to implement the special
15134         semantics. 
15135
15136         (Expression.ImplicitReferenceConversion): Handle conversions from
15137         Null to reference types before others, as Null's type is
15138         System.Object. 
15139
15140         * expression.cs (Invocation.EmitCall): Handle the special case of
15141         calling methods declared on a reference type from a ValueType
15142         (Base classes System.Object and System.Enum)
15143
15144         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15145         the left hand side is a TypeExpr, not on every enumeration. 
15146
15147         (Binary.Resolve): If types are reference types, then do a cast to
15148         object on operators != and == of both arguments.
15149
15150         * typemanager.cs (FindMembers): Extract instance and static
15151         members if requested.
15152
15153         * interface.cs (PopulateProperty): Use void_type instead of null
15154         as the return type for the setter method.
15155
15156         (PopulateIndexer): ditto.
15157
15158 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15159
15160         * support.cs (ReflectionParameters): Fix minor bug where we
15161         were examining the wrong parameter for the ParamArray attribute.
15162
15163         Cope with requests for the type of the parameter at position
15164         greater than the params parameter's. We now return the element
15165         type of the params array as that makes more sense.
15166
15167         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15168         accordingly as we no longer have to extract the element type
15169         ourselves.
15170
15171         (Invocation.OverloadResolve): Update.
15172
15173 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15176         against IEnumerator, test whether the return value is a descendant
15177         of the IEnumerator interface.
15178
15179         * class.cs (Indexer.Define): Use an auxiliary method to implement
15180         the other bits of the method definition.  Begin support for
15181         explicit interface implementation.
15182
15183         (Property.DefineMethod): Use TypeManager.void_type instead of null
15184         for an empty return value.
15185
15186 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15187
15188         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15189         dealing with a FieldExpr which is composed of a FieldBuilder, in
15190         the code path we did extract the constant, but we should have
15191         obtained the underlying value to be able to cast it (otherwise we
15192         end up in an infinite loop, this is what Ravi was running into).
15193
15194         (ArrayCreation.UpdateIndices): Arrays might be empty.
15195
15196         (MemberAccess.ResolveMemberAccess): Add support for section
15197         14.5.4.1 that deals with the special case of E.I when E is a type
15198         and something else, that I can be a reference to a static member.
15199
15200         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15201         handle a particular array type to create byte blobs, it is just
15202         something we dont generate byteblobs for.
15203
15204         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15205         arguments. 
15206
15207         * location.cs (Push): remove the key from the hashtable that we
15208         are about to add.   This happens for empty files.
15209
15210         * driver.cs: Dispose files after we have parsed them.
15211
15212         (tokenize): new function that only runs the tokenizer on its
15213         input, for speed testing.
15214
15215 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15216
15217         * class.cs (Event.Define): Define the private field only if there
15218         are no accessors defined.
15219
15220         * expression.cs (ResolveMemberAccess): If there is no associated
15221         field with the event, that means we have an event defined with its
15222         own accessors and we should flag error cs0070 since transforming
15223         ourselves into a field is not valid in that case.
15224
15225         * ecore.cs (SimpleName.DoResolve): Same as above.
15226
15227         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15228         and charset to sane values.
15229
15230 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15231
15232         * assign.cs (DoResolve): Perform check on events only if they 
15233         are being accessed outside the declaring type.
15234
15235         * cs-parser.jay (event_declarations): Update rules to correctly
15236         set the type of the implicit parameter etc.
15237
15238         (add_accessor, remove_accessor): Set current local parameters.
15239
15240         * expression.cs (Binary): For delegate addition and subtraction,
15241         cast the return value from the method into the appropriate delegate
15242         type.
15243
15244 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15245
15246         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15247         of these as the workaround is unnecessary.
15248
15249         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15250         delegate data - none of that is needed at all.
15251
15252         Re-write bits to extract the instance expression and the delegate method
15253         correctly.
15254
15255         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15256         on delegates too.
15257
15258         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15259         of attaching attributes instead of duplicating code everywhere.
15260
15261         * everywhere : Update code to do attribute emission using the above method.
15262
15263 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15264
15265         * expression.cs (IsParamsMethodApplicable): if there are not
15266         parameters, return immediately.
15267
15268         * ecore.cs: The 0 literal can be implicity converted to an enum
15269         type. 
15270
15271         (SimpleName.DoResolve): First lookup the type, then lookup the
15272         members. 
15273
15274         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15275         want to get its address.  If the InstanceExpression is not
15276         addressable, store the result in a temporary variable, then get
15277         the address of it.
15278
15279         * codegen.cs: Only display 219 errors on warning level or above. 
15280
15281         * expression.cs (ArrayAccess): Make it implement the
15282         IMemoryLocation interface.
15283
15284         (Binary.DoResolve): handle the operator == (object a, object b)
15285         and operator != (object a, object b) without incurring into a
15286         BoxedCast (because 5 != o should never be performed).
15287
15288         Handle binary enumerator operators.
15289
15290         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15291         value type, otherwise use Ldelem_ref.
15292
15293         Use precomputed names;
15294
15295         (AddressOf): Implement address of
15296
15297         * cs-parser.jay (labeled_statement): Fix recursive block
15298         addition by reworking the production.
15299
15300         * expression.cs (New.DoEmit): New has a special case:
15301                 
15302                  If we are dealing with a ValueType, we have a few
15303                  situations to deal with:
15304                 
15305                     * The target of New is a ValueType variable, that is
15306                       easy, we just pass this as the variable reference
15307                 
15308                     * The target of New is being passed as an argument,
15309                       to a boxing operation or a function that takes a
15310                       ValueType.
15311                 
15312                       In this case, we need to create a temporary variable
15313                       that is the argument of New.
15314
15315
15316 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15317
15318         * rootcontext.cs (LookupType): Check that current_type is not null before
15319         going about looking at nested types.
15320
15321         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15322         not implement the IAssignMethod interface any more.
15323
15324         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15325         where we tranform them into FieldExprs if they are being resolved from within
15326         the declaring type.
15327
15328         * ecore.cs (SimpleName.DoResolve): Do the same here.
15329
15330         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15331
15332         * ../errors/bug10.cs : Add.
15333
15334         * ../errors/cs0070.cs : Add.
15335
15336         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15337
15338         * assign.cs : Get rid of EventIsLocal everywhere.
15339
15340 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * ecore.cs (ConvertIntLiteral): finished the implementation.
15343
15344         * statement.cs (SwitchLabel): Convert the value we are using as a
15345         key before looking up the table.
15346
15347 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15348
15349         * codegen.cs (EmitTopBlock): Require a Location argument now.
15350
15351         * cs-parser.jay (constructor_declarator): We need to setup
15352         current_local_parameters before we parse the
15353         opt_constructor_initializer, to allow the variables to be bound
15354         to the constructor arguments.
15355
15356         * rootcontext.cs (LookupType): First lookup nested classes in our
15357         class and our parents before we go looking outside our class.
15358
15359         * expression.cs (ConstantFold): Extract/debox the values at the
15360         beginnning. 
15361
15362         * rootcontext.cs (EmitCode): Resolve the constants first before we
15363         resolve the types.  This is not really needed, but it helps debugging.
15364
15365         * statement.cs: report location.
15366
15367         * cs-parser.jay: pass location to throw statement.
15368
15369         * driver.cs: Small bug fix.
15370
15371         * report.cs: Updated format to be 4-zero filled digits.
15372
15373 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15374
15375         * expression.cs (CheckIndices): Fix minor bug where the wrong
15376         variable was being referred to ;-)
15377
15378         (DoEmit): Do not call EmitStaticInitializers when the 
15379         underlying type is System.Object.
15380
15381 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15382
15383         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15384         and do the usual workaround for SRE.
15385
15386         * class.cs (MyEventBuilder.EventType): New member to get at the type
15387         of the event, quickly.
15388
15389         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15390
15391         * assign.cs (Assign.DoResolve): Handle the case when the target
15392         is an EventExpr and perform the necessary checks.
15393
15394         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15395         interface.
15396
15397         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15398
15399         (EventExpr): Set the type in the constructor itself since we 
15400         are meant to be born fully resolved.
15401
15402         (EventExpr.Define): Revert code I wrote earlier.
15403                 
15404         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15405         instance expression is null. The instance expression is a This in that case
15406         or a null, depending on whether it is a static method or not.
15407
15408         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15409         refers to more than one method.
15410
15411         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15412         and accordingly flag errors.
15413
15414 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15415
15416         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15417
15418 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * location.cs (ToString): Provide useful rutine.
15421
15422 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15423
15424         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15425         objects, return the actual integral boxed.
15426
15427         * statement.cs (SwitchLabel): define an ILLabel for each
15428         SwitchLabel. 
15429
15430         (Switch.CheckSwitch): If the value is a Literal, extract
15431         the underlying literal.
15432
15433         Also in the unused hashtable we had, add the SwitchLabel so we can
15434         quickly look this value up.
15435
15436         * constant.cs: Implement a bunch of new constants.  Rewrite
15437         Literal based on this.  Made changes everywhere to adapt to this.
15438
15439         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15440         dereferencing array only once, and also copes with enumrations.
15441
15442         bytes are two bytes wide, not one.
15443
15444         (Cast): Perform constant conversions.
15445
15446         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15447         wrappers to the literals here.
15448
15449         * expression.cs (DoNumericPromotions): long literals can converted
15450         to ulong implicity (this is taken care of elsewhere, but I was
15451         missing this spot).
15452
15453         * ecore.cs (Expression.Literalize): Make the return type Literal,
15454         to improve type checking.
15455
15456         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15457
15458 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15459
15460         * literal.cs: Revert code from ravi that checked the bounds.  The
15461         bounds are sane by the definition of the type itself. 
15462
15463         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15464         need to actually look up in our parent hierarchy for interfaces
15465         implemented. 
15466
15467         * const.cs: Use the underlying type for enumerations
15468
15469         * delegate.cs: Compute the basename for the delegate creation,
15470         that should fix the delegate test case, and restore the correct
15471         Type Lookup semantics in rootcontext
15472
15473         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15474         referencing a nested type with the Reflection API is using the "+"
15475         sign. 
15476
15477         * cs-parser.jay: Do not require EOF token at the end.
15478
15479 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15480
15481         * rootcontext.cs (LookupType): Concatenate type names with
15482         a '.' instead of a '+' The test suite passes again.
15483
15484         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15485         field of the enumeration.
15486
15487         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15488         the case when the member is an EventExpr.
15489
15490         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15491         static has an associated instance expression.
15492
15493         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15494
15495         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15496
15497         * class.cs (Event.Define): Register event and perform appropriate checks
15498         for error #111.
15499
15500         We define the Add and Remove methods even if the use provides none because
15501         in that case, we provide default implementations ourselves.
15502
15503         Define a private field of the type of the event. This is done by the CSC compiler
15504         and we should be doing it too ;-)
15505
15506         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15507         More methods we use in code we generate.
15508
15509         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15510         is important.
15511
15512         (InitCoreTypes): Update accordingly for the above.
15513
15514         * class.cs (Event.Emit): Generate code for default accessors that we provide
15515
15516         (EmitDefaultMethod): Do the job in the above.
15517
15518         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15519         appropriate place.
15520
15521 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15524         builders even if we were missing one.
15525
15526         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15527         pass the Basename as our class name instead of the Name.  The
15528         basename will be correctly composed for us.
15529
15530         * parameter.cs (Paramters): Now takes a Location argument.
15531
15532         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15533         make all the code call directly LookupType in RootContext and take
15534         this chance to pass the Location information everywhere.
15535
15536         * Everywhere: pass Location information.
15537
15538 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15539
15540         * class.cs (Constructor.Define): Updated way of detecting the
15541         length of the parameters.
15542
15543         (TypeContainer.DefineType): Use basename as the type name for
15544         nested types.
15545
15546         (TypeContainer.Define): Do not recursively define types here, as
15547         definition is taken care in order by the RootContext.
15548
15549         * tree.cs: Keep track of namespaces in a per-file basis.
15550
15551         * parameter.cs (Parameter.ComputeSignature): Update to use
15552         DeclSpace. 
15553
15554         (Parameters.GetSignature): ditto.
15555
15556         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15557         instead of a TypeContainer.
15558
15559         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15560         resolve names.  Because we need to be resolve in our context, not
15561         our parents.
15562
15563         * driver.cs: Implement response files.
15564
15565         * class.cs (TypeContainer.DefineType): If we are defined, do not
15566         redefine ourselves.
15567
15568         (Event.Emit): Emit the code for add/remove handlers.
15569         (Event.Define): Save the MethodBuilders for add/remove.
15570
15571         * typemanager.cs: Use pair here too.
15572
15573         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15574         DictionaryEntry requires the first argument to be non-null.  
15575
15576         (enum_declaration): Compute full name for registering the
15577         enumeration.
15578
15579         (delegate_declaration): Instead of using
15580         formal_parameter_list, use opt_formal_parameter_list as the list
15581         can be empty.
15582
15583         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15584         (EventParsing): New property that controls whether `add' and
15585         `remove' are returned as tokens or identifiers (for events);
15586
15587 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15588
15589         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15590         use MyEventBuilder only and let it wrap the real builder for us.
15591
15592         (MyEventBuilder): Revamp constructor etc.
15593
15594         Implement all operations that we perform on EventBuilder in precisely the same
15595         way here too.
15596
15597         (FindMembers): Update to use the EventBuilder member.
15598
15599         (Event.Emit): Update accordingly.
15600
15601 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15602
15603         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15604         by calling the appropriate methods.
15605
15606         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15607         useful.
15608
15609         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15610
15611 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15612
15613         * delegate.cs (Delegate.Populate): Check that the return type
15614         and various parameters types are indeed accessible.
15615
15616         * class.cs (Constructor.Define): Same here.
15617
15618         (Field.Define): Ditto.
15619
15620         (Event.Define): Ditto.
15621
15622         (Operator.Define): Check that the underlying Method defined itself
15623         correctly - so it's MethodBuilder should not be null.
15624
15625         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15626         expression happens to be null.
15627
15628         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15629         members but as of now we don't seem to be able to do anything really useful with it.
15630
15631         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15632         not the EventBuilder.
15633
15634 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15635
15636         * cs-tokenizer.cs: Add support for defines.
15637         Add support for #if, #elif, #else, #endif
15638
15639         (eval_var): evaluates a variable.
15640         (eval): stubbed for evaluating functions.
15641
15642         * cs-parser.jay: Pass the defines information
15643
15644         * driver.cs: Add --define command line option.
15645
15646         * decl.cs: Move MemberCore here.
15647
15648         Make it the base class for DeclSpace.  This allows us to catch and
15649         report 108 and 109 for everything now.
15650
15651         * class.cs (TypeContainer.Define): Extract all the members
15652         before populating and emit the warning 108 (new keyword required
15653         to override) instead of having each member implement this.
15654
15655         (MemberCore.Define): New abstract method, we will be using this in
15656         the warning reporting engine in Populate.
15657
15658         (Operator.Define): Adjust to new MemberCore protocol. 
15659
15660         * const.cs (Const): This does not derive from Expression, it is a
15661         temporary object we use to create fields, it is a MemberCore. 
15662
15663         * class.cs (Method.Define): Allow the entry point to be in a
15664         specific class.
15665
15666         * driver.cs: Rewrite the argument handler to clean it up a bit.
15667
15668         * rootcontext.cs: Made it just an auxiliary namespace feature by
15669         making everything static.
15670
15671         * driver.cs: Adapt code to use RootContext type name instead of
15672         instance variable.
15673
15674         * delegate.cs: Remove RootContext argument.
15675
15676         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15677         argument. 
15678
15679         * class.cs (Event.Define): The lookup can fail.
15680
15681         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15682
15683         * expression.cs: Resolve the this instance before invoking the code.
15684
15685 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * cs-parser.jay: Add a production in element_access that allows
15688         the thing to become a "type" reference.  This way we can parse
15689         things like "(string [])" as a type.
15690
15691         Note that this still does not handle the more complex rules of
15692         casts. 
15693
15694
15695         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15696
15697         * ecore.cs: (CopyNewMethods): new utility function used to
15698         assemble the list of methods from running FindMembers.
15699
15700         (MemberLookup): Rework FindMembers so that 
15701
15702 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * class.cs (TypeContainer): Remove Delegates who fail to be
15705         defined.
15706
15707         * delegate.cs (Populate): Verify that we dont get null return
15708         values.   TODO: Check for AsAccessible.
15709
15710         * cs-parser.jay: Use basename to emit error 574 (destructor should
15711         have the same name as container class), not the full name.
15712
15713         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15714         possible representation.  
15715
15716         Also implements integer type suffixes U and L.
15717
15718 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * expression.cs (ArrayCreation.DoResolve): We need to do the
15721         argument resolution *always*.
15722
15723         * decl.cs: Make this hold the namespace.  Hold the root context as
15724         well.
15725         (LookupType): Move here.
15726
15727         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15728
15729         * location.cs (Row, Name): Fixed the code, it was always returning
15730         references to the first file.
15731
15732         * interface.cs: Register properties defined through interfaces.
15733
15734         * driver.cs: Add support for globbing on the command line
15735
15736         * class.cs (Field): Make it derive from MemberCore as well.
15737         (Event): ditto.
15738
15739 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15740
15741         * class.cs (Event::Define): Check that the type of the event is a delegate
15742         type else flag error #66.
15743
15744         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15745         same.
15746
15747         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15748         values of EntryPoint, CharSet etc etc.
15749
15750         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15751
15752         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15753         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15754         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15755         which needs this to do its work.
15756
15757         * ../errors/cs0066.cs : Add.
15758
15759 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15760
15761         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15762         helper functions.
15763
15764         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15765         clears out the parameters field.
15766         (MemberSignatureCompare): Cleanup
15767
15768         (MemberCore): New base class used to share code between MethodCore
15769         and Property.
15770
15771         (RegisterRequiredImplementations) BindingFlags.Public requires
15772         either BindingFlags.Instace or Static.  Use instance here.
15773
15774         (Property): Refactored code to cope better with the full spec.
15775
15776         * parameter.cs (GetParameterInfo): Return an empty array instead
15777         of null on error.
15778
15779         * class.cs (Property): Abstract or extern properties have no bodies.
15780
15781         * parameter.cs (GetParameterInfo): return a zero-sized array.
15782
15783         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15784         method modifier validation to the typecontainer so we can reuse
15785         this on properties.
15786
15787         (MethodCore.ParameterTypes): return an empty sized array of types.
15788
15789         (Property.Define): Test property modifier validity.
15790
15791         Add tests for sealed/override too.
15792
15793         (Method.Emit): abstract or extern methods have no bodies.
15794
15795 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15796
15797         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15798         thing.
15799
15800         (Method::Define, ::Emit): Modify accordingly.
15801
15802         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15803
15804         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15805
15806         * makefile: Pass in /unsafe.
15807
15808 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * class.cs (MakeKey): Kill routine.
15811
15812         * class.cs (TypeContainer.Define): Correctly define explicit
15813         method implementations (they require the full interface name plus
15814         the method name).
15815
15816         * typemanager.cs: Deply the PtrHashtable here and stop using the
15817         lame keys.  Things work so much better.
15818
15819         This of course broke everyone who depended on `RegisterMethod' to
15820         do the `test for existance' test.  This has to be done elsewhere.
15821
15822         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15823         the object stupid Equals method (because, that like fails all over
15824         the place).  We still do not use it.
15825
15826         * class.cs (TypeContainer.SetRequiredInterface,
15827         TypeContainer.RequireMethods): Killed these two routines and moved
15828         all the functionality to RegisterRequiredImplementations.
15829
15830         (TypeContainer.RegisterRequiredImplementations): This routine now
15831         registers all the implementations required in an array for the
15832         interfaces and abstract methods.  We use an array of structures
15833         which can be computed ahead of time to reduce memory usage and we
15834         also assume that lookups are cheap as most classes will not
15835         implement too many interfaces.
15836
15837         We also avoid creating too many MethodSignatures.
15838
15839         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15840         clear the "pending" bit if we find that there are problems with
15841         the declaration.
15842
15843         (TypeContainer.VerifyPendingMethods): Update to report errors of
15844         methods that look like implementations but are not.
15845
15846         (TypeContainer.Define): Add support for explicit interface method
15847         implementation. 
15848
15849 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15850
15851         * typemanager.cs: Keep track of the parameters here instead of
15852         being a feature of the TypeContainer.
15853
15854         * class.cs: Drop the registration of parameters here, as
15855         InterfaceMethods are also interface declarations.
15856
15857         * delegate.cs: Register methods with the TypeManager not only with
15858         the TypeContainer.  This code was buggy.
15859
15860         * interface.cs: Full registation here.
15861
15862 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15863
15864         * expression.cs: Remove reducer for binary expressions, it can not
15865         be done this way.
15866
15867         * const.cs: Put here the code that used to go into constant.cs
15868
15869         * constant.cs: Put here the code for constants, this is a new base
15870         class for Literals.
15871
15872         * literal.cs: Make Literal derive from Constant.
15873
15874 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15875
15876         * statement.cs (Return.Emit): Report error 157 if the user
15877         attempts to return from a finally block.
15878
15879         (Return.Emit): Instead of emitting a return, jump to the end of
15880         the function.
15881
15882         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15883         LocalBuilder to store the result of the function.  ReturnLabel is
15884         the target where we jump.
15885
15886
15887 2001-12-09  Radek Doulik  <rodo@ximian.com>
15888
15889         * cs-parser.jay: remember alias in current namespace
15890
15891         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15892         namespaces
15893
15894         * class.cs (LookupAlias): lookup alias in my_namespace
15895
15896         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15897         aliases hashtable
15898         (LookupAlias): lookup alias in this and if needed in parent
15899         namespaces
15900
15901 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15902
15903         * support.cs: 
15904
15905         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15906         making things static.  I need this to avoid passing the
15907         TypeContainer when calling ParameterType.
15908
15909         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15910         that did string manipulation to compute the type and then call
15911         GetType.  Use Parameter.ParameterType instead.
15912
15913         * cs-tokenizer.cs: Consume the suffix for floating values.
15914
15915         * expression.cs (ParameterReference): figure out whether this is a
15916         reference parameter or not.  Kill an extra variable by computing
15917         the arg_idx during emission.
15918
15919         * parameter.cs (Parameters.GetParameterInfo): New overloaded
15920         function that returns whether a parameter is an out/ref value or not.
15921
15922         (Parameter.ParameterType): The type of the parameter (base,
15923         without ref/out applied).
15924
15925         (Parameter.Resolve): Perform resolution here.
15926         (Parameter.ExternalType): The full type (with ref/out applied).
15927
15928         * statement.cs (Using.Emit, Using.EmitExpression): Implement
15929         support for expressions on the using statement.
15930
15931 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * statement.cs (Using.EmitLocalVariableDecls): Split the
15934         localvariable handling of the using statement.
15935
15936         (Block.EmitMeta): Keep track of variable count across blocks.  We
15937         were reusing slots on separate branches of blocks.
15938
15939         (Try.Emit): Emit the general code block, we were not emitting it. 
15940
15941         Check the type of the declaration to be an IDisposable or
15942         something that can be implicity converted to it. 
15943
15944         Emit conversions if required.
15945
15946         * ecore.cs (EmptyExpression): New utility class.
15947         (Expression.ImplicitConversionExists): New utility function.
15948
15949 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * statement.cs (Using): Implement.
15952
15953         * expression.cs (LocalVariableReference): Support read only variables.
15954
15955         * statement.cs: Remove the explicit emit for the Leave opcode.
15956         (VariableInfo): Add a readonly field.
15957
15958 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * ecore.cs (ConvCast): new class used to encapsulate the various
15961         explicit integer conversions that works in both checked and
15962         unchecked contexts.
15963
15964         (Expression.ConvertNumericExplicit): Use new ConvCast class to
15965         properly generate the overflow opcodes.
15966
15967 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15968
15969         * statement.cs: The correct type for the EmptyExpression is the
15970         element_type, not the variable type.  Ravi pointed this out.
15971
15972 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15973
15974         * class.cs (Method::Define): Handle PInvoke methods specially
15975         by using DefinePInvokeMethod instead of the usual one.
15976
15977         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
15978         above to do the task of extracting information and defining the method.
15979
15980 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15981
15982         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
15983         of the condition for string type.
15984
15985         (Emit): Move that here. 
15986
15987         (ArrayCreation::CheckIndices): Keep string literals in their expression
15988         form.
15989
15990         (EmitDynamicInitializers): Handle strings appropriately.
15991
15992 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15993
15994         * codegen.cs (EmitContext): Replace multiple variables with a
15995         single pointer to the current Switch statement.
15996
15997         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
15998         EmitContext.
15999
16000 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * statement.cs 
16003
16004         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16005         default'.
16006
16007         (Foreach.Emit): Foreach on arrays was not setting
16008         up the loop variables (for break/continue).
16009
16010         (GotoCase): Semi-implented.
16011
16012 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16013
16014         * attribute.cs (CheckAttribute): Handle system attributes by using
16015         Attribute.GetAttributes to examine information we need.
16016
16017         (GetValidPlaces): Same here.
16018
16019         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16020
16021         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16022
16023         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16024
16025         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16026
16027         (Method::Emit): Handle the case when we are a PInvoke method.
16028
16029 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16030
16031         * expression.cs: Use ResolveWithSimpleName on compound names.
16032
16033 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16034
16035         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16036         before trying to reduce it.
16037
16038         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16039
16040         * constant.cs (LookupConstantValue): Implement.
16041
16042         (EmitConstant): Use the above in emitting the constant.
16043
16044         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16045         that are user-defined by doing a LookupConstantValue on them.
16046
16047         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16048         too, like above.
16049
16050 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16051
16052         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16053
16054         (BaseAccess.DoResolve): Implement.
16055
16056         (MemberAccess.DoResolve): Split this routine into a
16057         ResolveMemberAccess routine that can be used independently
16058
16059 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16060
16061         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16062         As that share bits of the implementation.  Is returns a boolean,
16063         while As returns the Type that is being probed.
16064
16065 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16066
16067         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16068         instead of a Literal - much easier.
16069
16070         (EnumInTransit): Remove - utterly useless :-)
16071
16072         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16073
16074         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16075
16076         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16077         chain when we have no associated expression.
16078
16079 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16080
16081         * constant.cs (Define): Use Location while reporting the errror.
16082
16083         Also emit a warning when 'new' is used and there is no inherited
16084         member to hide.
16085
16086         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16087         populated.
16088
16089         (LookupEnumValue): Implement to lookup an enum member's value and define it
16090         if necessary.
16091
16092         (Populate): Re-write accordingly to use the above routine.
16093
16094 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16095
16096         * expression.cs (This): Fix prototype for DoResolveLValue to
16097         override the base class DoResolveLValue.
16098
16099         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16100         declarations) 
16101
16102         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16103         (we need to load the address of the field here).  This fixes
16104         test-22. 
16105
16106         (FieldExpr.DoResolveLValue): Call the DoResolve
16107         function to initialize the Instance expression.
16108
16109         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16110         correctly the GetEnumerator operation on a value type.
16111
16112         * cs-parser.jay: Add more simple parsing error catches.
16113
16114         * statement.cs (Switch): Add support for string switches.
16115         Handle null specially.
16116
16117         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16118
16119 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16120
16121         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16122
16123         (declare_local_constant): New helper function.
16124
16125         * statement.cs (AddConstant): Keep a separate record of constants
16126
16127         (IsConstant): Implement to determine if a variable is a constant.
16128
16129         (GetConstantExpression): Implement.
16130
16131         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16132
16133         * statement.cs (IsVariableDefined): Re-write.
16134
16135 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16136
16137         * class.cs (TypeContainer::FindMembers): Look for constants
16138         in the case when we are looking for MemberTypes.Field
16139
16140         * expression.cs (MemberAccess::DoResolve): Check that in the
16141         case we are a FieldExpr and a Literal, we are not being accessed
16142         by an instance reference.
16143
16144         * cs-parser.jay (local_constant_declaration): Implement.
16145
16146         (declaration_statement): Implement for constant declarations.
16147
16148 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16149
16150         * statement.cs (Switch): Catch double defaults.
16151
16152         (Switch): More work on the switch() statement
16153         implementation.  It works for integral values now, need to finish
16154         string support.
16155
16156
16157 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16158
16159         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16160         integer literals into other integer literals.  To be used by
16161         switch. 
16162
16163 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16164
16165         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16166         some memory.
16167
16168         (EmitDynamicInitializers): Cope with the above since we extract data
16169         directly from ArrayData now.
16170
16171         (ExpectInitializers): Keep track of whether initializers are mandatory
16172         or not.
16173
16174         (Bounds): Make it a hashtable to prevent the same dimension being 
16175         recorded for every element in that dimension.
16176
16177         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16178         from being found.
16179
16180         Also fix bug which was causing the indices to be emitted in the reverse
16181         order.
16182
16183 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16184
16185         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16186         unfinished.  They do not work, because the underlying code is
16187         sloppy.
16188
16189 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16190
16191         * cs-parser.jay: Remove bogus fixme.
16192
16193         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16194         on Switch statement.
16195
16196 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16197
16198         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16199         the same. 
16200
16201         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16202         parameter. Apparently, any expression is allowed. 
16203
16204         (ValidateInitializers): Update accordingly.
16205
16206         (CheckIndices): Fix some tricky bugs thanks to recursion.
16207
16208         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16209         I was being completely brain-dead.
16210
16211         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16212         and re-write acordingly.
16213
16214         (DelegateInvocation): Re-write accordingly.
16215
16216         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16217
16218         (MakeByteBlob): Handle types more correctly.
16219
16220         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16221         initialization from expressions but it is incomplete because I am a complete
16222         Dodo :-|
16223
16224 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16227         on If.  Basically, we have to return `true' (ie, we do return to
16228         our caller) only if both branches of the if return.
16229
16230         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16231         short-circuit operators, handle them as short circuit operators. 
16232
16233         (Cast.DoResolve): Resolve type.
16234         (Cast.Cast): Take an expression as the target type.
16235
16236         * cs-parser.jay (cast_expression): Remove old hack that only
16237         allowed a limited set of types to be handled.  Now we take a
16238         unary_expression and we resolve to a type during semantic
16239         analysis.
16240
16241         Use the grammar productions from Rhys to handle casts (this is
16242         not complete like Rhys syntax yet, we fail to handle that corner
16243         case that C# has regarding (-x), but we will get there.
16244
16245 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16246
16247         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16248         field which is an array type.
16249
16250         * cs-parser.jay (declare_local_variables): Support array initialization too.
16251
16252         * typemanager.cs (MakeKey): Implement.
16253
16254         (everywhere): Use the above appropriately.
16255
16256         * cs-parser.jay (for_statement): Update for array initialization while
16257         declaring variables.
16258
16259         * ecore.cs : The error message was correct, it's the variable's names that
16260         were misleading ;-) Make the code more readable.
16261
16262         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16263         the correct type etc.
16264
16265         (ConvertExplicit): Handle Enum types by examining the underlying type.
16266
16267 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16268
16269         * parameter.cs (GetCallingConvention): Always return
16270         CallingConventions.Standard for now.
16271
16272 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16273
16274         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16275         and `r' after calling DoNumericPromotions.
16276
16277         * ecore.cs: Fix error message (the types were in the wrong order).
16278
16279         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16280         BindingFlags.Instance as well 
16281
16282         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16283         implicit int literal conversion in an empty cast so that we
16284         propagate the right type upstream.
16285
16286         (UnboxCast): new class used to unbox value types.
16287         (Expression.ConvertExplicit): Add explicit type conversions done
16288         by unboxing.
16289
16290         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16291         the target type before applying the implicit LongLiterals to ULong
16292         literal cast.
16293
16294 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16295
16296         * cs-parser.jay (for_statement): Reworked the way For works: now
16297         we declare manually any variables that are introduced in
16298         for_initializer to solve the problem of having out-of-band code
16299         emition (that is what got for broken).
16300
16301         (declaration_statement): Perform the actual variable declaration
16302         that used to be done in local_variable_declaration here.
16303
16304         (local_variable_declaration): Do not declare anything, just pass
16305         the information on a DictionaryEntry
16306
16307 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16308
16309         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16310         re-write of the logic to now make it recursive.
16311
16312         (UpdateIndices): Re-write accordingly.
16313
16314         Store element data in a separate ArrayData list in the above methods.
16315
16316         (MakeByteBlob): Implement to dump the array data into a byte array.
16317
16318 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16319
16320         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16321         into CheckIndices.
16322
16323         * constant.cs (Define): Implement.
16324
16325         (EmitConstant): Re-write fully.
16326
16327         Pass in location info.
16328
16329         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16330         respectively.
16331
16332         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16333         DictionaryEntry since we need location info too.
16334
16335         (constant_declaration): Update accordingly.
16336
16337         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16338         code into another method : UpdateIndices.
16339
16340 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16341
16342         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16343         some type checking etc.
16344
16345 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16346
16347         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16348         bits to provide dimension info if the user skips doing that.
16349
16350         Update second constructor to store the rank correctly.
16351
16352 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16353
16354         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16355         and try to implement.
16356
16357         * ../errors/cs0150.cs : Add.
16358
16359         * ../errors/cs0178.cs : Add.
16360
16361 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * statement.cs: Implement foreach on multi-dimensional arrays. 
16364
16365         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16366         name of the params argument.
16367
16368         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16369         initializing the array.
16370
16371         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16372         we can use this elsewhere.
16373
16374         * statement.cs: Finish implementation of foreach for single
16375         dimension arrays.
16376
16377         * cs-parser.jay: Use an out-of-band stack to pass information
16378         around, I wonder why I need this.
16379
16380         foreach_block: Make the new foreach_block the current_block.
16381
16382         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16383         function used to return a static Parameters structure.  Used for
16384         empty parameters, as those are created very frequently.
16385
16386         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16387
16388 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16389
16390         * interface.cs : Default modifier is private, not public. The
16391         make verify test passes again.
16392
16393 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16394
16395         * support.cs (ReflectionParameters): Fix logic to determine
16396         whether the last parameter is a params one. Test 9 passes again.
16397
16398         * delegate.cs (Populate): Register the builders we define with
16399         RegisterParameterForBuilder. Test 19 passes again.
16400
16401         * cs-parser.jay (property_declaration): Reference $6 instead
16402         of $$ to get at the location.
16403
16404         (indexer_declaration): Similar stuff.
16405
16406         (attribute): Ditto.
16407
16408         * class.cs (Property): Register parameters for the Get and Set methods
16409         if they exist. Test 23 passes again.
16410
16411         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16412         call to EmitArguments as we are sure there aren't any params arguments. 
16413         Test 32 passes again.
16414
16415         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16416         IndexOutOfRangeException. 
16417
16418         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16419         Test 33 now passes again.
16420
16421 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16422
16423         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16424         broke a bunch of things.  Will have to come up with a better way
16425         of tracking locations.
16426
16427         * statement.cs: Implemented foreach for single dimension arrays.
16428
16429 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16430
16431         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16432         an error.  This removes the lookup from the critical path.
16433
16434         * cs-parser.jay: Removed use of temporary_loc, which is completely
16435         broken. 
16436
16437 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * support.cs (ReflectionParameters.ParameterModifier): Report
16440         whether the argument is a PARAMS argument or not.
16441
16442         * class.cs: Set the attribute `ParamArrayAttribute' on the
16443         parameter argument.
16444
16445         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16446         and cons_param_array_attribute (ConstructorInfo for
16447         ParamArrayAttribute)., 
16448
16449         * codegen.cs: Emit the return using the `Return' statement, that
16450         way we can report the error correctly for missing return values. 
16451
16452         * class.cs (Method.Emit): Clean up.
16453
16454         * expression.cs (Argument.Resolve): Take another argument: the
16455         location where this argument is used.  Notice that this is not
16456         part of the "Argument" class as to reduce the size of the
16457         structure (we know the approximate location anyways).
16458
16459         Test if the argument is a variable-reference, if not, then
16460         complain with a 206.
16461
16462         (Argument.Emit): Emit addresses of variables.
16463
16464         (Argument.FullDesc): Simplify.
16465
16466         (Invocation.DoResolve): Update for Argument.Resolve.
16467
16468         (ElementAccess.DoResolve): ditto.
16469
16470         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16471         method should be virtual, as this method is always virtual.
16472
16473         (NewDelegate.DoResolve): Update for Argument.Resolve.
16474
16475         * class.cs (ConstructorInitializer.DoResolve): ditto.
16476
16477         * attribute.cs (Attribute.Resolve): ditto.
16478
16479 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16482
16483         * expression.cs (ParameterReference): Drop IStackStorage and implement
16484         IAssignMethod instead. 
16485
16486         (LocalVariableReference): ditto.
16487
16488         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16489         IAssignMethod instead. 
16490
16491 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16492
16493         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16494         enumerations that are used in heavily used structures derive from
16495         byte in a laughable and pathetic attempt to reduce memory usage.
16496         This is the kind of pre-optimzations that you should not do at
16497         home without adult supervision.
16498
16499         * expression.cs (UnaryMutator): New class, used to handle ++ and
16500         -- separatedly from the other unary operators.  Cleans up the
16501         code, and kills the ExpressionStatement dependency in Unary.
16502
16503         (Unary): Removed `method' and `Arguments' from this class, making
16504         it smaller, and moving it all to SimpleCall, so I can reuse this
16505         code in other locations and avoid creating a lot of transient data
16506         strucutres when not required.
16507
16508         * cs-parser.jay: Adjust for new changes.
16509
16510 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * enum.cs (Enum.Populate): If there is a failure during
16513         definition, return
16514
16515         * cs-parser.jay (opt_enum_base): we used to catch type errors
16516         here, but this is really incorrect.  The type error should be
16517         catched during semantic analysis.
16518
16519 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16520
16521         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16522         current_local_parameters as expected since I, in my stupidity, had forgotten
16523         to do this :-)
16524
16525         * attribute.cs (GetValidPlaces): Fix stupid bug.
16526
16527         * class.cs (Method::Emit): Perform check on applicability of attributes.
16528
16529         (Constructor::Emit): Ditto.
16530
16531         (Field::Emit): Ditto.
16532
16533         (Field.Location): Store location information.
16534
16535         (Property, Event, Indexer, Operator): Ditto.
16536
16537         * cs-parser.jay (field_declaration): Pass in location for each field.
16538
16539         * ../errors/cs0592.cs : Add.
16540
16541 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16542
16543         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16544
16545         (InitCoreTypes): Update accordingly.
16546
16547         (RegisterAttrType, LookupAttr): Implement.
16548
16549         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16550         info about the same.
16551
16552         (Resolve): Update to populate the above as necessary.
16553
16554         (Error592): Helper.
16555
16556         (GetValidPlaces): Helper to the above.
16557
16558         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16559
16560         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16561
16562 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16563
16564         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16565
16566         * ../errors/cs0617.cs : Add.
16567
16568 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16569
16570         * enum.cs (Emit): Rename to Populate to be more consistent with what
16571         we expect it to do and when exactly it is called.
16572
16573         * class.cs, rootcontext.cs : Update accordingly.
16574
16575         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16576         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16577
16578         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16579
16580         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16581         of a fieldinfo using the above, when dealing with a FieldBuilder.
16582
16583 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16584
16585         * ../errors/cs0031.cs : Add.
16586
16587         * ../errors/cs1008.cs : Add.
16588
16589         * ../errrors/cs0543.cs : Add.
16590
16591         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16592         enum type.
16593
16594         (FindMembers): Implement.
16595
16596         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16597         enums and delegates too.
16598
16599         (enum_types): Rename to builder_to_enum.
16600
16601         (delegate_types): Rename to builder_to_delegate.
16602
16603         * delegate.cs (FindMembers): Implement.
16604
16605 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16606
16607         * typemanager.cs (IsEnumType): Implement.
16608
16609         * enum.cs (Emit): Re-write parts to account for the underlying type
16610         better and perform checking etc.
16611
16612         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16613         of the underlying type.
16614
16615         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16616         value
16617
16618         * enum.cs (error31): Helper to report error #31.
16619
16620         * cs-parser.jay (enum_declaration): Store location of each member too.
16621
16622         * enum.cs (member_to_location): New hashtable. 
16623
16624         (AddEnumMember): Update location hashtable.
16625
16626         (Emit): Use the location of each member while reporting errors.
16627
16628 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * cs-parser.jay: A for_initializer if is a
16631         local_variable_declaration really ammount to have an implicit
16632         block with the variable declaration and no initializer for for.
16633
16634         * statement.cs (For.Emit): Cope with null initializers.
16635
16636         This fixes the infinite loop on for initializers.
16637
16638 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16639
16640         * enum.cs: More cleanup.
16641
16642         * ecore.cs: Remove dead code.
16643
16644         * class.cs (Property.Emit): More simplification.
16645         (Event.Emit): ditto.
16646
16647         Reworked to have less levels of indentation.
16648
16649 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16650
16651         * class.cs (Property): Emit attributes.
16652
16653         (Field): Ditto.
16654
16655         (Event): Ditto.
16656
16657         (Indexer): Ditto.
16658
16659         (Operator): Ditto.
16660
16661         * enum.cs (Emit): Ditto.
16662
16663         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16664         Enums too.
16665
16666         * class.cs (Field, Event, etc.): Move attribute generation into the
16667         Emit method everywhere.
16668
16669         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16670         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16671         as we had no way of defining nested enums !
16672
16673         * rootcontext.cs : Adjust code accordingly.
16674
16675         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16676
16677 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16678
16679         * expression.cs (EvalConstantExpression): Move into ecore.cs
16680
16681         * enum.cs (Enum): Rename some members and make them public and readonly
16682         according to our convention.
16683
16684         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16685         nothing else.
16686
16687         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16688
16689         (Enum::Emit): Write a simple version for now which doesn't try to compute
16690         expressions. I shall modify this to be more robust in just a while.
16691
16692         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16693
16694         (TypeContainer::CloseType): Create the Enum types too.
16695
16696         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16697
16698         * expression.cs (EvalConstantExpression): Get rid of completely.
16699
16700         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16701         user-defined values and other cases.
16702
16703         (IsValidEnumLiteral): Helper function.
16704
16705         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16706         out there in the case we had a literal FieldExpr.
16707
16708         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16709
16710         (Literalize): Revamp a bit to take two arguments.
16711
16712         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16713
16714 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16715
16716         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16717
16718         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16719
16720         (Resolve): Use the above to ensure we have proper initializers.
16721
16722 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16723
16724         * expression.cs (Expression::EvalConstantExpression): New method to 
16725         evaluate constant expressions.
16726
16727         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16728
16729 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16730
16731         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16732         in an array.
16733
16734         (Binary.ResolveOperator): Handle operator != (object a, object b)
16735         and operator == (object a, object b);
16736
16737         (Binary.DoNumericPromotions): Indicate whether the numeric
16738         promotion was possible.
16739
16740         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16741         Implement.  
16742
16743         Made the ArrayAccess implement interface IAssignMethod instead of
16744         IStackStore as the order in which arguments are passed reflects
16745         this.
16746
16747         * assign.cs: Instead of using expr.ExprClass to select the way of
16748         assinging, probe for the IStackStore/IAssignMethod interfaces.
16749
16750         * typemanager.cs: Load InitializeArray definition.
16751
16752         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16753         static data that can be used to initialize arrays. 
16754
16755 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16756
16757         * expression.cs: Handle operator== and operator!= for booleans.
16758
16759         (Conditioal.Reduce): Implement reducer for the ?: operator.
16760
16761         (Conditional.Resolve): Implement dead code elimination.
16762
16763         (Binary.Resolve): Catch string literals and return a new
16764         concatenated string.
16765
16766         (Unary.Reduce): Implement reduction of unary expressions.
16767
16768         * ecore.cs: Split out the expression core handling here.
16769
16770         (Expression.Reduce): New method used to perform constant folding
16771         and CSE.  This is needed to support constant-expressions. 
16772
16773         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16774         targets, and optimize for !x.
16775
16776 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16777
16778         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16779         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16780         set custom atttributes.
16781
16782         * literal.cs (Literal::GetValue): New abstract method to return the actual
16783         value of the literal, cast as an object.
16784
16785         (*Literal): Implement GetValue method.
16786
16787         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16788         expressions to the arraylist but objects of type Argument.
16789
16790         * class.cs (TypeContainer::Emit): Emit our attributes too.
16791
16792         (Method::Emit, Constructor::Emit): Ditto.
16793
16794         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16795         to be ignoring earlier.
16796
16797 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16798
16799         * attribute.cs (AttributeSection::Define): Implement to do the business
16800         of constructing a CustomAttributeBuilder.
16801
16802         (Attribute): New trivial class. Increases readability of code.  
16803
16804         * cs-parser.jay : Update accordingly.
16805
16806         (positional_argument_list, named_argument_list, named_argument): New rules
16807
16808         (attribute_arguments): Use the above so that we are more correct.
16809
16810 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16811
16812         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16813         to perform all checks for a method with a params parameter.
16814
16815         (Invocation::OverloadResolve): Update to use the above method and therefore
16816         cope correctly with params method invocations.
16817
16818         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16819         params too.
16820
16821         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16822         constructors in our parent too because we can't afford to miss out on 
16823         protected ones ;-)
16824
16825         * attribute.cs (AttributeSection): New name for the class Attribute
16826
16827         Other trivial changes to improve readability.
16828
16829         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16830         use the new class names.
16831
16832 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16833
16834         * class.cs (Method::Define): Complete definition for params types too
16835
16836         (Indexer::Define): Ditto.
16837
16838         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16839         Cope everywhere with a request for info about the array parameter.
16840
16841 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16842
16843         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16844
16845         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16846         local_variable_type to extract the string corresponding to the type.
16847
16848         (local_variable_type): Fixup the action to use the new helper method.
16849
16850         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16851         go.
16852
16853         * expression.cs : Clean out code which uses the above.
16854
16855 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16856
16857         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16858         and bale out if necessary by returning a false.
16859
16860         (RegisterProperty): Ditto.
16861
16862         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16863         and print out appropriate error messages.
16864
16865         * interface.cs (everywhere): Ditto.
16866
16867         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16868         location to constructor.
16869
16870         * class.cs (Property, Event, Indexer): Update accordingly.
16871
16872         * ../errors/cs111.cs : Added.
16873
16874         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16875         of a method, as laid down by the spec.
16876
16877         (Invocation::OverloadResolve): Use the above method.
16878
16879 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16880
16881         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16882         now take a TypeContainer and a Parameters object.
16883
16884         (ParameterData): Modify return type of ParameterModifier method to be 
16885         Parameter.Modifier and not a string.
16886
16887         (ReflectionParameters, InternalParameters): Update accordingly.
16888
16889         * expression.cs (Argument::GetParameterModifier): Same here.
16890
16891         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16892         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16893         symbol in it at all so maybe this is only for now.
16894
16895 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16896
16897         * support.cs (InternalParameters): Constructor now takes an extra argument 
16898         which is the actual Parameters class.
16899
16900         (ParameterDesc): Update to provide info on ref/out modifiers.
16901
16902         * class.cs (everywhere): Update call to InternalParameters to pass in
16903         the second argument too.
16904
16905         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16906         to return the modifier info [ref/out etc]
16907
16908         (InternalParameters, ReflectionParameters): Implement the above.
16909
16910         * expression.cs (Argument::ParameterModifier): Similar function to return
16911         info about the argument's modifiers.
16912
16913         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16914         too.
16915
16916         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16917         a new SetFormalParameters object which we pass to InternalParameters.
16918
16919 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16920
16921         * expression.cs (NewArray): Merge into the ArrayCreation class.
16922
16923 2001-10-29  Ravi Pratap  <ravi@ximian.com>
16924
16925         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
16926         NewUserdefinedArray into one as there wasn't much of a use in having
16927         two separate ones.
16928
16929         * expression.cs (Argument): Change field's name to ArgType from Type.
16930
16931         (Type): New readonly property which returns the proper type, taking into 
16932         account ref/out modifiers.
16933
16934         (everywhere): Adjust code accordingly for the above.
16935
16936         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16937         whether we are emitting for a ref or out parameter.
16938
16939         * expression.cs (Argument::Emit): Use the above field to set the state.
16940
16941         (LocalVariableReference::Emit): Update to honour the flag and emit the
16942         right stuff.
16943
16944         * parameter.cs (Attributes): Set the correct flags for ref parameters.
16945
16946         * expression.cs (Argument::FullDesc): New function to provide a full desc.
16947
16948         * support.cs (ParameterData): Add method ParameterDesc to the interface.
16949
16950         (ReflectionParameters, InternalParameters): Implement the above method.
16951
16952         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
16953         reporting errors.
16954
16955         (Invocation::FullMethodDesc): Ditto. 
16956
16957 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * cs-parser.jay: Add extra production for the second form of array
16960         creation. 
16961
16962         * expression.cs (ArrayCreation): Update to reflect the above
16963         change. 
16964
16965         * Small changes to prepare for Array initialization.
16966
16967 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
16968
16969         * typemanager.cs (ImplementsInterface): interface might be null;
16970         Deal with this problem;
16971
16972         Also, we do store negative hits on the cache (null values), so use
16973         this instead of calling t.GetInterfaces on the type everytime.
16974
16975 2001-10-28  Ravi Pratap  <ravi@ximian.com>
16976
16977         * typemanager.cs (IsBuiltinType): New method to help determine the same.
16978
16979         * expression.cs (New::DoResolve): Get rid of array creation code and instead
16980         split functionality out into different classes.
16981
16982         (New::FormArrayType): Move into NewBuiltinArray.
16983
16984         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
16985         quite useless.
16986
16987         (NewBuiltinArray): New class to handle creation of built-in arrays.
16988
16989         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
16990         account creation of one-dimensional arrays.
16991
16992         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
16993
16994         (NewUserdefinedArray::DoResolve): Implement.
16995
16996         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
16997
16998         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
16999         we maintain inside the TypeManager. This is necessary to perform lookups on the
17000         module builder.
17001
17002         (LookupType): Update to perform GetType on the module builders too.     
17003
17004         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17005
17006         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17007
17008 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17009
17010         * expression.cs (New::DoResolve): Implement guts of array creation.
17011
17012         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17013
17014 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17015
17016         * expression.cs: Fix bug I introduced lsat night that broke
17017         Delegates. 
17018
17019         (Expression.Resolve): Report a 246 error (can not resolve name)
17020         if we find a SimpleName in the stream.
17021
17022         (Expression.ResolveLValue): Ditto.
17023
17024         (Expression.ResolveWithSimpleName): This function is a variant of
17025         ResolveName, this one allows SimpleNames to be returned without a
17026         warning.  The only consumer of SimpleNames is MemberAccess
17027
17028 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17029
17030         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17031         might arrive here.  I have my doubts that this is correct.
17032
17033         * statement.cs (Lock): Implement lock statement.
17034
17035         * cs-parser.jay: Small fixes to support `lock' and `using'
17036
17037         * cs-tokenizer.cs: Remove extra space
17038
17039         * driver.cs: New flag --checked, allows to turn on integer math
17040         checking. 
17041
17042         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17043         Threading.Monitor.Exit 
17044
17045 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17046
17047         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17048         Expression Class to be IndexerAccess.
17049
17050         Notice that Indexer::DoResolve sets the eclass to Value.
17051
17052 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17053
17054         * class.cs (TypeContainer::Emit): Emit code for indexers.
17055
17056         * assign.cs (IAssignMethod): New interface implemented by Indexers
17057         and Properties for handling assignment.
17058
17059         (Assign::Emit): Simplify and reuse code. 
17060
17061         * expression.cs (IndexerAccess, PropertyExpr): Implement
17062         IAssignMethod, clean up old code. 
17063
17064 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17065
17066         * typemanager.cs (ImplementsInterface): New method to determine if a type
17067         implements a given interface. Provides a nice cache too.
17068
17069         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17070         method.
17071
17072         (ConvertReferenceExplicit): Ditto.
17073
17074         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17075         various methods, with correct names etc.
17076
17077         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17078         Operator.UnaryNegation.
17079
17080         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17081         we have a unary plus or minus operator.
17082
17083         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17084         UnaryMinus.
17085
17086         * everywhere : update accordingly.
17087
17088         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17089         respectively.
17090
17091         * class.cs (Method::Define): For the case where we are implementing a method
17092         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17093         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17094
17095 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17096
17097         * interface.cs (FindMembers): Implement to work around S.R.E
17098         lameness.
17099
17100         * typemanager.cs (IsInterfaceType): Implement.
17101
17102         (FindMembers): Update to handle interface types too.
17103
17104         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17105         use IsAssignableFrom as that is not correct - it doesn't work.
17106
17107         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17108         and accordingly override EmitStatement.
17109
17110         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17111         using the correct logic :-)
17112
17113 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17114
17115         * ../errors/cs-11.cs : Add to demonstrate error -11 
17116
17117 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17118
17119         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17120         then pass this as a hint to ResolveLValue.
17121
17122         * expression.cs (FieldExpr): Add Location information
17123
17124         (FieldExpr::LValueResolve): Report assignment to readonly
17125         variable. 
17126
17127         (Expression::ExprClassFromMemberInfo): Pass location information.
17128
17129         (Expression::ResolveLValue): Add new method that resolves an
17130         LValue. 
17131
17132         (Expression::DoResolveLValue): Default invocation calls
17133         DoResolve. 
17134
17135         (Indexers): New class used to keep track of indexers in a given
17136         Type. 
17137
17138         (IStackStore): Renamed from LValue, as it did not really describe
17139         what this did.  Also ResolveLValue is gone from this interface and
17140         now is part of Expression.
17141
17142         (ElementAccess): Depending on the element access type
17143
17144         * typemanager.cs: Add `indexer_name_type' as a Core type
17145         (System.Runtime.CompilerServices.IndexerNameAttribute)
17146
17147         * statement.cs (Goto): Take a location.
17148
17149 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17150
17151         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17152         if two delegates are compatible.
17153
17154         (NewDelegate::DoResolve): Update to take care of the case when
17155         we instantiate a delegate from another delegate.
17156
17157         * typemanager.cs (FindMembers): Don't even try to look up members
17158         of Delegate types for now.
17159
17160 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17161
17162         * delegate.cs (NewDelegate): New class to take care of delegate
17163         instantiation.
17164
17165         * expression.cs (New): Split the delegate related code out into 
17166         the NewDelegate class.
17167
17168         * delegate.cs (DelegateInvocation): New class to handle delegate 
17169         invocation.
17170
17171         * expression.cs (Invocation): Split out delegate related code into
17172         the DelegateInvocation class.
17173
17174 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17175
17176         * expression.cs (New::DoResolve): Implement delegate creation fully
17177         and according to the spec.
17178
17179         (New::DoEmit): Update to handle delegates differently.
17180
17181         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17182         because of which we were printing out arguments in reverse order !
17183
17184         * delegate.cs (VerifyMethod): Implement to check if the given method
17185         matches the delegate.
17186
17187         (FullDelegateDesc): Implement.
17188
17189         (VerifyApplicability): Implement.
17190
17191         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17192         delegate invocations too.
17193
17194         (Invocation::Emit): Ditto.
17195
17196         * ../errors/cs1593.cs : Added.
17197
17198         * ../errors/cs1594.cs : Added.
17199
17200         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17201
17202 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17203
17204         * typemanager.cs (intptr_type): Core type for System.IntPtr
17205
17206         (InitCoreTypes): Update for the same.
17207
17208         (iasyncresult_type, asynccallback_type): Ditto.
17209
17210         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17211         correct.
17212
17213         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17214         too.
17215
17216         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17217         the builders for the 4 members of a delegate type :-)
17218
17219         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17220         type.
17221
17222         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17223
17224         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17225
17226 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17227
17228         * statement.cs (Break::Emit): Implement.   
17229         (Continue::Emit): Implement.
17230
17231         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17232         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17233         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17234         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17235         end loop
17236
17237         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17238         properties that track the label for the current loop (begin of the
17239         loop and end of the loop).
17240
17241 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17242
17243         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17244         use of emitting anything at all.
17245
17246         * class.cs, rootcontext.cs : Get rid of calls to the same.
17247
17248         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17249
17250         (Populate): Define the constructor correctly and set the implementation
17251         attributes.
17252
17253         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17254         have been defined.
17255
17256         (AddDelegateType): Implement.
17257
17258         (IsDelegateType): Implement helper method.
17259
17260         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17261
17262         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17263         and accordingly handle it.
17264
17265         * delegate.cs (Populate): Take TypeContainer argument.
17266         Implement bits to define the Invoke method. However, I still haven't figured out
17267         how to take care of the native int bit :-(
17268
17269         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17270         Qualify the name of the delegate, not its return type !
17271
17272         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17273         conversion.
17274
17275         (StandardConversionExists): Checking for array types turns out to be recursive.
17276
17277         (ConvertReferenceExplicit): Implement array conversion.
17278
17279         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17280
17281 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17282
17283         * cs-parser.jay (delegate_declaration): Store the fully qualified
17284         name as it is a type declaration.
17285
17286         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17287         readonly.
17288
17289         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17290         as TypeContainer::DefineType.
17291
17292         (Populate): Method in which all the definition of the various methods (Invoke)
17293         etc is done.
17294
17295         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17296         see.
17297
17298         (CloseDelegate): Finally creates the delegate.
17299
17300         * class.cs (TypeContainer::DefineType): Update to define delegates.
17301         (Populate, Emit and CloseType): Do the same thing here too.
17302
17303         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17304         delegates in all these operations.
17305
17306 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * expression.cs: LocalTemporary: a new expression used to
17309         reference a temporary that has been created.
17310
17311         * assign.cs: Handle PropertyAccess back here, so that we can
17312         provide the proper semantic access to properties.
17313
17314         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17315         a few more explicit conversions. 
17316
17317         * modifiers.cs: `NEW' modifier maps to HideBySig.
17318
17319         * expression.cs (PropertyExpr): Make this into an
17320         ExpressionStatement, and support the EmitStatement code path. 
17321
17322         Perform get/set error checking, clean up the interface.
17323
17324         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17325         them into toplevel access objects.
17326
17327 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17328
17329         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17330         SRE.
17331
17332         * typemanager.cs: Keep track here of our PropertyBuilders again to
17333         work around lameness in SRE.
17334
17335 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * expression.cs (LValue::LValueResolve): New method in the
17338         interface, used to perform a second resolution pass for LValues. 
17339
17340         (This::DoResolve): Catch the use of this in static methods.
17341
17342         (This::LValueResolve): Implement.
17343
17344         (This::Store): Remove warning, assigning to `this' in structures
17345         is 
17346
17347         (Invocation::Emit): Deal with invocation of
17348         methods on value types.  We need to pass the address to structure
17349         methods rather than the object itself.  (The equivalent code to
17350         emit "this" for structures leaves the entire structure on the
17351         stack instead of a pointer to it). 
17352
17353         (ParameterReference::DoResolve): Compute the real index for the
17354         argument based on whether the method takes or not a `this' pointer
17355         (ie, the method is static).
17356
17357         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17358         value types returned from functions when we need to invoke a
17359         method on the sturcture.
17360
17361
17362 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17363
17364         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17365         defining the type in the Modulebuilder or Typebuilder. This is to take
17366         care of nested types which need to be defined on the TypeBuilder using
17367         DefineNestedMethod.
17368
17369         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17370         methods in RootContext, only ported to be part of TypeContainer.
17371
17372         (TypeContainer::GetInterfaceOrClass): Ditto.
17373
17374         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17375
17376         * interface.cs (Interface::DefineInterface): New method. Does exactly
17377         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17378         too.
17379
17380         (Interface::GetInterfaces): Move from RootContext here and port.
17381
17382         (Interface::GetInterfaceByName): Same here.
17383
17384         * rootcontext.cs (ResolveTree): Re-write.
17385
17386         (PopulateTypes): Re-write.
17387
17388         * class.cs (TypeContainer::Populate): Populate nested types too.
17389         (TypeContainer::Emit): Emit nested members too.
17390
17391         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17392         instead just use the name argument passed in as it is already fully
17393         qualified.
17394
17395         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17396         to TypeContainer mapping to see if a type is user-defined.
17397
17398         * class.cs (TypeContainer::CloseType): Implement. 
17399
17400         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17401         the default constructor.
17402
17403         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17404         twice.
17405
17406         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17407
17408         * interface.cs (CloseType): Create the type here.
17409
17410         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17411         the hierarchy.
17412
17413         Remove all the methods which are now in TypeContainer.
17414
17415 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17416
17417         * delegate.cs (Define): Re-write bits to define the delegate
17418         correctly.
17419
17420 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17421
17422         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17423
17424         * expression.cs (ImplicitReferenceConversion): handle null as well
17425         as a source to convert to any reference type.
17426
17427         * statement.cs (Return): Perform any implicit conversions to
17428         expected return type.  
17429
17430         Validate use of return statement.  
17431
17432         * codegen.cs (EmitContext): Pass the expected return type here.
17433
17434         * class.cs (Method, Constructor, Property): Pass expected return
17435         type to EmitContext.
17436
17437 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17438
17439         * expression.cs: Make DoResolve take an EmitContext instead of a
17440         TypeContainer.
17441
17442         Replaced `l' and `location' for `loc', for consistency.
17443
17444         (Error, Warning): Remove unneeded Tc argument.
17445
17446         * assign.cs, literal.cs, constant.cs: Update to new calling
17447         convention. 
17448
17449         * codegen.cs: EmitContext now contains a flag indicating whether
17450         code is being generated in a static method or not.
17451
17452         * cs-parser.jay: DecomposeQI, new function that replaces the old
17453         QualifiedIdentifier.  Now we always decompose the assembled
17454         strings from qualified_identifier productions into a group of
17455         memberaccesses.
17456
17457 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17458
17459         * rootcontext.cs: Deal with field-less struct types correctly now
17460         by passing the size option to Define Type.
17461
17462         * class.cs: Removed hack that created one static field. 
17463
17464 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * statement.cs: Moved most of the code generation here. 
17467
17468 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17469
17470         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17471         seem very right.
17472
17473         (ElementAccess): Remove useless bits for now - keep checks as the spec
17474         says.
17475
17476 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17477
17478         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17479         and start performing checks according to the spec.
17480
17481 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17482
17483         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17484         rank_specifiers instead.
17485
17486         (rank_specifiers): Change the order in which the rank specifiers are stored
17487
17488         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17489
17490         * expression.cs (ElementAccess): Implement the LValue interface too.
17491
17492 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17493
17494         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17495         except that user defined conversions are not included.
17496
17497         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17498         perform the conversion of the return type, if necessary.
17499
17500         (New::DoResolve): Check whether we are creating an array or an object
17501         and accordingly do the needful.
17502
17503         (New::Emit): Same here.
17504
17505         (New::DoResolve): Implement guts of array creation.
17506
17507         (New::FormLookupType): Helper function.
17508
17509 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17510
17511         * codegen.cs: Removed most of the code generation here, and move the
17512         corresponding code generation bits to the statement classes. 
17513
17514         Added support for try/catch/finalize and throw.
17515
17516         * cs-parser.jay: Added support for try/catch/finalize.
17517
17518         * class.cs: Catch static methods having the flags override,
17519         virtual or abstract.
17520
17521         * expression.cs (UserCast): This user cast was not really doing
17522         what it was supposed to do.  Which is to be born in fully resolved
17523         state.  Parts of the resolution were being performed at Emit time! 
17524
17525         Fixed this code.
17526
17527 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * expression.cs: Implicity convert the result from UserCast.
17530
17531 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17532
17533         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17534         prevented it from working correctly. 
17535
17536         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17537         merely ConvertImplicit.
17538
17539 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17540
17541         * typemanager.cs: Make the LookupTypeContainer function static,
17542         and not per-instance.  
17543
17544         * class.cs: Make static FindMembers (the one that takes a Type
17545         argument). 
17546
17547         * codegen.cs: Add EmitForeach here.
17548
17549         * cs-parser.jay: Make foreach a toplevel object instead of the
17550         inline expansion, as we need to perform semantic analysis on it. 
17551
17552 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17553
17554         * expression.cs (Expression::ImplicitUserConversion): Rename to
17555         UserDefinedConversion.
17556
17557         (Expression::UserDefinedConversion): Take an extra argument specifying 
17558         whether we look for explicit user conversions too.
17559
17560         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17561
17562         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17563
17564         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17565         with the appropriate arguments.
17566
17567         * cs-parser.jay (cast_expression): Record location too.
17568
17569         * expression.cs (Cast): Record location info.
17570
17571         (Expression::ConvertExplicit): Take location argument.
17572
17573         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17574         to determine if we are doing explicit conversions.
17575
17576         (UserCast::Emit): Update accordingly.
17577
17578         (Expression::ConvertExplicit): Report an error if everything fails.
17579
17580         * ../errors/cs0030.cs : Add.
17581
17582 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17585         virtual and newslot bits. 
17586
17587         * class.cs (TypeContainer::RegisterRequiredImplementations):
17588         Record methods we need.
17589
17590         (TypeContainer::MakeKey): Helper function to make keys for
17591         MethodBases, since the Methodbase key is useless.
17592
17593         (TypeContainer::Populate): Call RegisterRequiredImplementations
17594         before defining the methods.   
17595
17596         Create a mapping for method_builders_to_methods ahead of time
17597         instead of inside a tight loop.
17598
17599         (::RequireMethods):  Accept an object as the data to set into the
17600         hashtable so we can report interface vs abstract method mismatch.
17601
17602 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17603
17604         * report.cs: Make all of it static.
17605
17606         * rootcontext.cs: Drop object_type and value_type computations, as
17607         we have those in the TypeManager anyways.
17608
17609         Drop report instance variable too, now it is a global.
17610
17611         * driver.cs: Use try/catch on command line handling.
17612
17613         Add --probe option to debug the error reporting system with a test
17614         suite. 
17615
17616         * report.cs: Add support for exiting program when a probe
17617         condition is reached.
17618
17619 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17620
17621         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17622         we do a forcible conversion regardless of type, to check if 
17623         ForceConversion returns a null.
17624
17625         (Binary::error19): Use location to report error.
17626
17627         (Unary::error23): Use location here too.
17628
17629         * ../errors/cs0019.cs : Check in.
17630
17631         * ../errors/cs0023.cs : Check in.
17632
17633         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17634         case of a non-null MethodInfo object with a length of 0 !
17635
17636         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17637         an applicable member - according to the spec :-)
17638         Also fix logic to find members in base types.
17639
17640         (Unary::ResolveOperator): Same here.
17641
17642         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17643         as I was getting thoroughly confused between this and error19 :-)
17644
17645         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17646         (::FindMostEncompassedType): Implement.
17647         (::FindMostEncompassingType): Implement.
17648         (::StandardConversionExists): Implement.
17649
17650         (UserImplicitCast): Re-vamp. We now need info about most specific
17651         source and target types so that we can do the necessary conversions.
17652
17653         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17654         mathematical union with no duplicates.
17655
17656 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17657
17658         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17659         in order from base classes to child classes, so that we can in
17660         child classes look up in our parent for method names and
17661         attributes (required for handling abstract, virtual, new, override
17662         constructs: we need to instrospect our base class, and if we dont
17663         populate the classes in order, the introspection might be
17664         incorrect.  For example, a method could query its parent before
17665         the parent has any methods and would determine that the parent has
17666         no abstract methods (while it could have had them)).
17667
17668         (RootContext::CreateType): Record the order in which we define the
17669         classes.
17670
17671 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17672
17673         * class.cs (TypeContainer::Populate): Also method definitions can
17674         fail now, keep track of this.
17675
17676         (TypeContainer::FindMembers): Implement support for
17677         DeclaredOnly/noDeclaredOnly flag.
17678
17679         (Constructor::Emit) Return the ConstructorBuilder.
17680
17681         (Method::Emit) Return the MethodBuilder. 
17682         Check for abstract or virtual methods to be public.
17683
17684         * rootcontext.cs (RootContext::CreateType): Register all the
17685         abstract methods required for the class to be complete and the
17686         interface methods that must be implemented. 
17687
17688         * cs-parser.jay: Report error 501 (method requires body if it is
17689         not marked abstract or extern).
17690
17691         * expression.cs (TypeOf::Emit): Implement.
17692
17693         * typemanager.cs: runtime_handle_type, new global type.
17694
17695         * class.cs (Property::Emit): Generate code for properties.
17696
17697 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17698
17699         * expression.cs (Unary::ResolveOperator): Find operators on base type
17700         too - we now conform exactly to the spec.
17701
17702         (Binary::ResolveOperator): Same here.
17703
17704         * class.cs (Operator::Define): Fix minor quirk in the tests.
17705
17706         * ../errors/cs0215.cs : Added.
17707
17708         * ../errors/cs0556.cs : Added.
17709
17710         * ../errors/cs0555.cs : Added.
17711
17712 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17713
17714         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17715         single integer which is really efficient
17716
17717 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17718
17719         *  expression.cs (Expression::ImplicitUserConversion): Use location
17720         even in the case when we are examining True operators.
17721  
17722         * class.cs (Operator::Define): Perform extensive checks to conform
17723         with the rules for operator overloading in the spec.
17724
17725         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17726         some of the other conversions mentioned in the spec.
17727
17728         * typemanager.cs (array_type): New static member for the System.Array built-in
17729         type.
17730
17731         (cloneable_interface): For System.ICloneable interface.
17732
17733         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17734         we start resolving the tree and populating types.
17735
17736         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17737  
17738 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * expression.cs (Expression::ExprClassFromMemberInfo,
17741         Expression::Literalize): Create literal expressions from
17742         FieldInfos which are literals.
17743
17744         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17745         type casts, because they were wrong.  The test suite in tests
17746         caught these ones.
17747
17748         (ImplicitNumericConversion): ushort to ulong requires a widening
17749         cast. 
17750
17751         Int32 constant to long requires widening cast as well.
17752
17753         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17754         for integers because the type on the stack is not i4.
17755
17756 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17757
17758         * expression.cs (report118): require location argument. 
17759
17760         * parameter.cs: Do not dereference potential null value.
17761
17762         * class.cs: Catch methods that lack the `new' keyword when
17763         overriding a name.  Report warnings when `new' is used without
17764         anything being there to override.
17765
17766         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17767
17768         * class.cs: Only add constructor to hashtable if it is non-null
17769         (as now constructors can fail on define).
17770
17771         (TypeManager, Class, Struct): Take location arguments.
17772
17773         Catch field instance initialization in structs as errors.
17774
17775         accepting_filter: a new filter for FindMembers that is static so
17776         that we dont create an instance per invocation.
17777
17778         (Constructor::Define): Catch errors where a struct constructor is
17779         parameterless 
17780
17781         * cs-parser.jay: Pass location information for various new
17782         constructs. 
17783
17784         * delegate.cs (Delegate): take a location argument.
17785
17786         * driver.cs: Do not call EmitCode if there were problesm in the
17787         Definition of the types, as many Builders wont be there. 
17788
17789         * decl.cs (Decl::Decl): Require a location argument.
17790
17791         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17792         into integers, and find the most appropiate integer for it.
17793
17794         * literal.cs: Implement ULongLiteral.
17795
17796         * rootcontext.cs: Provide better information about the location of
17797         failure when CreateType fails.
17798
17799 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17800
17801         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17802         as well.
17803
17804         * expression.cs (Binary::CheckShiftArguments): Add missing type
17805         computation.
17806         (Binary::ResolveOperator): Add type to the logical and and logical
17807         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17808         before.
17809
17810         (Binary::DoNumericPromotions): In the case where either argument
17811         is ulong (and most signed types combined with ulong cause an
17812         error) perform implicit integer constant conversions as well.
17813
17814 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * expression.cs (UserImplicitCast): Method should always be
17817         non-null. 
17818         (Invocation::BetterConversion): Simplified test for IntLiteral.
17819
17820         (Expression::ImplicitNumericConversion): Split this routine out.
17821         Put the code that performs implicit constant integer conversions
17822         here. 
17823
17824         (Expression::Resolve): Become a wrapper around DoResolve so we can
17825         check eclass and type being set after resolve.
17826
17827         (Invocation::Badness): Remove this dead function
17828
17829         (Binary::ResolveOperator): Do not compute the expensive argumnets
17830         unless we have a union for it.
17831
17832         (Probe::Emit): Is needs to do an isinst and then
17833         compare against null.
17834
17835         (::CanConvert): Added Location argument.  If the Location argument
17836         is null (Location.Null), then we do not report errors.  This is
17837         used by the `probe' mechanism of the Explicit conversion.  We do
17838         not want to generate an error for something that the user
17839         explicitly requested to be casted.  But the pipeline for an
17840         explicit cast first tests for potential implicit casts.
17841
17842         So for now, if the Location is null, it means `Probe only' to
17843         avoid adding another argument.   Might have to revise this
17844         strategy later.
17845
17846         (ClassCast): New class used to type cast objects into arbitrary
17847         classes (used in Explicit Reference Conversions).
17848
17849         Implement `as' as well.
17850
17851         Reverted all the patches from Ravi below: they were broken:
17852
17853                 * The use of `level' as a mechanism to stop recursive
17854                   invocations is wrong.  That was there just to catch the
17855                   bug with a strack trace but not as a way of addressing
17856                   the problem.
17857
17858                   To fix the problem we have to *understand* what is going
17859                   on and the interactions and come up with a plan, not
17860                   just get things going.
17861
17862                 * The use of the type conversion cache that I proposed
17863                   last night had an open topic: How does this work across
17864                   protection domains.  A user defined conversion might not
17865                   be public in the location where we are applying the
17866                   conversion, a different conversion might be selected
17867                   (ie, private A->B (better) but public B->A (worse),
17868                   inside A, A->B applies, but outside it, B->A will
17869                   apply).
17870
17871                 * On top of that (ie, even if the above is solved),
17872                   conversions in a cache need to be abstract.  Ie, `To
17873                   convert from an Int to a Short use an OpcodeCast', not
17874                   `To convert from an Int to a Short use the OpcodeCast on
17875                   the variable 5' (which is what this patch was doing).
17876
17877 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17878
17879         * expression.cs (Invocation::ConversionExists): Re-write to use
17880         the conversion cache
17881
17882         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17883         cache all conversions done, not just user-defined ones.
17884
17885         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17886         to determine if a conversion exists instead of acutually trying to 
17887         perform the conversion. It's faster too.
17888
17889         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17890         and only then attempt the implicit conversion.
17891
17892 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17893
17894         * expression.cs (ConvertImplicit): Use a cache for conversions
17895         already found. Check level of recursion and bail out if necessary.
17896
17897 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17898
17899         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17900         Export standard methods that we expect for string operations.
17901
17902         * statement.cs (Block::UsageWarning): Track usage of variables and
17903         report the errors for not used variables.
17904
17905         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17906         operator. 
17907
17908 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17909
17910         * codegen.cs: remove unnneded code 
17911
17912         * expression.cs: Removed BuiltinTypeAccess class
17913
17914         Fix the order in which implicit conversions are
17915         done.  
17916
17917         The previous fixed dropped support for boxed conversions (adding a
17918         test to the test suite now)
17919
17920         (UserImplicitCast::CanConvert): Remove test for source being null,
17921         that code is broken.  We should not feed a null to begin with, if
17922         we do, then we should track the bug where the problem originates
17923         and not try to cover it up here.
17924
17925         Return a resolved expression of type UserImplicitCast on success
17926         rather than true/false.  Ravi: this is what I was talking about,
17927         the pattern is to use a static method as a "constructor" for
17928         objects. 
17929
17930         Also, do not create arguments until the very last minute,
17931         otherwise we always create the arguments even for lookups that
17932         will never be performed. 
17933
17934         (UserImplicitCast::Resolve): Eliminate, objects of type
17935         UserImplicitCast are born in a fully resolved state. 
17936
17937         * typemanager.cs (InitCoreTypes): Init also value_type
17938         (System.ValueType). 
17939
17940         * expression.cs (Cast::Resolve): First resolve the child expression.
17941
17942         (LValue): Add new method AddressOf to be used by
17943         the `&' operator.  
17944
17945         Change the argument of Store to take an EmitContext instead of an
17946         ILGenerator, because things like FieldExpr need to be able to call
17947         their children expression to generate the instance code. 
17948
17949         (Expression::Error, Expression::Warning): Sugar functions for
17950         reporting errors.
17951
17952         (Expression::MemberLookup): Accept a TypeContainer instead of a
17953         Report as the first argument.
17954
17955         (Expression::ResolvePrimary): Killed.  I still want to improve
17956         this as currently the code is just not right.
17957
17958         (Expression::ResolveMemberAccess): Simplify, but it is still
17959         wrong. 
17960
17961         (Unary::Resolve): Catch errors in AddressOf operators.
17962
17963         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
17964         index to a byte for the short-version, or the compiler will choose
17965         the wrong Emit call, which generates the wrong data.
17966
17967         (ParameterReference::Emit, ::Store): same.
17968
17969         (FieldExpr::AddressOf): Implement.
17970
17971         * typemanager.cs: TypeManager: made public variable instead of
17972         property.
17973
17974         * driver.cs: document --fatal.
17975
17976         * report.cs (ErrorMessage, WarningMessage): new names for the old
17977         Error and Warning classes.
17978
17979         * cs-parser.jay (member_access): Turn built-in access to types
17980         into a normal simplename
17981
17982 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17983
17984         * expression.cs (Invocation::BetterConversion): Fix to cope
17985         with q being null, since this was introducing a bug.
17986
17987         * expression.cs (ConvertImplicit): Do built-in conversions first.
17988
17989 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17990
17991         * expression.cs (UserImplicitCast::Resolve): Fix bug.
17992
17993 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17994
17995         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
17996         I had introduced long ago (what's new ?).
17997
17998         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
17999         the work of all the checking. 
18000         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18001         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18002
18003         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18004         that is the right way. 
18005
18006         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18007         overloading resolution. Use everywhere instead of cutting and pasting code.
18008
18009         (Binary::ResolveOperator): Use MakeUnionSet.
18010
18011         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18012         we have to convert to bool types. Not complete yet.
18013
18014 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18015
18016         * typemanager.cs (TypeManager::CSharpName): support ushort.
18017
18018         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18019         to provide an expression that performsn an implicit constant int
18020         conversion (section 6.1.6).
18021         (Expression::ConvertImplicitRequired): Reworked to include
18022         implicit constant expression conversions.
18023
18024         (Expression::ConvertNumericExplicit): Finished.
18025
18026         (Invocation::Emit): If InstanceExpression is null, then it means
18027         that we perform a call on this.
18028
18029 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18030
18031         * expression.cs (Unary::Emit): Remove some dead code.
18032         (Probe): Implement Resolve and Emit for `is'.
18033         (Expression::ConvertImplicitRequired): Attempt to do constant
18034         expression conversions here.  Maybe should be moved to
18035         ConvertImplicit, but I am not sure.
18036         (Expression::ImplicitLongConstantConversionPossible,
18037         Expression::ImplicitIntConstantConversionPossible): New functions
18038         that tell whether is it possible to apply an implicit constant
18039         expression conversion.
18040
18041         (ConvertNumericExplicit): Started work on explicit numeric
18042         conversions.
18043
18044         * cs-parser.jay: Update operator constants.
18045
18046         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18047         (Parameters::GetSignature): Hook up VerifyArgs here.
18048         (Parameters::VerifyArgs): Verifies that no two arguments have the
18049         same name. 
18050
18051         * class.cs (Operator): Update the operator names to reflect the
18052         ones that the spec expects (as we are just stringizing the
18053         operator names).
18054
18055         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18056         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18057         previous usage did only work for our methods.
18058         (Expression::ConvertImplicit): Handle decimal implicit numeric
18059         conversions as well.
18060         (Expression::InternalTypeConstructor): Used to invoke constructors
18061         on internal types for default promotions.
18062
18063         (Unary::Emit): Implement special handling for the pre/post
18064         increment/decrement for overloaded operators, as they need to have
18065         the same semantics as the other operators.
18066
18067         (Binary::ResolveOperator): ditto.
18068         (Invocation::ConversionExists): ditto.
18069         (UserImplicitCast::Resolve): ditto.
18070
18071 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18072
18073         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18074         operator, return after emitting body. Regression tests pass again !
18075
18076         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18077         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18078         (Invocation::OverloadResolve): Ditto.
18079         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18080
18081         * everywhere : update calls to the above methods accordingly.
18082
18083 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18084
18085         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18086
18087         * expression.cs (ExpressionStatement): New base class used for
18088         expressions that can appear in statements, so that we can provide
18089         an alternate path to generate expression that do not leave a value
18090         on the stack.
18091
18092         (Expression::Emit, and all the derivatives): We no longer return
18093         whether a value is left on the stack or not.  Every expression
18094         after being emitted leaves a single value on the stack.
18095
18096         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18097         facilties of ExpressionStatement if possible.
18098
18099         * cs-parser.jay: Update statement_expression.
18100
18101 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * driver.cs: Change the wording of message
18104
18105 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18106
18107         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18108         the type of the expression to the return type of the method if
18109         we have an overloaded operator match ! The regression tests pass again !
18110         (Unary::ResolveOperator): Ditto.
18111
18112         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18113         to find "op_Implicit", not "implicit" ;-)
18114         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18115         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18116
18117         * everywhere : Correct calls to the above accordingly.
18118
18119         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18120         (ConvertImplicit): Do user-defined conversion if it exists.
18121
18122 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18123
18124         * assign.cs: track location.
18125         (Resolve): Use implicit conversions on assignment.
18126
18127         * literal.cs: Oops.  Not good, Emit of short access values should
18128         pass (Bytes) or the wrong argument will be selected.
18129
18130         * expression.cs (Unary::Emit): Emit code for -expr.
18131
18132         (Unary::ResolveOperator): Handle `Substract' for non-constants
18133         (substract from zero from the non-constants).
18134         Deal with Doubles as well. 
18135
18136         (Expression::ConvertImplicitRequired): New routine that reports an
18137         error if no implicit conversion exists. 
18138
18139         (Invocation::OverloadResolve): Store the converted implicit
18140         expressions if we make them
18141
18142 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18143
18144         * class.cs (ConstructorInitializer): Take a Location argument.
18145         (ConstructorBaseInitializer): Same here.
18146         (ConstructorThisInitializer): Same here.
18147
18148         * cs-parser.jay : Update all calls accordingly.
18149
18150         * expression.cs (Unary, Binary, New): Take location argument.
18151         Update accordingly everywhere.
18152
18153         * cs-parser.jay : Update all calls to the above to take a location
18154         argument.
18155
18156         * class.cs : Ditto.
18157
18158 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18159
18160         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18161         (Invocation::BetterConversion): Same here
18162         (Invocation::ConversionExists): Ditto.
18163
18164         (Invocation::ConversionExists): Implement.
18165
18166 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18167
18168         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18169         Also take an additional TypeContainer argument.
18170
18171         * All over : Pass in TypeContainer as argument to OverloadResolve.
18172
18173         * typemanager.cs (CSharpName): Update to check for the string type and return
18174         that too.
18175
18176         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18177         a given method.
18178
18179 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18180
18181         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18182         (Invocation::BetterFunction): Implement.
18183         (Invocation::BetterConversion): Implement.
18184         (Invocation::ConversionExists): Skeleton, no implementation yet.
18185
18186         Okay, things work fine !
18187
18188 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * typemanager.cs: declare and load enum_type, delegate_type and
18191         void_type. 
18192
18193         * expression.cs (Expression::Emit): Now emit returns a value that
18194         tells whether a value is left on the stack or not.  This strategy
18195         might be reveted tomorrow with a mechanism that would address
18196         multiple assignments.
18197         (Expression::report118): Utility routine to report mismatches on
18198         the ExprClass.
18199
18200         (Unary::Report23): Report impossible type/operator combination
18201         utility function.
18202
18203         (Unary::IsIncrementableNumber): Whether the type can be
18204         incremented or decremented with add.
18205         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18206         complemented. 
18207         (Unary::ResolveOperator): Implement ++, !, ~,
18208
18209         (Invocation::Emit): Deal with new Emit convetion.
18210
18211         * All Expression derivatives: Updated their Emit method to return
18212         whether they leave values on the stack or not.
18213
18214         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18215         stack for expressions that are statements. 
18216
18217 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * expression.cs (LValue): New interface.  Must be implemented by
18220         LValue objects.
18221         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18222         LValue interface.
18223
18224         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18225         interface for generating code, simplifies the code.
18226
18227 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18228
18229         * expression.cs (everywhere): Comment out return statements in ::Resolve
18230         methods to avoid the warnings.
18231
18232 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * driver.cs (parse): Report error 2001 if we can not open the
18235         source file.
18236
18237         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18238         not resolve it.
18239
18240         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18241         object. 
18242
18243         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18244         otherwise nested blocks end up with the same index.
18245
18246         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18247
18248         * expression.cs:  Instead of having FIXMEs in the Resolve
18249         functions, throw exceptions so it is obvious that we are facing a
18250         bug. 
18251
18252         * cs-parser.jay (invocation_expression): Pass Location information.
18253
18254         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18255         Use a basename for those routines because .NET does not like paths
18256         on them. 
18257
18258         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18259         already defined.
18260
18261 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18264         are loading the correct data types (throws an exception if not).
18265         (TypeManager::InitCoreTypes): Use CoreLookupType
18266
18267         * expression.cs (Unary::ResolveOperator): return the child
18268         expression for expressions which are just +expr.
18269         (Unary::ResolveOperator): Return negative literals for -LITERAL
18270         expressions (otherwise they are Unary {Literal}).
18271         (Invocation::Badness): Take into account `Implicit constant
18272         expression conversions'.
18273
18274         * literal.cs (LongLiteral): Implement long literal class.
18275         (IntLiteral): export the `Value' of the intliteral. 
18276
18277 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18278
18279         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18280
18281         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18282         instead of 'Operator'
18283
18284         * expression.cs (Binary::ResolveOperator): Update accordingly.
18285         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18286         and 'Minus'
18287
18288         * cs-parser.jay (unary_expression): Update to use the new names.
18289
18290         * gen-treedump.cs (GetUnary): Same here.
18291
18292         * expression.cs (Unary::Resolve): Implement.
18293         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18294         operators are found instead of making noise ;-)
18295         (Unary::ResolveOperator): New method to do precisely the same thing which
18296         Binary::ResolveOperator does for Binary expressions.
18297         (Unary.method, .Arguments): Add.
18298         (Unary::OperName): Implement.   
18299         (Unary::ForceConversion): Copy and Paste !
18300
18301         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18302         a unary operator.
18303
18304         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18305         for the inbuilt operators. Only overloading works for now ;-)
18306
18307 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18310         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18311
18312         * expression.cs (This::Emit): Implement. 
18313         (This::Resolve): Implement.
18314         (TypeOf:Resolve): Implement.
18315         (Expression::ResolveSimpleName): Add an implicit this to instance
18316         field references. 
18317         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18318         Bind instance variable to Field expressions.
18319         (FieldExpr::Instance): New field used to track the expression that
18320         represents the object instance.
18321         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18322         binding 
18323         (FieldExpr::Emit): Implement.
18324
18325         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18326         the last instruction contains a return opcode to avoid generating
18327         the last `ret' instruction (this generates correct code, and it is
18328         nice to pass the peverify output).
18329
18330         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18331         initializer for static and instance variables.
18332         (Constructor::Emit): Allow initializer to be null in the case of
18333         static constructors.  Only emit initializer for instance
18334         constructors. 
18335
18336         (TypeContainer::FindMembers): Return a null array if there are no
18337         matches.
18338
18339         Also fix the code for the MemberTypes.Method branch, as it was not
18340         scanning that for operators (or tried to access null variables before).
18341
18342         * assign.cs (Assign::Emit): Handle instance and static fields. 
18343
18344         * TODO: Updated.
18345
18346         * driver.cs: Stop compilation if there are parse errors.
18347
18348         * cs-parser.jay (constructor_declaration): Provide default base
18349         initializer for non-static constructors.
18350         (constructor_declarator): Do not provide a default base
18351         initializers if none was specified.
18352         Catch the fact that constructors should not have parameters.
18353
18354         * class.cs: Do not emit parent class initializers for static
18355         constructors, that should be flagged as an error.
18356
18357 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18358
18359         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18360         Move back code into TypeContainer::Populate.
18361
18362 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18363
18364         * class.cs (TypeContainer::AddConstructor): Fix the check to
18365         compare against Name, not Basename. 
18366         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18367
18368         * cs-parser.jay : Update accordingly.
18369
18370         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18371         for methods, don't forget to look into the operators too.
18372         (RegisterMethodBuilder): Helper method to take care of this for
18373         methods, constructors and operators.
18374         (Operator::Define): Completely revamp.
18375         (Operator.OperatorMethod, MethodName): New fields.
18376         (TypeContainer::Populate): Move the registering of builders into
18377         RegisterMethodBuilder.
18378         (Operator::Emit): Re-write.
18379
18380         * expression.cs (Binary::Emit): Comment out code path to emit method
18381         invocation stuff for the case when we have a user defined operator. I am
18382         just not able to get it right !
18383
18384 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18385
18386         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18387         argument. 
18388
18389         (Expression::MemberLookup): Provide a version that allows to
18390         specify the MemberTypes and BindingFlags. 
18391
18392         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18393         so it was not fetching variable information from outer blocks.
18394
18395         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18396         Beforefieldinit as it was buggy.
18397
18398         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18399         that Ravi put here.  
18400
18401         * class.cs (Constructor::Emit): Only emit if block is not null.
18402         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18403         deal with this by semantically definining it as if the user had
18404         done it.
18405
18406         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18407         constructors as we now "emit" them at a higher level.
18408
18409         (TypeContainer::DefineDefaultConstructor): Used to define the
18410         default constructors if none was provided.
18411
18412         (ConstructorInitializer): Add methods Resolve and Emit. 
18413
18414         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18415
18416 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18417
18418         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18419         the default constructor builder with our hashtable for methodbuilders
18420         to methodcores.
18421
18422         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18423         and argument_count is 0 in which case we have a match.
18424         (Binary::ResolveOperator): More null checking and miscellaneous coding
18425         style cleanup.
18426
18427 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18428
18429         * rootcontext.cs (IsNameSpace): Compare against null.
18430
18431         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18432
18433         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18434         and Unary::Operator.
18435
18436         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18437         accordingly.
18438
18439         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18440         we have overloaded operators.
18441         (Binary::ResolveOperator): Implement the part which does the operator overload
18442         resolution.
18443
18444         * class.cs (Operator::Emit): Implement.
18445         (TypeContainer::Emit): Emit the operators we have too.
18446
18447         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18448         the case when we have a user-defined operator.
18449
18450 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18453
18454 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18455
18456         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18457         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18458         (Constructor::Emit): Implement.
18459         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18460         if we have no work to do. 
18461         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18462         Emit method.
18463
18464         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18465         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18466
18467         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18468         of parent.parent.
18469
18470 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18471
18472         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18473         in the source.
18474         (Tree::RecordNamespace): Method to do what the name says ;-)
18475         (Tree::Namespaces): Property to get at the namespaces hashtable.
18476
18477         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18478         keep track.
18479
18480         * rootcontext.cs (IsNamespace): Fixed it :-)
18481
18482 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18483
18484         * class.cs (TypeContainer::FindMembers): Add support for
18485         constructors. 
18486         (MethodCore): New class that encapsulates both the shared aspects
18487         of a Constructor and a Method.  
18488         (Method, Constructor): Factored pieces into MethodCore.
18489
18490         * driver.cs: Added --fatal which makes errors throw exceptions.
18491         Load System assembly as well as part of the standard library.
18492
18493         * report.cs: Allow throwing exceptions on errors for debugging.
18494
18495         * modifiers.cs: Do not use `parent', instead use the real type
18496         container to evaluate permission settings.
18497
18498         * class.cs: Put Ravi's patch back in.  He is right, and we will
18499         have to cope with the
18500
18501 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18502
18503         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18504         FamORAssem, not FamANDAssem.
18505
18506 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18507
18508         * driver.cs: Added --parse option that only parses its input files
18509         and terminates.
18510
18511         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18512         incorrect.  IsTopLevel is not used to tell whether an object is
18513         root_types or not (that can be achieved by testing this ==
18514         root_types).  But to see if this is a top-level *class* (not
18515         necessarly our "toplevel" container). 
18516
18517 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18518
18519         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18520         parent instead of a direct call to GetType.
18521
18522 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18523
18524         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18525         Modifiers.TypeAttr. This should just be a call to that method.
18526
18527         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18528         object so that we can determine if we are top-level or not.
18529
18530         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18531         TypeContainer too.
18532
18533         * enum.cs (Enum::Define): Ditto.
18534
18535         * modifiers.cs (FieldAttr): Re-write.
18536
18537         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18538         (TypeContainer::HaveStaticConstructor): New property to provide access
18539         to precisely that info.
18540
18541         * modifiers.cs (MethodAttr): Re-write.
18542         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18543
18544         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18545         of top-level types as claimed.
18546
18547 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * expression.cs (MemberLookup): Fruitless attempt to lookup
18550         constructors.  Maybe I need to emit default constructors?  That
18551         might be it (currently .NET emits this for me automatically).
18552         (Invocation::OverloadResolve): Cope with Arguments == null.
18553         (Invocation::EmitArguments): new function, shared by the new
18554         constructor and us.
18555         (Invocation::Emit): Handle static and instance methods.  Emit
18556         proper call instruction for virtual or non-virtual invocations.
18557         (New::Emit): Implement.
18558         (New::Resolve): Implement.
18559         (MemberAccess:Resolve): Implement.
18560         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18561         to track instances.
18562         (FieldExpr::Resolve): Set type.
18563
18564         * support.cs: Handle empty arguments.
18565                 
18566         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18567         SimpleLookup): Auxiliary routines to help parse a qualifier
18568         identifier.  
18569
18570         Update qualifier_identifier rule.
18571
18572         * codegen.cs: Removed debugging messages.
18573
18574         * class.cs: Make this a global thing, this acts just as a "key" to
18575         objects that we might have around.
18576
18577         (Populate): Only initialize method_builders_to_methods once.
18578
18579         * expression.cs (PropertyExpr): Initialize type from the
18580         PropertyType. 
18581
18582         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18583         Resolve pattern.  Attempt to implicitly convert value to boolean.
18584         Emit code.
18585
18586         * expression.cs: Set the type for the int32/int32 argument case.
18587         (Binary::ResolveOperator): Set the return type to boolean for
18588         comparission operators
18589
18590         * typemanager.cs: Remove debugging print code.
18591
18592         (Invocation::Resolve): resolve type.
18593
18594         * class.cs: Allocate a MemberInfo of the correct size, as the code
18595         elsewhere depends on the test to reflect the correct contents.
18596
18597         (Method::) Keep track of parameters, due to System.Reflection holes
18598
18599         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18600         mapping here.
18601
18602         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18603         of the exact size and return that.
18604
18605         (Class::LookupMethodByBuilder): New function that maps
18606         MethodBuilders to its methods.  Required to locate the information
18607         on methods because System.Reflection bit us again.
18608
18609         * support.cs: New file, contains an interface ParameterData and
18610         two implementations: ReflectionParameters and InternalParameters
18611         used to access Parameter information.  We will need to grow this
18612         as required.
18613
18614         * expression.cs (Invocation::GetParameterData): implement a cache
18615         and a wrapper around the ParameterData creation for methods. 
18616         (Invocation::OverloadResolve): Use new code.
18617
18618 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18619
18620         * class.cs (TypeContainer::EmitField): Remove and move into 
18621         (Field::Define): here and modify accordingly.
18622         (Field.FieldBuilder): New member.
18623         (TypeContainer::Populate): Update accordingly.
18624         (TypeContainer::FindMembers): Implement.
18625
18626 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * statement.cs: (VariableInfo::VariableType): New field to be
18629         initialized with the full type once it is resolved. 
18630
18631 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * parameter.cs (GetParameterInfo): Use a type cache to compute
18634         things only once, and to reuse this information
18635
18636         * expression.cs (LocalVariableReference::Emit): Implement.
18637         (OpcodeCast::Emit): fix.
18638
18639         (ParameterReference::Resolve): Implement.
18640         (ParameterReference::Emit): Implement.
18641
18642         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18643         that are expressions need to stay as Expressions.
18644
18645         * typemanager.cs (CSharpName): Returns the C# name of a type if
18646         possible. 
18647
18648         * expression.cs (Expression::ConvertImplicit): New function that
18649         implements implicit type conversions.
18650
18651         (Expression::ImplicitReferenceConversion): Implements implicit
18652         reference conversions.
18653
18654         (EmptyCast): New type for transparent casts.
18655
18656         (OpcodeCast): New type for casts of types that are performed with
18657         a sequence of bytecodes.
18658
18659         (BoxedCast): New type used for casting value types into reference
18660         types.  Emits a box opcode.
18661
18662         (Binary::DoNumericPromotions): Implements numeric promotions of
18663         and computation of the Binary::Type.
18664
18665         (Binary::EmitBranchable): Optimization.
18666
18667         (Binary::Emit): Implement code emission for expressions.
18668
18669         * typemanager.cs (TypeManager): Added two new core types: sbyte
18670         and byte.
18671
18672 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18673
18674         * class.cs (TypeContainer::FindMembers): Method which does exactly
18675         what Type.FindMembers does, only we don't have to use reflection. No
18676         implementation yet.
18677
18678         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18679         typecontainer objects as we need to get at them.
18680         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18681
18682         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18683         typecontainer object.
18684
18685         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18686         of just a Report object.
18687
18688 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18689
18690         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18691         "remove_"
18692         (TypeContainer::Populate): Now define the delegates of the type too.
18693         (TypeContainer.Delegates): Property to access the list of delegates defined
18694         in the type.
18695
18696         * delegates.cs (Delegate::Define): Implement partially.
18697
18698         * modifiers.cs (TypeAttr): Handle more flags.
18699
18700 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18701
18702         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18703         and not <=
18704         (Operator::Define): Re-write logic to get types by using the LookupType method
18705         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18706         (Indexer::Define): Ditto.
18707         (Event::Define): Ditto.
18708         (Property::Define): Ditto.
18709
18710 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18711
18712         * class.cs (TypeContainer::Populate): Now define operators too. 
18713         (TypeContainer.Operators): New property to access the list of operators
18714         in a type.
18715         (Operator.OperatorMethodBuilder): New member to hold the method builder
18716         for the operator we are defining.
18717         (Operator::Define): Implement.
18718
18719 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18720
18721         * class.cs (Event::Define): Make the prefixes of the accessor methods
18722         addOn_ and removeOn_ 
18723
18724         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18725         of the location being passed in too. Ideally, this should go later since all
18726         error reporting should be done through the Report object.
18727
18728         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18729         (Populate): Iterate thru the indexers we have and define them too.
18730         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18731         for the get and set accessors.
18732         (Indexer::Define): Implement.
18733
18734 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18735
18736         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18737         my previous implementation, did not work.
18738
18739         * typemanager.cs: Add a couple of missing types (the longs).
18740
18741         * literal.cs: Use TypeManager.bool_type instead of getting it.
18742
18743         * expression.cs (EventExpr): New kind of expressions.
18744         (Expressio::ExprClassFromMemberInfo): finish
18745
18746 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18747
18748         * assign.cs: Emit stores to static fields differently.
18749
18750 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18751
18752         * Merge in changes and adjust code to tackle conflicts. Backed out my
18753         code in Assign::Resolve ;-) 
18754
18755 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18756
18757         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18758         instead Report.Error and also pass in the location.
18759         (CSharpParser::Lexer): New readonly property to return the reference
18760         to the Tokenizer object.
18761         (declare_local_variables): Use Report.Error with location instead of plain 
18762         old error.
18763         (CheckDef): Ditto.
18764
18765         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18766         (Operator.CheckBinaryOperator): Ditto.
18767
18768         * cs-parser.jay (operator_declarator): Update accordingly.
18769
18770         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18771         (CheckBinaryOperator): Same here.
18772
18773         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18774         on the name without any prefixes of namespace names etc. This is because we
18775         already might have something already fully qualified like 
18776         'System.Console.WriteLine'
18777
18778         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18779
18780 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18781
18782         * cs-tokenizer.cs (location): Return a string which also contains
18783         the file name.
18784
18785         * expression.cs (ElementAccess): New class for expressions of the
18786         type 'element access.'
18787         (BaseAccess): New class for expressions of the type 'base access.'
18788         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18789         respectively.
18790
18791         * cs-parser.jay (element_access): Implement action.
18792         (base_access): Implement actions.
18793         (checked_expression, unchecked_expression): Implement.
18794
18795         * cs-parser.jay (local_variable_type): Correct and implement.
18796         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18797
18798         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18799
18800         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18801         name and the specifiers.
18802
18803         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18804
18805         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18806         making them all public ;-)
18807
18808         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18809         class anyways.
18810
18811 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18812
18813         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18814         PropertyExprs.
18815         (FieldExpr, PropertyExprs): New resolved expressions.
18816         (SimpleName::MemberStaticCheck): Perform static checks for access
18817         to non-static fields on static methods. Maybe this should be
18818         generalized for MemberAccesses. 
18819         (SimpleName::ResolveSimpleName): More work on simple name
18820         resolution. 
18821
18822         * cs-parser.jay (primary_expression/qualified_identifier): track
18823         the parameter index.
18824
18825         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18826         (EmitContext::EmitBoolExpression): Chain to expression generation
18827         instead of temporary hack.
18828         (::EmitStatementExpression): Put generic expression code generation.
18829
18830         * assign.cs (Assign::Emit): Implement variable assignments to
18831         local variables, parameters and fields.
18832
18833 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18834
18835         * statement.cs (Block::GetVariableInfo): New method, returns the
18836         VariableInfo for a variable name in a block.
18837         (Block::GetVariableType): Implement in terms of GetVariableInfo
18838
18839         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18840         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18841
18842 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18843
18844         * cs-parser.jay (operator_declaration): Continue on my quest : update
18845         to take attributes argument.
18846         (event_declaration): Ditto.
18847         (enum_declaration): Ditto.
18848         (indexer_declaration): Ditto.
18849
18850         * class.cs (Operator::Operator): Update constructor accordingly.
18851         (Event::Event): Ditto.
18852
18853         * delegate.cs (Delegate::Delegate): Same here.
18854
18855         * enum.cs (Enum::Enum): Same here.
18856
18857 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18858
18859         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18860
18861         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18862
18863         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18864         being passed around as an arraylist.
18865         (Attributes::AddAttribute): Method to add attribute sections.
18866
18867         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18868         (struct_declaration): Update accordingly.
18869         (constant_declaration): Update.
18870         (field_declaration): Update.
18871         (method_header): Update.
18872         (fixed_parameter): Update.
18873         (parameter_array): Ditto.
18874         (property_declaration): Ditto.
18875         (destructor_declaration): Ditto.
18876
18877         * class.cs (Struct::Struct): Update constructors accordingly.
18878         (Class::Class): Ditto.
18879         (Field::Field): Ditto.
18880         (Method::Method): Ditto.
18881         (Property::Property): Ditto.
18882         (TypeContainer::OptAttribute): update property's return type.
18883
18884         * interface.cs (Interface.opt_attributes): New member.
18885         (Interface::Interface): Update to take the extra Attributes argument.
18886
18887         * parameter.cs (Parameter::Parameter): Ditto.
18888
18889         * constant.cs (Constant::Constant): Ditto.
18890
18891         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18892         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18893         the attributes as a parameter.
18894         (InterfaceProperty): Update constructor call.
18895         (InterfaceEvent): Ditto.
18896         (InterfaceMethod): Ditto.
18897         (InterfaceIndexer): Ditto.
18898
18899         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18900         pass the attributes too.
18901         (interface_event_declaration): Ditto.
18902         (interface_property_declaration): Ditto.
18903         (interface_method_declaration): Ditto.
18904         (interface_declaration): Ditto.
18905
18906 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * class.cs (Method::Define): Track the "static Main" definition to
18909         create an entry point. 
18910
18911         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18912         EntryPoint if we find it. 
18913
18914         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18915         (EmitContext::ig): Make this variable public.
18916
18917         * driver.cs: Make the default output file be the first file name
18918         with the .exe extension.  
18919
18920         Detect empty compilations
18921
18922         Handle various kinds of output targets.  Handle --target and
18923         rename -t to --dumper.
18924
18925         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18926         methods inherited from Expression return now an Expression.  This
18927         will is used during the tree rewriting as we resolve them during
18928         semantic analysis.
18929
18930         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18931         the spec.  Missing entirely is the information about
18932         accessability of elements of it.
18933
18934         (Expression::ExprClassFromMemberInfo): New constructor for
18935         Expressions that creates a fully initialized Expression based on
18936         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18937         a Type.
18938
18939         (Invocation::Resolve): Begin implementing resolution of invocations.
18940
18941         * literal.cs (StringLiteral):  Implement Emit.
18942
18943 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18944
18945         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18946         member.
18947
18948 2001-09-04  Ravi Pratap  <ravi@ximian.com>
18949
18950         * cs-parser.jay (attribute_arguments): Implement actions.
18951         (attribute): Fix bug in production. Implement action.
18952         (attribute_list): Implement.
18953         (attribute_target): Implement.
18954         (attribute_target_specifier, opt_target_specifier): Implement
18955         (CheckAttributeTarget): New method to check if the attribute target
18956         is valid.
18957         (attribute_section): Implement.
18958         (opt_attributes): Implement.
18959
18960         * attribute.cs : New file to handle attributes.
18961         (Attribute): Class to hold attribute info.
18962
18963         * cs-parser.jay (opt_attribute_target_specifier): Remove production
18964         (attribute_section): Modify production to use 2 different rules to 
18965         achieve the same thing. 1 s/r conflict down !
18966         Clean out commented, useless, non-reducing dimension_separator rules.
18967
18968         * class.cs (TypeContainer.attributes): New member to hold list
18969         of attributes for a type.
18970         (Struct::Struct): Modify to take one more argument, the attribute list.
18971         (Class::Class): Ditto.
18972         (Field::Field): Ditto.
18973         (Method::Method): Ditto.
18974         (Property::Property): Ditto.
18975
18976         * cs-parser.jay (struct_declaration): Update constructor call to
18977         pass in the attributes too.
18978         (class_declaration): Ditto.
18979         (constant_declaration): Ditto.
18980         (field_declaration): Ditto.
18981         (method_header): Ditto.
18982         (fixed_parameter): Ditto.
18983         (parameter_array): Ditto.
18984         (property_declaration): Ditto.
18985
18986         * constant.cs (Constant::Constant): Update constructor similarly.
18987         Use System.Collections.
18988
18989         * parameter.cs (Parameter::Parameter): Update as above.
18990
18991 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18992
18993         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
18994         (TypeContainer.delegates): New member to hold list of delegates.
18995
18996         * cs-parser.jay (delegate_declaration): Implement the action correctly 
18997         this time as I seem to be on crack ;-)
18998
18999 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19000
19001         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19002         tell whether an identifier represents a namespace.
19003
19004         * expression.cs (NamespaceExpr): A namespace expression, used only
19005         temporarly during expression resolution.
19006         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19007         utility functions to resolve names on expressions.
19008
19009 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19010
19011         * codegen.cs: Add hook for StatementExpressions. 
19012
19013         * class.cs: Fix inverted test for static flag in methods.
19014
19015 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19016
19017         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19018         to make it coincide with MS' number.
19019         (Operator::CheckBinaryOperator): Ditto.
19020
19021         * ../errors/errors.txt : Remove error numbers added earlier.
19022
19023         * ../errors/cs1019.cs : Test case for error # 1019
19024
19025         * ../errros/cs1020.cs : Test case for error # 1020
19026
19027         * cs-parser.jay : Clean out commented cruft.
19028         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19029         used anywhere - non-reducing rule.
19030         (namespace_declarations): Non-reducing rule - comment out.
19031
19032         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19033         with TypeContainer::AddEnum.
19034
19035         * delegate.cs : New file for delegate handling classes.
19036         (Delegate): Class for declaring delegates.
19037
19038         * makefile : Update.
19039
19040         * cs-parser.jay (delegate_declaration): Implement.
19041
19042 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19043
19044         * class.cs (Event::Define): Implement.
19045         (Event.EventBuilder): New member.
19046
19047         * class.cs (TypeContainer::Populate): Update to define all enums and events
19048         we have.
19049         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19050         readonly fields for all these cases ?
19051
19052 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19053
19054         * class.cs (Property): Revamp to use the convention of making fields readonly.
19055         Accordingly modify code elsewhere.
19056
19057         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19058         the Define method of the Property class.
19059
19060         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19061         trivial bug.
19062         (TypeContainer::Populate): Update to define all the properties we have. Also
19063         define all enumerations.
19064
19065         * enum.cs (Define): Implement.
19066
19067 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19068
19069         * cs-parser.jay (overloadable_operator): The semantic value is an
19070         enum of the Operator class.
19071         (operator_declarator): Implement actions.
19072         (operator_declaration): Implement.
19073
19074         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19075         validity of definitions.
19076         (Operator::CheckBinaryOperator): Static method to check for binary operators
19077         (TypeContainer::AddOperator): New method to add an operator to a type.
19078
19079         * cs-parser.jay (indexer_declaration): Added line to actually call the
19080         AddIndexer method so it gets added ;-)
19081
19082         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19083         already taken care of by the MS compiler ?  
19084
19085 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19086
19087         * class.cs (Operator): New class for operator declarations.
19088         (Operator::OpType): Enum for the various operators.
19089
19090 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19091
19092         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19093         ostensibly handle this in semantic analysis.
19094
19095         * cs-parser.jay (general_catch_clause): Comment out
19096         (specific_catch_clauses, specific_catch_clause): Ditto.
19097         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19098         (catch_args, opt_catch_args): New productions.
19099         (catch_clause): Rewrite to use the new productions above
19100         (catch_clauses): Modify accordingly.
19101         (opt_catch_clauses): New production to use in try_statement
19102         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19103         and re-write the code in the actions to extract the specific and
19104         general catch clauses by being a little smart ;-)
19105
19106         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19107         Hooray, try and catch statements parse fine !
19108
19109 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19110
19111         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19112         string from the hashtable of variables.
19113
19114         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19115         I end up making that mistake ;-)
19116         (catch_clauses): Fixed gross error which made Key and Value of the 
19117         DictionaryEntry the same : $1 !!
19118
19119 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19120
19121         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19122
19123         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19124         when the add and remove accessors are specified. 
19125
19126 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19127
19128         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19129         information about indexer_declarator.
19130         (indexer_declarator): Implement actions.
19131         (parsing_indexer): New local boolean used to keep track of whether
19132         we are parsing indexers or properties. This is necessary because 
19133         implicit_parameters come into picture even for the get accessor in the 
19134         case of an indexer.
19135         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19136
19137         * class.cs (Indexer): New class for indexer declarations.
19138         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19139         (TypeContainer::indexers): New member to hold list of indexers for the
19140         type.
19141
19142 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19143
19144         * cs-parser.jay (add_accessor_declaration): Implement action.
19145         (remove_accessor_declaration): Implement action.
19146         (event_accessors_declaration): Implement
19147         (variable_declarators): swap statements for first rule - trivial.
19148
19149         * class.cs (Event): New class to hold information about event
19150         declarations.
19151         (TypeContainer::AddEvent): New method to add an event to a type
19152         (TypeContainer::events): New member to hold list of events.
19153
19154         * cs-parser.jay (event_declaration): Implement actions.
19155
19156 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19157
19158         * cs-parser.jay (dim_separators): Implement. Make it a string
19159         concatenating all the commas together, just as they appear.
19160         (opt_dim_separators): Modify accordingly
19161         (rank_specifiers): Update accordingly. Basically do the same
19162         thing - instead, collect the brackets here.
19163         (opt_rank_sepcifiers): Modify accordingly.
19164         (array_type): Modify to actually return the complete type string
19165         instead of ignoring the rank_specifiers.
19166         (expression_list): Implement to collect the expressions
19167         (variable_initializer): Implement. We make it a list of expressions
19168         essentially so that we can handle the array_initializer case neatly too.
19169         (variable_initializer_list): Implement.
19170         (array_initializer): Make it a list of variable_initializers
19171         (opt_array_initializer): Modify accordingly.
19172
19173         * expression.cs (New::NType): Add enumeration to help us
19174         keep track of whether we have an object/delegate creation
19175         or an array creation.
19176         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19177         members to hold data about array creation.
19178         (New:New): Modify to update NewType
19179         (New:New): New Overloaded contructor for the array creation
19180         case.
19181
19182         * cs-parser.jay (array_creation_expression): Implement to call
19183         the overloaded New constructor.
19184
19185 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19186
19187         * class.cs (TypeContainer::Constructors): Return member
19188         constructors instead of returning null.
19189
19190 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19191
19192         * typemanager.cs (InitCoreTypes): Initialize the various core
19193         types after we have populated the type manager with the user
19194         defined types (this distinction will be important later while
19195         compiling corlib.dll)
19196
19197         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19198         on Expression Classification.  Now all expressions have a method
19199         `Resolve' and a method `Emit'.
19200
19201         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19202         generation from working.     Also add some temporary debugging
19203         code. 
19204
19205 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * codegen.cs: Lots of code generation pieces.  This is only the
19208         beginning, will continue tomorrow with more touches of polish.  We
19209         handle the fundamentals of if, while, do, for, return.  Others are
19210         trickier and I need to start working on invocations soon.
19211
19212         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19213         s.InitStatement. 
19214
19215         * codegen.cs (EmitContext): New struct, used during code
19216         emission to keep a context.   Most of the code generation will be
19217         here. 
19218
19219         * cs-parser.jay: Add embedded blocks to the list of statements of
19220         this block.  So code generation proceeds in a top down fashion.
19221
19222 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19223
19224         * statement.cs: Add support for multiple child blocks.
19225
19226 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19227
19228         * codegen.cs (EmitCode): New function, will emit the code for a
19229         Block of code given a TypeContainer and its ILGenerator. 
19230
19231         * statement.cs (Block): Standard public readonly optimization.
19232         (Block::Block constructors): Link children. 
19233         (Block::Child): Child Linker.
19234         (Block::EmitVariables): Emits IL variable declarations.
19235
19236         * class.cs: Drop support for MethodGroups here, delay until
19237         Semantic Analysis.
19238         (Method::): Applied the same simplification that I did before, and
19239         move from Properties to public readonly fields.
19240         (Method::ParameterTypes): Returns the parameter types for the
19241         function, and implements a cache that will be useful later when I
19242         do error checking and the semantic analysis on the methods is
19243         performed.
19244         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19245         and made a method, optional argument tells whether this is a class
19246         or a structure to apply the `has-this' bit.
19247         (Method::GetCallingConvention): Implement, returns the calling
19248         convention. 
19249         (Method::Define): Defines the type, a second pass is performed
19250         later to populate the methods.
19251
19252         (Constructor::ParameterTypes): implement a cache similar to the
19253         one on Method::ParameterTypes, useful later when we do semantic
19254         analysis. 
19255
19256         (TypeContainer::EmitMethod):  New method.  Emits methods.
19257
19258         * expression.cs: Removed MethodGroup class from here.
19259
19260         * parameter.cs (Parameters::GetCallingConvention): new method.
19261
19262 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * class.cs (TypeContainer::Populate): Drop RootContext from the
19265         argument. 
19266
19267         (Constructor::CallingConvention): Returns the calling convention.
19268         (Constructor::ParameterTypes): Returns the constructor parameter
19269         types. 
19270
19271         (TypeContainer::AddConstructor): Keep track of default constructor
19272         and the default static constructor.
19273
19274         (Constructor::) Another class that starts using `public readonly'
19275         instead of properties. 
19276
19277         (Constructor::IsDefault): Whether this is a default constructor. 
19278
19279         (Field::) use readonly public fields instead of properties also.
19280
19281         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19282         track of static constructors;  If none is used, turn on
19283         BeforeFieldInit in the TypeAttributes. 
19284
19285         * cs-parser.jay (opt_argument_list): now the return can be null
19286         for the cases where there are no arguments. 
19287
19288         (constructor_declarator): If there is no implicit `base' or
19289         `this', then invoke the default parent constructor. 
19290
19291         * modifiers.cs (MethodAttr): New static function maps a set of
19292         modifiers flags into a MethodAttributes enum
19293         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19294         MethodAttr, TypeAttr to represent the various mappings where the
19295         modifiers are used.
19296         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19297
19298 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19299
19300         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19301         method arguments.
19302
19303         * interface.cs (PopulateIndexer): Implemented the code generator
19304         for interface indexers.
19305
19306 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * interface.cs (InterfaceMemberBase): Now we track the new status
19309         here.  
19310
19311         (PopulateProperty): Implement property population.  Woohoo!  Got
19312         Methods and Properties going today. 
19313
19314         Removed all the properties for interfaces, and replaced them with
19315         `public readonly' fields. 
19316
19317 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19320         initialize their hashtables/arraylists only when they are needed
19321         instead of doing this always.
19322
19323         * parameter.cs: Handle refs and out parameters.
19324
19325         * cs-parser.jay: Use an ArrayList to construct the arguments
19326         instead of the ParameterCollection, and then cast that to a
19327         Parameter[] array.
19328
19329         * parameter.cs: Drop the use of ParameterCollection and use
19330         instead arrays of Parameters.
19331
19332         (GetParameterInfo): Use the Type, not the Name when resolving
19333         types. 
19334
19335 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19338         and instead use public readonly fields.
19339
19340         * class.cs: Put back walking code for type containers.
19341
19342 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19343
19344         * class.cs (MakeConstant): Code to define constants.
19345
19346         * rootcontext.cs (LookupType): New function.  Used to locate types 
19347
19348
19349 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19350
19351         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19352         this System.Reflection code is.  Kudos to Microsoft
19353
19354         * typemanager.cs: Implement a type cache and avoid loading all
19355         types at boot time.  Wrap in LookupType the internals.  This made
19356         the compiler so much faster.  Wow.  I rule!
19357
19358         * driver.cs: Make sure we always load mscorlib first (for
19359         debugging purposes, nothing really important).
19360
19361         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19362         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19363
19364         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19365         on namespaces that have been imported using the `using' keyword.
19366
19367         * class.cs (TypeContainer::TypeAttr): Virtualize.
19368         (Class::TypeAttr): Return attributes suitable for this bad boy.
19369         (Struct::TypeAttr): ditto.
19370         Handle nested classes.
19371         (TypeContainer::) Remove all the type visiting code, it is now
19372         replaced with the rootcontext.cs code
19373
19374         * rootcontext.cs (GetClassBases): Added support for structs. 
19375
19376 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19377
19378         * interface.cs, statement.cs, class.cs, parameter.cs,
19379         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19380         Drop use of TypeRefs, and use strings instead.
19381
19382 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19383
19384         * rootcontext.cs: 
19385
19386         * class.cs (Struct::Struct): set the SEALED flags after
19387         checking the modifiers.
19388         (TypeContainer::TypeAttr): new property, returns the
19389         TypeAttributes for a class.  
19390
19391         * cs-parser.jay (type_list): Oops, list production was creating a
19392         new list of base types.
19393
19394         * rootcontext.cs (StdLib): New property.
19395         (GetInterfaceTypeByName): returns an interface by type name, and
19396         encapsulates error handling here.
19397         (GetInterfaces): simplified.
19398         (ResolveTree): Encapsulated all the tree resolution here.
19399         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19400         types. 
19401
19402         * driver.cs: Add support for --nostdlib, to avoid loading the
19403         default assemblies.
19404         (Main): Do not put tree resolution here. 
19405
19406         * rootcontext.cs: Beginning of the class resolution.
19407
19408 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * rootcontext.cs: Provide better error reporting. 
19411
19412         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19413
19414         * rootcontext.cs (CreateInterface): Handle the case where there
19415         are no parent interfaces.
19416
19417         (CloseTypes): Routine to flush types at the end.
19418         (CreateInterface): Track types.
19419         (GetInterfaces): Returns an array of Types from the list of
19420         defined interfaces.
19421
19422         * typemanager.c (AddUserType): Mechanism to track user types (puts
19423         the type on the global type hash, and allows us to close it at the
19424         end). 
19425
19426 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19429         RecordInterface instead.
19430
19431         * cs-parser.jay: Updated to reflect changes above.
19432
19433         * decl.cs (Definition): Keep track of the TypeBuilder type that
19434         represents this type here.  Not sure we will use it in the long
19435         run, but wont hurt for now.
19436
19437         * driver.cs: Smaller changes to accomodate the new code.
19438
19439         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19440         when done. 
19441
19442         * rootcontext.cs (CreateInterface):  New method, used to create
19443         the System.TypeBuilder type for interfaces.
19444         (ResolveInterfaces): new entry point to resolve the interface
19445         hierarchy. 
19446         (CodeGen): Property, used to keep track of the code generator.
19447
19448 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19449
19450         * cs-parser.jay: Add a second production for delegate_declaration
19451         with `VOID'.
19452
19453         (enum_body): Put an opt_comma here instead of putting it on
19454         enum_body or enum_member_declarations so we can handle trailing
19455         commas on enumeration members.  Gets rid of a shift/reduce.
19456
19457         (type_list): Need a COMMA in the middle.
19458
19459         (indexer_declaration): Tell tokenizer to recognize get/set
19460
19461         * Remove old targets.
19462
19463         * Re-add the parser target.
19464
19465 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19466
19467         * cs-parser.jay: Add precendence rules for a number of operators
19468         ot reduce the number of shift/reduce conflicts in the grammar.
19469
19470 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19471
19472         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19473         and put it here.
19474
19475         Get rid of old crufty code.
19476
19477         * rootcontext.cs: Use this to keep track of the parsed
19478         representation and the defined types available to the program. 
19479
19480         * gen-treedump.cs: adjust for new convention.
19481
19482         * type.cs: Split out the type manager, and the assembly builder
19483         from here. 
19484
19485         * typemanager.cs: the type manager will live here now.
19486
19487         * cil-codegen.cs: And the code generator here. 
19488
19489 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19490
19491         * makefile: Fixed up for easy making.
19492
19493 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19494
19495         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19496         the 
19497
19498         (unary_expression): Expand pre_increment_expression and
19499         post_decrement_expression to reduce a shift/reduce.
19500
19501 2001-07-11  Simon Cozens
19502
19503         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19504
19505         Improve allow_keyword_as_indent name.
19506
19507 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19508
19509         * Adjustments for Beta2. 
19510
19511 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19512
19513         * decl.cs: Added `Define' abstract method.
19514         (InTransit): new property, used to catch recursive definitions. 
19515
19516         * interface.cs: Implement `Define'. 
19517
19518         * modifiers.cs: Map Modifiers.constants to
19519         System.Reflection.TypeAttribute flags.
19520
19521         * class.cs: Keep track of types and user-defined types.
19522         (BuilderInit): New method for creating an assembly
19523         (ResolveType): New function to launch the resolution process, only
19524         used by interfaces for now.
19525
19526         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19527         that are inserted into the name space. 
19528
19529 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19530
19531         * ARGH.  I have screwed up my tree so many times due to the use of
19532         rsync rather than using CVS.  Going to fix this at once. 
19533
19534         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19535         load types.
19536
19537 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * Experiment successful: Use System.Type rather that our own
19540         version of Type.  
19541
19542 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * cs-parser.jay: Removed nsAliases from here.
19545
19546         Use new namespaces, handle `using XXX;' 
19547
19548         * namespace.cs: Reimplemented namespace handling, use a recursive
19549         definition of the class.  Now we can keep track of using clauses
19550         and catch invalid using clauses.
19551
19552 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * gen-treedump.cs: Adapted for all the renaming.
19555
19556         * expression.cs (Expression): this class now has a Type property
19557         which returns an expression Type.
19558
19559         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19560         `Type', as this has a different meaning now in the base
19561
19562 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19563
19564         * interface.cs, class.cs: Removed from all the sources the
19565         references to signature computation, as we can not do method
19566         signature computation during the parsing time, as we are not
19567         trying to solve at that point distinguishing:
19568
19569         class X {
19570                 void a (Blah x) {}
19571                 void a (NS.Blah x) {}
19572         }
19573
19574         Which depending on the context might be valid or not, as we do not
19575         know if Blah is the same thing as NS.Blah at that point.
19576
19577         * Redid everything so the code uses TypeRefs now instead of
19578         Types.  TypeRefs are just temporary type placeholders, that need
19579         to be resolved.  They initially have a pointer to a string and the
19580         current scope in which they are used.  This is used later by the
19581         compiler to resolve the reference to an actual Type. 
19582
19583         * DeclSpace is no longer a CIR.Type, and neither are
19584         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19585         are all DeclSpaces, but no Types. 
19586
19587         * type.cs (TypeRefManager): This implements the TypeRef manager,
19588         which keeps track of all the types that need to be resolved after
19589         the parsing has finished. 
19590
19591 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19592
19593         * ARGH.  We are going to have to store `foreach' as a class rather
19594         than resolving it, as we need to verify error 1579 after name
19595         resolution.   *OR* we could keep a flag that says `This request to
19596         IEnumerator comes from a foreach statement' which we can then use
19597         to generate the error.
19598
19599 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * class.cs (TypeContainer.AddMethod): we now add methods to the
19602         MethodGroup instead of the method hashtable.  
19603
19604         * expression.cs: Add MethodGroup abstraction, which gets us one
19605         step closer to the specification in the way we handle method
19606         declarations.  
19607
19608         * cs-parser.jay (primary_expression): qualified_identifier now
19609         tried to match up an identifier to a local variable reference or
19610         to a parameter reference.
19611
19612         current_local_parameters is now a parser global variable that
19613         points to the current parameters for the block, used during name
19614         lookup.
19615
19616         (property_declaration): Now creates an implicit `value' argument to
19617         the set accessor.
19618
19619 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19620
19621         * parameter.cs: Do not use `param' arguments as part of the
19622         signature, per the spec.
19623
19624 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19625
19626         * decl.cs: Base class for classes, structs and interfaces.  This
19627         is the "Declaration Space" 
19628
19629         * cs-parser.jay: Use CheckDef for checking declaration errors
19630         instead of having one on each function.
19631
19632         * class.cs: Factor out some code for handling error handling in
19633         accordance to the "Declarations" section in the "Basic Concepts"
19634         chapter in the ECMA C# spec.
19635
19636         * interface.cs: Make all interface member classes derive from
19637         InterfaceMemberBase.
19638
19639 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19640
19641         * Many things: all interfaces are parsed and generated in
19642         gen-treedump.  Support for member variables, constructors,
19643         destructors, properties, constants is there.
19644
19645         Beginning of the IL backend, but very little done, just there for
19646         testing purposes. 
19647
19648 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19649
19650         * cs-parser.jay: Fix labeled statement.
19651
19652         * cs-tokenizer.cs (escape): Escape " and ' always.
19653         ref_line, ref_name: keep track of the line/filename as instructed
19654         by #line by the compiler.
19655         Parse #line.
19656
19657 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19658
19659         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19660         to match the values in System.CodeDOM.
19661
19662         Divid renamed to Divide.
19663
19664         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19665         statements. 
19666         (Statements.set): remove.
19667
19668         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19669         statements. 
19670
19671         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19672         falseStatements always have valid values. 
19673
19674         * cs-parser.jay: Use System.CodeDOM now.
19675